Bug Report Capsules
A bug report capsule is a single JSON file built from one Flight Recorder run. It holds the request, the response with PII masked, the timings, a curl command with secrets replaced, and a SHA-256 seal. Use it to hand a failing request to someone else, for example in an issue, without sharing real data or credentials. They can check the seal and replay the request.
Export, verify and replay
Section titled “Export, verify and replay”Export a run as a capsule:
recon capsule export 01a22d22-db67-73af-a6ea-6590ab9f75e7 -o bugs/enroll.capsule.json{ "schema_version": "recon.capsule/v1", "capsule_id": "01a22d32-d03d-7285-8747-0cb261bb5e5d", "created_at": "2026-11-30T16:03:54.557813575+00:00", "workspace_name": "recon-demo", "method": "POST", "url": "http://127.0.0.1:4401/_sandbox/local/v1/enrollments", "request_headers": [ { "name": "Content-Type", "value": "application/json" }, { "name": "Authorization", "value": "[AIRLOCK:STRIPPED]" } ], "request_body": "{\n \"course\": \"CS-401\",\n \"student_id\": \"007218\"\n}", "status": 201, "protocol": "HTTP/1.1", "waterfall": { "dns_ms": 0.002774, "tcp_ms": 0.076374, "tls_ms": 0.0, "ttfb_ms": 1.187426, "download_ms": 0.0045260000000000005, "total_ms": 1.30503 }, "airlocked_response_headers": [ { "name": "content-type", "value": "application/json" },... ], "airlocked_response_body": "{\n \"course\": \"CS-401\",\n \"id\": \"enr_2026_091\",\n \"status\": \"enrolled\",\n \"student_id\": \"007218\",\n \"timestamp\": \"2026-11-30T15:46:28.836930518+00:00\"\n}", "assertions": [ { "assertion": "status == 201", "passed": true, "detail": "observed status 201" } ], "drift_summary": [], "curl_repro": "curl -i -X POST 'http://127.0.0.1:4401/_sandbox/local/v1/enrollments' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ${API_TOKEN}' \\\n -d '{\n \"course\": \"CS-401\",\n \"student_id\": \"007218\"\n}'", "airlock_email_domain": "example.edu", "compliance_receipt": { "salt_fingerprint": "9d2de0d49b08", "fields_masked": 1, "secrets_scrubbed": 0, "headers_stripped": 0, "verified_zero_leak": true, "leaked_tokens_found": [], "receipt_hash": "8c4259ea1325532762e61a21051212b686937a5e603ee35b88df0cd8f0a1fcdf" }, "capsule_sha256": "7a2e84685bff545d82ff20f9b59d4eb9a8695a3111a9bd1ce1dca845a56071bf"}The original request sent "student_id": "001001". In the capsule it is the masked value 007218, and the Authorization header is stripped.
Check the seal and the masking:
recon capsule verify bugs/enroll.capsule.jsonCapsule `01a22d32-d03d-7285-8747-0cb261bb5e5d` verify: VALID (hash_matches=true, zero_leak=true)Replay it against a running server:
recon capsule reproduce bugs/enroll.capsule.jsonReproduce `01a22d32-d03d-7285-8747-0cb261bb5e5d` -> http://127.0.0.1:4401/_sandbox/local/v1/enrollments (captured HTTP 201, live HTTP 201, 0.7ms, identical=false)Capsule format
Section titled “Capsule format”Fields appear in this order. schema_version is always recon.capsule/v1.
| Field | Type | Description |
|---|---|---|
schema_version |
string | recon.capsule/v1. |
capsule_id |
string | A new UUIDv7 for each export. |
created_at |
string | RFC 3339 time of the export. |
workspace_name |
string | name from .recon.toml. |
method |
string | HTTP method. |
url |
string | The run URL after redaction (see below). |
handler_location |
object | file, line, optional symbol. Omitted when no handler was found. |
request_headers |
array | name and value pairs after masking. |
request_body |
string | Request body after masking. Empty when the run had no body. |
status |
number | Recorded status code. |
protocol |
string | For example HTTP/1.1. |
waterfall |
object | dns_ms, tcp_ms, tls_ms, ttfb_ms, download_ms, total_ms. |
airlocked_response_headers |
array | Response headers after masking. |
airlocked_response_body |
string | Response body after masking. |
assertions |
array | Assertion results from the run: assertion, passed, detail. |
drift_summary |
array | Field drift findings for this request. Defaults to [] when absent. See Drift. |
curl_repro |
string | A curl command with secrets replaced. |
airlock_email_domain |
string | Domain used for masked emails. Defaults to example.edu. |
compliance_receipt |
object | The airlock receipt for the response body. See PII Airlock & Receipts. |
capsule_sha256 |
string | The seal. |
How export masks data
Section titled “How export masks data”Export never writes the raw run to the capsule. These steps run in order:
- The response headers and body go through the PII Airlock, using the mask settings from your workspace and the
--saltvalue. If the airlock reports any leaked token, export stops withzero-PII verification failed: unmasked tokens survived response scrubbing. - The request headers and body go through the same airlock. The same check applies, with the message
unmasked tokens survived request scrubbing. - The URL is redacted:
- A username or password in the URL becomes
REDACTED. - The path is masked as free text.
- Query values are masked as free text. If the query key contains
token,key,secret,passwordorauth, the value becomes<REDACTED>.
- A username or password in the URL becomes
- Every header value, the request body, the response body and the URL then go through an inline secret pass:
- A token that starts with
sk_live_,sk_test_,rk_live_,rk_dev_,rk_staging_,ghp_orAKIAis replaced with<SECRET_REDACTED>, up to the next space, quote or comma. Bearer xbecomesBearer ${API_TOKEN}, unless the value already starts with${,<REDACTEDor[AIRLOCK.
- A token that starts with
curl_reprois built from the masked values:curl -i -X METHOD 'url', one-H 'Name: value'per request header, and-d '...'for a body. A header whose value is exactly[AIRLOCK:STRIPPED]is written as-H 'Name: Bearer ${API_TOKEN}'. Single quotes in the body are escaped for the shell.- The seal is computed, and the capsule is verified as described below. If verification fails, export fails with
zero-PII verification failed:followed by the findings.
The airlock may leave values it does not treat as PII. In the demo, a JWT session_token in the response is kept as is.
The seal
Section titled “The seal”capsule_sha256 is the lowercase hex SHA-256 of:
recon-capsule-v1:{compact JSON of the capsule with capsule_sha256 set to ""}The JSON uses the field order above, no extra whitespace, and leaves out handler_location when it is empty. Any change to any field, including whitespace inside the body strings, breaks the seal.
Verify
Section titled “Verify”recon capsule verify <FILE>Verification does two things.
Seal check. It recomputes the hash. A mismatch adds this finding:
Capsule `01a22d32-d03d-7285-8747-0cb261bb5e5d` verify: INVALID (hash_matches=false, zero_leak=true) ! SHA-256 tamper detected: expected `90d27d0db9790a79e8477a4c1c17766cca049f33fe2e6f951ebb6292ab8c6a48`, found `7a2e84685bff545d82ff20f9b59d4eb9a8695a3111a9bd1ce1dca845a56071bf`Here the status field was changed from 201 to 500.
Leak check. It fails when:
compliance_receipt.verified_zero_leakisfalse. Finding:compliance_receipt.verified_zero_leak is false.- An email, SSN or phone number that does not look synthetic appears in
url,request_body,airlocked_response_body,curl_reproor any header value. Finding:potential unmasked PII token `x` detected. - One of these texts contains
sk_live_,sk_test_,ghp_orAKIA, orBearerfollowed by anything other than${,[AIRLOCKor<REDACTED. Finding:raw credential/secret prefix detected in capsule.
These values count as synthetic and are allowed:
- Emails at the capsule’s
airlock_email_domain,example.eduorexample.com. - Phone numbers that start with
(555). - SSNs in the form
NNN-NN-NNNNwhose first three digits are 900 or higher.
A capsule with a real email added and a correct new seal:
Capsule `01a22d32-d03d-7285-8747-0cb261bb5e5d` verify: INVALID (hash_matches=true, zero_leak=false) ! potential unmasked PII token `jane.doe@gmail.com` detectedThe capsule is valid only when the seal matches and there are no findings. With --format json:
{ "valid": true, "hash_matches": true, "zero_leak_verified": true, "findings": []}Reproduce
Section titled “Reproduce”recon capsule reproduce <FILE> [--base-url URL]Reproduce sends the capsule’s request again and diffs the live response against the captured one.
- It does not verify the capsule first. Run
recon capsule verifyyourself if that matters. - It builds the target URL. Without
--base-url, it uses the capsuleurl. With--base-url, it takes the base and appends the capsule URL’s full path and query. - It drops request headers whose value contains
[AIRLOCK:STRIPPED]. Other headers are sent as stored, includingBearer ${API_TOKEN}placeholders, which are not filled in. - It sends the body as JSON when it starts with
{or[, as text otherwise, and sends no body when empty. The body is the masked body from the capsule, so the server receives masked values. - The request passes through the outbound secret firewall before it is sent.
- It runs a semantic diff between the captured masked response and the live response, ignoring the
volatile_pathsfrom.recon.toml. See Twin-Run & Diff for the diff format.
Because the captured body is masked and the live body is not, identical is usually false:
recon capsule reproduce bugs/enroll.capsule.json --base-url http://127.0.0.1:4401 --format json{ "capsule_id": "01a22d32-d03d-7285-8747-0cb261bb5e5d", "captured_status": 201, "live_status": 201, "replayed_url": "http://127.0.0.1:4401/_sandbox/local/v1/enrollments", "status_changed": false, "identical": false, "live_total_ms": 0.8713580000000001, "diff": { "status_left": 201, "status_right": 201, "status_changed": false, "latency_delta_ms": -0.43367199999999984, "header_changes": [], "body_changes": [ { "path": "$.student_id", "pattern": "$.student_id", "kind": "changed", "left": "\"007218\"", "right": "\"001001\"" } ], "ignored_count": 1, "identical": false }}Here $.timestamp was ignored as volatile and the masked student_id differs from the live one. Compare status_changed and the shape of body_changes rather than relying on identical.
The global transport flags of recon, such as TLS and proxy settings, apply to the replay. See Transport.
Export reference
Section titled “Export reference”recon capsule export <RUN_ID> [-o PATH] [--markdown]| Argument | Default | Description |
|---|---|---|
RUN_ID |
required | Flight Recorder run ID. |
-o, --output |
none | Also write to this file. Missing parent directories are created. Writes Markdown when --markdown is set, JSON otherwise. |
--markdown |
off | Print a Markdown issue report instead of JSON. |
The command always prints the result, even with -o. Without --markdown the output is the capsule JSON in every --format.
The backend handler comes from the request’s # @handler tag. If the request has none, Recon scans the workspace and uses the first route with the same method whose path matches the full run URL. That fallback usually fails when base_url includes a path prefix, because the segment counts differ. Run recon scan --sync first to add the tags.
recon capsule export always writes an empty drift_summary. The HTTP route fills it, see Also available via.
Markdown report
Section titled “Markdown report”recon capsule export 01a22d22-db71-7526-83bf-b9b2acfcae86 --markdown## Bug Report Capsule: `GET http://127.0.0.1:4401/_sandbox/local/v1/students` (HTTP 200)
- **Capsule ID:** `01a22d32-f185-7482-a80f-cc215bd31e7c`- **Workspace:** `recon-demo`- **Created:** 2026-11-30T16:04:03.077173518+00:00- **Protocol & Timing:** `HTTP/1.1` · `0.5ms` total (`ttfb 0.4ms`)- **Backend Handler:** `server/src/routes.rs:16`- **Zero-PII Airlock:** `VERIFIED ZERO-LEAK` (`fields_masked: 11`, `headers_stripped: 0`, receipt `bda12dd57c54`)- **Tamper-Evident SHA-256:** `4427dd721c7d8cf6287e445c6de2e4e57e49337c1a33f5dcb6d7e4adbd7ab4c9`
### Assertions- **[PASS]** `status == 200` — observed status 200- **[PASS]** `jsonpath $.students[0].program == MDiv` — observed `MDiv`
### Airlocked Response Body```json{ "environment": "local",... "students": [ { "email": "micah.vaughn.9383@example.edu", "full_name": "Eli Bennett", "gpa": 3.92,...}```
### Replay Command (Secret-Safe)```bashcurl -i -X GET 'http://127.0.0.1:4401/_sandbox/local/v1/students' \ -H 'Authorization: Bearer ${API_TOKEN}'```The report has these parts:
- A title with method, URL and status.
- Capsule ID, workspace, creation time, protocol, total time and time to first byte.
- The backend handler, when known.
- The airlock line:
VERIFIED ZERO-LEAKorUNVERIFIED,fields_masked,headers_stripped, and the first 12 characters of the receipt hash. - The seal.
- An “Assertions” section, when the run has assertions.
- A “Schema Drift Findings” section, when
drift_summaryis not empty. - “Request Payload (Sanitized)”, when there is a request body.
- “Airlocked Response Body” and “Replay Command (Secret-Safe)”.
The Markdown is not sealed. Only the JSON capsule can be verified.
Errors and exit codes
Section titled “Errors and exit codes”| Command | Exit code | When |
|---|---|---|
capsule export |
0 |
Capsule written. |
capsule verify |
0 |
Valid. |
capsule verify |
1 |
Seal mismatch or leak findings. |
capsule reproduce |
0 |
Live status below 400. |
capsule reproduce |
1 |
Live status 400 or higher. |
| all | 2 |
Runtime error. |
Runtime errors print E_CLI_RUNTIME with one of these messages:
| Message | Cause |
|---|---|
run `ID` not found |
No run with that ID (export). |
failed to read `PATH` |
The capsule file cannot be read. |
zero-PII verification failed: ... |
Export found a leak it could not mask. |
invalid replay base URL: relative URL without a base |
--base-url is not an absolute URL. |
wire replay error: TCP connection failed to `127.0.0.1:4499`: Connection refused (os error 111) |
The target server is not reachable. |
airlock error: ... |
The secret firewall blocked the replay. |
A capsule file that is not valid capsule JSON fails with a JSON parse error.
A replay that reaches the server but gets an error status exits 1:
Reproduce `01a22d25-1a65-7322-a242-fe05349315ef` -> http://127.0.0.1:4401/_sandbox/local/v1/enrollments (captured HTTP 201, live HTTP 405, 0.4ms, identical=false)Also available via
Section titled “Also available via”HTTP (see HTTP API):
| Route | Body | Returns |
|---|---|---|
POST /api/v1/capsules/export |
{"run_id": "..."} |
{"capsule", "verification", "markdown"} |
POST /api/v1/capsules/verify |
{"capsule": {...}} |
{"verification"} |
POST /api/v1/capsules/reproduce |
{"capsule": {...}, "base_url": "..."}, base_url optional |
{"replay"} |
The export route differs from the CLI in two ways. For the handler fallback it uses the last cached scan instead of scanning. It also fills drift_summary with the field drift findings for the run’s request name, computed from the cached scan and the 20 most recent runs.
MCP (see MCP Tools): recon_export_capsule with run_id and markdown (default true). It returns capsule, verification and markdown. It uses only the # @handler tag for the handler and always leaves drift_summary empty.
Web Studio: the command palette entry “Export / Reproduce Zero-PII Bug Capsule” opens a dialog with two tabs. “Export Current Run” offers “Copy Issue Markdown” and “Download .capsule.json” (saved as recon- plus the first 8 characters of the capsule ID). “Verify & Reproduce” takes a pasted capsule and an optional base URL, with “Verify Seal” and “Reproduce & Diff” buttons. See Web Studio.