Echoproof
Bahasa Indonesia | English
Behavioral verification for every code change, based on real traffic.
Echoproof records real requests and responses from your service, replays them against the build that contains a code change, and reports what changed, on which endpoint and field, for what share of requests, and whether that change was intended. Use the result as a merge gate in CI, or let a coding agent (Claude Code, Cursor and similar tools) check its own work directly.
record -> replay against old and new build -> semantic diff -> judge against intent -> gate
Contents
- Why Echoproof
- Key features
- Installation
- Quick start
- Demo
- Concepts
- Command reference
- Configuration
- Reading the report
- CI integration
- Coding agent integration (MCP)
- Security and privacy
- Limitations
- Development
- License
Why Echoproof
When much of the code is written by AI agents, the number of changes grows far faster than people can review them. Passing tests and a tidy-looking diff do not guarantee that the system still behaves correctly: tests are written from assumptions, while bugs often come from real combinations of data that nobody thought of.
Echoproof answers a question that neither unit tests nor code review answer:
Does this change alter how the system behaves on real traffic, and is that the change that was meant?
An example of what Echoproof catches: a pull request meant to "add a currency field to the catalog" accidentally passes one argument in the wrong position. As a result, the price of 3 out of 8 menu items changes while the other 5 stay correct. Unit tests pass and the code diff looks reasonable. Echoproof reports products[*].price: 18000 -> 22000 on every catalog request and flags it as a regression.
Key features
- Records real traffic. A reverse proxy records every request and response, with sensitive data redacted before anything is written to disk.
- Semantic diff. JSON is compared field by field, not line by line. Changes are grouped per endpoint and field and classified as
breaking,behaviororadditive. - Resistant to noise. UUIDs, timestamps and random values are recognized automatically. Fields that change on their own between runs are learned by replaying the old build twice.
- Safe with state. Write requests are not replayed unless allowed per endpoint. The old and new builds are compared on the same data, with a reset command between every pass.
- Aware of intent. Each group of changes can be judged by Claude against the pull request description or the agent's task. Changes the intent does not explain are flagged as regressions.
- Built for CI and agents. Exit codes for merge gates, Markdown reports for pull request comments, JSON for automation, and an MCP server for coding agents.
Installation
Homebrew (macOS and Linux)
Prebuilt binary (recommended)
Download the archive for your platform from the releases page, or from the terminal:
VERSION=v0.1.0
TARGET=aarch64-apple-darwin # or x86_64-apple-darwin, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu
With Cargo
If you have Rust 1.85 or later:
From source
Requirements: Rust 1.85 or later. curl is needed to run the demo.
The echoproof binary is installed in ~/.cargo/bin. Make sure that directory is on your PATH:
&&
Quick start
These steps check a code change on a service running in your test environment.
1. Create a configuration file (optional; every setting has a default):
2. Record traffic. Run the proxy in front of the service, then point your app, Postman or automated tests at the proxy address:
Stop it with Ctrl-C once representative traffic has been collected.
Laravel apps can record without a proxy using echoproof/laravel: run composer require echoproof/laravel, set ECHOPROOF_RECORD=true in .env, and traffic is written to storage/echoproof/traffic.jsonl with the same redaction rules.
3. Run two builds, the version before the change (base) and after it (PR), using the same database.
4. Compare:
5. Read the result. Exit code 0 means no unexpected changes, 1 means a regression was found, and 2 means an error occurred. See Reading the report.
To judge the changes against their intent, add the pull request description and the code diff:
Demo
The full demo takes about 10 seconds and does not need a service of your own:
The demo uses a small POS backend (examples/demo-shop) that has state: product stock goes down with every order. A "pull request from an agent" is meant to add a currency field to products, but it also changes how promo and voucher discounts are combined.
| Step | What it shows |
|---|---|
| 1. Record 2,000 requests from the production version | Recording |
| 2. Replay against the same version, compared with the recording | False alarms caused by state: stock was consumed during recording |
3. Compare the base and PR builds with --base and --reset, safe mode |
False alarms disappear. currency is detected. Write requests are reported as unverified |
4. Same as step 3, with --allow-writes "POST /orders" |
The discount bug is caught, only on orders that use a promo and a voucher together |
5. Intent judging by Claude (when ANTHROPIC_API_KEY is set) |
currency is judged intended, the discount change is judged a regression |
Concepts
Snapshot
A snapshot is a JSONL file with one request and response pair per line. Headers and sensitive fields are redacted before they are written. The same snapshot can be reused to check many pull requests.
Two comparison modes
| Mode | Command | Suited for |
|---|---|---|
| Against the recording | echoproof check -s traffic.jsonl -t URL_PR |
Stateless services, or environments whose data matches the time of recording |
| Base vs PR | echoproof check -s traffic.jsonl --base URL_BASE -t URL_PR |
Services backed by a database (recommended) |
In base vs PR mode, the recorded responses are not used as the reference. Echoproof replays the same traffic against both builds on the same data:
reset -> replay against base -> reference
reset -> replay against base again -> fields that differ are recorded as noise
reset -> replay against PR -> candidate
diff reference and candidate, ignoring noise
Each build's own address (for example http://127.0.0.1:8001 inside image URLs or pagination links) is normalized automatically, so two builds running on different ports remain comparable.
Safe mode
By default only GET, HEAD and OPTIONS requests are replayed. Write requests are skipped and never counted as passing: the report states how many there were and warns that their behavior is unverified.
Allow write requests per endpoint, and only against an environment that may be modified or can be reset:
Use --reset (or replay.reset) to restore state before every pass, for example by restoring a database dump or calling a reset endpoint in the test environment. Echoproof refuses to replay write requests without a reset while noise is being learned, because state changes between runs would be learned as noise and hide regressions.
Semantic diff
-
JSON is compared field by field.
5and5.0are equal, and key order is ignored. -
Every change is classified:
Classification Examples breakingField removed, type changed (including to null), 2xx status turned into an errorbehaviorValue changed, array length changed, status changed additiveNew field -
Paths are normalized:
/products/42becomesGET /products/{id}, anditems[3].pricebecomes$.items[*].price. Each change is counted once per request. -
UUIDs, ULIDs and date-times of the same shape are treated as noise. Bare dates (such as
2026-10-14) are still compared.
Change intent
There are two ways to tell Echoproof which changes are expected.
| Option | Granularity | When to use it |
|---|---|---|
--expect "GET /products/*" |
Endpoint | Fast, free, no external service |
--intent "..." |
Endpoint, field and value | When the intended change and a bug can occur on the same endpoint |
--expect lets every change on the listed endpoints through. If a pull request is meant to change the catalog but also breaks prices in the catalog by accident, --expect "GET /catalog" will not catch it.
With --intent, each group of changes is judged by Claude and given a verdict of intended, regression or unclear, with a reason that cites example values. The judge sees the stated intent, the code diff (optional), the share of affected requests, examples of changed requests with their before and after values, and examples of unchanged requests on the same endpoint for contrast. unclear verdicts and groups the judge did not rule on are treated as regressions (fail closed).
Intent judging requires an Anthropic API key. Each run makes one API call, and only when something changed. A typical run costs about USD 0.01 to 0.02 with the default model.
Third-party calls
A service that calls payment gateways, messaging or other APIs must not reach them during a replay. With echoproof/laravel, those calls are recorded with each request, and builds started with ECHOPROOF_REPLAY=true answer them from the recording and block everything else. Both builds therefore receive identical third-party responses, and Echoproof compares what each build sent:
x POST /checkout 3/3 changed (100.0%) unexpected
behavior value changed outbound[POST pay.example.com/v2/charges] $.amount (3 requests)
outbound[POST pay.example.com/v2/charges] $.amount: 18000 -> 1800000
The checkout response was identical in this example; only the amount sent to the gateway changed. A call that was never recorded is reported as call added with severity breaking. If a build reports calls that Echoproof cannot read, the request fails the check instead of passing unverified.
Command reference
| Command | Purpose |
|---|---|
echoproof init |
Writes echoproof.toml with every setting explained |
echoproof record --upstream URL --out FILE |
Runs a reverse proxy that records traffic |
echoproof replay -s FILE -t URL -o FILE |
Replays a snapshot against a target and saves its responses |
echoproof diff BASELINE CANDIDATE |
Compares two snapshots |
echoproof check -s FILE -t URL |
Replays and diffs in one step, against the recording |
echoproof check -s FILE --base URL -t URL |
Replays and diffs, base vs PR on the same state |
echoproof accept CANDIDATE --baseline FILE |
Makes reviewed responses the new baseline |
echoproof mcp |
Runs the MCP server for coding agents |
Common options:
| Option | Applies to | Description |
|---|---|---|
--config FILE |
all | Configuration file, default echoproof.toml |
--expect PATTERN |
diff, check |
Endpoint expected to change. Repeatable |
--intent TEXT, --intent-file FILE |
diff, check |
Change intent to be judged by Claude |
--code-diff FILE |
diff, check |
Code diff given to the intent judge |
--format text|markdown|json |
diff, check |
Terminal output format, default text |
--output FILE |
diff, check |
Saves the report. The format follows the extension (.md, .json) |
--max-examples N |
diff, check |
Examples per group of changes, default 2 |
--base URL |
check |
Reference build for base vs PR mode |
--reset CMD |
check |
Shell command that restores state before every pass |
--noise-runs N |
check |
Extra base replays used to learn noise, default 1 |
--allow-writes PATTERN |
replay, check |
Endpoint whose write requests may be replayed. Repeatable |
--concurrency N |
replay, check |
Parallel requests, default 1 |
--save FILE |
check |
Saves the candidate snapshot |
Endpoint patterns: POST /orders, GET /products/* (* matches one segment), /admin/** (** matches any number of segments), or * for everything.
Exit codes: 0 passed or only expected changes, 1 regression found, 2 error (configuration, network, failed reset, or failed intent judging).
Configuration
Every setting is optional. Run echoproof init to create a file with all settings and their explanations.
[]
= "http://127.0.0.1:8000"
= "127.0.0.1:8080"
[]
# Applied when recording and when replaying, so redacted values stay comparable.
= ["authorization", "cookie", "set-cookie", "x-api-key"]
= ["password", "token", "pin", "card_number", "phone", "email"]
[]
= 1 # raise only for stateless endpoints
= 10000
= { = "Bearer ${STAGING_TOKEN}" } # replaces redacted headers
= ["GET", "HEAD", "OPTIONS"]
= ["POST /orders"] # empty by default (safe mode)
= "./scripts/restore-test-db.sh"
= 1
[]
= ["updated_at", "$.meta.trace_id", "items[*].etag"]
= ["GET /products/*"]
= true
= ["content-type"]
[]
= "claude-opus-5-5"
= "high" # low, medium, high, xhigh, max
= true
[]
= [] # hosts besides localhost that agents may use
ignore patterns: a bare name (updated_at) matches at any depth. Patterns that start with $ or contain a dot ($.meta.trace_id, items[*].etag) are anchored at the body root.
Environment variables:
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
API key for intent judging (alternative: ANTHROPIC_AUTH_TOKEN) |
ANTHROPIC_WORKSPACE_ID |
Required when the API key is not scoped to a single workspace |
ANTHROPIC_BASE_URL |
Alternative API endpoint. Must use https, except for localhost |
ECHOPROOF_JUDGE_TRACE |
Saves the judge's request and response to a file (mode 0600) for debugging |
Reading the report
Example terminal report:
echoproof: REGRESSION - 83 exchanges, 5 changed, 78 unchanged
ignored 1 noisy fields that differ between runs of the base build: GET /up body
intent judged by claude-opus-5-5: The currency field is added as intended. ...
x GET /catalog 5/5 changed (100.0%) unexpected
behavior value changed $.result.products[*].price (5 requests)
[regression] The diff swaps the third argument of products() ...
GET /catalog [00e36fd43ade]
$.result.products[1].price: 18000 -> 22000
additive added $.result.currency (5 requests)
[intended] Adding 'currency' => 'IDR' matches the intent.
- GET /branches 0/5 changed (0.0%) unchanged
result: FAIL
| Marker | Meaning |
|---|---|
x |
The endpoint changed in an unexpected way (regression) |
~ |
The endpoint changed as expected or as intended |
- |
The endpoint did not change, or its requests were not replayed |
(N requests) |
Number of requests with that change |
[intended], [regression], [unclear] |
Intent verdict and its reason |
Other formats:
--format markdownproduces a report ready to post as a pull request comment.--format jsonproduces structured data, includingfindings: one sentence per problem, ready to hand back to a coding agent.
Once changes have been reviewed and approved, make the result the new baseline:
CI integration
Use the Echoproof GitHub Action. It installs the release binary, runs echoproof check, writes the report to the job summary and exposes the verdict as an output:
- name: Start base and PR builds
run: ./scripts/start-builds.sh # base on :8001, PR on :8002, same test database
- run: git diff origin/${{ github.base_ref }}...HEAD > change.diff
- name: Behavior check
id: echoproof
uses: est57/echoproof-action@v1
with:
snapshot: traffic/baseline.jsonl
base: http://127.0.0.1:8001
target: http://127.0.0.1:8002
reset: ./scripts/reset-db.sh
intent: ${{ github.event.pull_request.title }}
code-diff: change.diff
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
- name: Comment on PR
if: always()
run: gh pr comment ${{ github.event.number }} --body-file "${{ steps.echoproof.outputs.report }}"
env:
GH_TOKEN: ${{ github.token }}
A regression fails the step and blocks the merge. Set fail-on-regression: false to only report. On other CI systems, install the binary and run echoproof check directly; exit code 1 means a regression.
Coding agent integration (MCP)
In this recorded run, Claude Code (Sonnet) was asked to trim the cashier name in the order service. A discount bug had been planted in the same file beforehand. The check failed, the agent traced the regression to the bug it had not written, fixed it, and only reported the task done after the check passed.
echoproof mcp runs a Model Context Protocol server over stdio, so a coding agent can check the changes it made before declaring the work done.
Install in your coding agent
Install the echoproof binary first (brew install est57/tap/echoproof or cargo install echoproof). Every agent below starts echoproof mcp in your project folder, so it can reach your local builds and snapshot files.
Claude Code, as a plugin (recommended). The plugin adds the MCP server and a verify-behavior skill that tells Claude when and how to check its changes, so no extra instructions in CLAUDE.md are needed:
/plugin marketplace add est57/echoproof
/plugin install echoproof@echoproof
From a shell: claude plugin marketplace add est57/echoproof and claude plugin install echoproof@echoproof.
Claude Code, MCP server only:
Cursor (.cursor/mcp.json in the project, or ~/.cursor/mcp.json), Claude Desktop (claude_desktop_config.json), and other clients that read an mcpServers map:
VS Code with Copilot agent mode (.vscode/mcp.json):
Codex CLI: codex mcp add echoproof -- echoproof mcp, or in ~/.codex/config.toml:
[]
= "echoproof"
= ["mcp"]
Gemini CLI: gemini mcp add echoproof echoproof mcp, which writes .gemini/settings.json in the project.
The Claude Code integration has been tested end to end. The other clients use the same standard MCP over stdio but have not been tested yet; reports are welcome. Web-based assistants such as ChatGPT and Claude.ai cannot use Echoproof, because they run on the provider's servers and cannot reach the builds on your machine.
Echoproof is listed in the official MCP Registry under this name:
mcp-name: io.github.est57/echoproof
Tools
| Tool | Main inputs | Purpose |
|---|---|---|
echoproof_check |
snapshot, target, base, intent, expect, allow_writes |
Replays and diffs. Returns a report for the agent, structured JSON and a run_id |
echoproof_diff |
baseline, candidate, intent, expect |
Compares two existing snapshots |
echoproof_exchange |
run_id, id |
Full request, reference and candidate responses, and field-level changes |
Agent workflow: change the code, start the build, call echoproof_check with the task as intent, and on a regression, open examples with echoproof_exchange, fix the code and check again. The server deliberately offers no accept tool, because approving a new baseline remains a human decision.
Security and privacy
Recorded data
- Headers and fields listed in
[sanitize]are replaced with[REDACTED]before they are written to disk. Add the fields that hold personal data in your domain, such as phone numbers, email addresses or identity numbers. - Snapshots contain business data. Keep them out of public repositories or make sure they are in
.gitignore.
Data sent to Anthropic when using --intent
The intent text, the code diff (when given), endpoint and field names, the number of affected requests, and example request bodies with before and after values, after redaction. Example bodies over 4,000 characters are truncated. Nothing is sent when --intent is not used.
Built-in safeguards
- Write requests are never replayed without explicit per-endpoint permission.
- Paths from a snapshot are validated so that requests, and any injected credentials, cannot be redirected to another host.
- Responses are capped at 32 MB.
- The API key is only sent over
https, except tolocalhost. - Text from outside (intent, diff, traffic) cannot change the structure of the judge's prompt or break tables in Markdown reports.
Safeguards for coding agents (MCP)
targetandbasemust be onlocalhostunless the host is listed in[mcp] allowed_hosts. Replays carry the headers fromreplay.headers, so an agent must not be able to send them to another host.- File paths (
snapshot,save,code_diff_file) must be inside the project directory. Symlinks that lead outside it are rejected. - The reset command is only read from
echoproof.toml, never from the agent.
Limitations
- Write requests need a test environment that can be reset. Without one, use safe mode, which only verifies read requests.
- Third-party calls are mocked only for Laravel apps that use the
Httpclient, through echoproof/laravel. SDKs with their own HTTP client, other languages and non-HTTP dependencies (SMTP, queues) are still called for real during replay. - IDs across requests: with sequential replay (
concurrency = 1), an ID that the replay creates differently from the recording (order 9812 recorded, order 57 replayed) is carried into later requests for the same entity (/orders/9812,order_id). IDs of data that already existed when the traffic was recorded cannot be mapped; with--base, those requests are reported as not reproduced instead of being counted as unchanged. Turn mapping off with--no-id-mappingor[replay] map_ids = false. - Request order is preserved by replaying sequentially (
concurrency = 1). Large traffic can be slow, and parallel replay is only safe for stateless endpoints. - Changes that should have happened but did not are hard to detect, because Echoproof reports requests that changed.
- Rare noise can slip past a single learning run. Raise
--noise-runsor add anignorepattern when needed.
Development
Repository layout
crates/echoproof-core snapshot format, sanitization, diff, reports, intent judging
crates/echoproof-cli `echoproof` binary: recorder, replay, CLI, MCP server
examples/demo-shop POS backend for the demo and the eval
eval/judge intent judge eval: cases, runner and grader
scripts/demo.sh end-to-end demo
Running the tests
Intent judge eval
eval/judge contains 26 labelled pull request scenarios (54 groups of changes) that measure how accurately the judge separates intended changes from regressions. With the default configuration the judge scored 100% correct gate decisions across 78 runs, with no false alarms. The current scenarios are no longer hard enough to tell better configurations apart, so cases from real systems are being added. The case list is in eval/judge/CASES.md.
The runner refuses to start until the harness has been approved once with --approve-harness, and asks for approval again whenever the runner, the cases or the judge change.
License
Echoproof is licensed under either of the following, at your option:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
Unless you explicitly state otherwise, any contribution you submit for inclusion in this project is dual licensed as above, without any additional terms or conditions.