Send & Test
recon send runs one request and prints the response. recon test runs every saved request in the workspace (or a filtered subset), evaluates assertions, and reports pass or fail. Use send while you work on an endpoint and test in CI. Both record their runs in the Flight Recorder.
The request file syntax (### separators, # @name, # @assert, {{variables}}) is described in .http Request Files. This page covers the two commands.
recon send
Section titled “recon send”recon send "List Students"recon send campus-demo-list-students --env stagingrecon send -X POST http://127.0.0.1:8787/_sandbox/local/v1/enrollmentsHow the target is resolved
Section titled “How the target is resolved”<TARGET> is matched in this order:
- A saved request whose
idequals<TARGET>exactly, or whosenameequals<TARGET>ignoring case. For example, the demo request namedList Studentshas the IDcampus-demo-list-students. - Otherwise, if
<TARGET>starts withhttp://orhttps://, an ad-hoc request to that URL with the method from-X(defaultGET), no headers and no body. - Otherwise
reconprints anE_NOT_FOUNDerror and exits with status 2.
A path to a .http file is not accepted as a target.
| Flag | Default | Meaning |
|---|---|---|
<TARGET> |
required | Saved request ID or name, or an http:// / https:// URL. |
--env <ENV> |
workspace default_env |
Environment whose variables fill {{...}} templates. |
-X, --method <METHOD> |
GET |
HTTP method for an ad-hoc URL. Ignored for saved requests, which use the method from the file. |
--airlock |
off | Print the PII Airlock-masked body instead of the raw body. |
The global flags --workspace, --format and --salt apply, as do the transport flags (--proxy, --no-proxy, --ca-cert, --client-cert, --client-key, --cookies, --cookie-jar, --no-network-config, -k/--insecure) described in Transport: TLS, Proxy & Cookies. The full flag list is in the CLI Reference.
If --env names an environment that does not exist, no variables are available. Templates stay unresolved and a URL such as {{base_url}}/v1/students fails with an E_CLI_RUNTIME “invalid URL” error.
What send does
Section titled “What send does”- Loads the workspace and picks the environment.
- Runs the request’s pre-request script, if any. Its variable overrides, extra headers and extra query parameters are applied. See Pre/Post Scripting.
- Resolves templates, secret references and auth. See Auth & Request Signing.
- Checks the resolved request with the Outbound Secret Firewall. A violation stops here with
E_FIREWALL_BLOCKEDand exit status 1. Nothing is sent or recorded. - Sends the request and evaluates the request’s
# @assertlines. Template variables inside assertions are not resolved bysend(they are bytest), so an assertion such as== {{program}}compares against the literal text{{program}}. - Saves cookies to
--cookie-jar, if set. - Runs the post-response script, if any. Its assertions are added to the results, its log lines are kept, and its captured variables are scrubbed of secret values. If the script fails,
sendstops here withE_CLI_RUNTIMEand exit status 2. The request has already been sent, but the response is not printed and the run is not recorded. - Masks the response with the PII Airlock to build the AI-safe body and the compliance receipt.
- Records the run in the Flight Recorder.
- Prints the result.
Output
Section titled “Output”Human output (--format human, or a terminal) is a status line, one line per assertion, one [script] line per script log line, then the body:
GET http://127.0.0.1:8787/_sandbox/local/v1/students 200 0.7ms 669B -> 669B (HTTP/1.1) ✓ status == 200 ✓ jsonpath $.students[0].program == MDiv{"environment":"local","request_id":"req_5c78bf92fb314d029be55ab937fe9156","session_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzdGFmZl8wMSIsInNjb3BlIjoic2lzOnJlYWQiLCJleHAiOjE4OTM0NTYwMDB9.demo_sig","students":[{"email":"elena.original@westminster.edu","full_name":"Elena Vance-Original","gpa":3.92,"notes":"Advisor note: email elena.original@westminster.edu before Friday","phone":"503-555-0182","program":"MDiv","ssn":"123-45-6789","student_id":"001001"},{"email":"marcus.real@westminster.edu","full_name":"Marcus Realman","gpa":3.74,"notes":"Transfer credits verified","phone":"(503) 555-0199","program":"MA","ssn":"987-65-4321","student_id":"001042"}]}The status line is: method, final URL (after redirects), status code, total milliseconds, wire bytes -> decoded bytes, and protocol. A failed assertion prints ✗ <assertion> (<detail>). With --airlock, the body is the masked body.
JSON output (--format json or --format agent, and the default when stdout is piped) is one object:
| Field | Meaning |
|---|---|
run_id |
Flight Recorder run ID. Pass it to recon diff, recon contract, recon capsule export and others. |
status |
HTTP status code. |
protocol |
For example HTTP/1.1. |
waterfall |
Timing in milliseconds: dns_ms, tcp_ms, tls_ms, ttfb_ms, download_ms, total_ms. |
wire_bytes, decoded_bytes |
Body size before and after content decoding. |
assertions |
Array of { "assertion", "passed", "detail" }. |
script_logs |
Script log lines with secret values scrubbed. |
captured_vars |
Variables captured by the post-response script, with secret values scrubbed. |
body |
Raw body with --format json. Airlock-masked body with --format agent or with --airlock. |
compliance_receipt |
Airlock receipt: fields_masked, headers_stripped, secrets_scrubbed, leaked_tokens_found, verified_zero_leak, salt_fingerprint, receipt_hash. |
When stdout is piped, the default auto format resolves to agent, so the body is masked:
recon send "List Students" > run.json{ "assertions": [ { "assertion": "status == 200", "detail": "observed status 200", "passed": true }, { "assertion": "jsonpath $.students[0].program == MDiv", "detail": "observed `MDiv`", "passed": true } ], "body": "{\n \"environment\": \"local\",\n \"request_id\": \"req_ef66413558b749ee9c60dd25a378e0ba\",\n ...", "captured_vars": {}, "compliance_receipt": { "fields_masked": 11, "headers_stripped": 0, "leaked_tokens_found": [], "receipt_hash": "4f192da3df06b4baaaa71caf4b151cb237109bc7963fd4f352795caa16b0cb95", "salt_fingerprint": "9d2de0d49b08", "secrets_scrubbed": 0, "verified_zero_leak": true }, "decoded_bytes": 669, "protocol": "HTTP/1.1", "run_id": "01a22d22-9a6b-73d6-9ea5-8c2526c9bd8b", "script_logs": [], "status": 200, "waterfall": { "dns_ms": 0.002123, "download_ms": 0.009194, "tcp_ms": 0.08271300000000001, "tls_ms": 0.0, "total_ms": 0.395288, "ttfb_ms": 0.250853 }, "wire_bytes": 669}The body string is shortened above.
What send records
Section titled “What send records”Each successful send writes one Flight Recorder run with actor cli and label cli. Secret values are replaced in the URL, request headers and request body, for example Bearer [SECRET:DEV_API_TOKEN]. The response headers and the raw response body are stored as received, together with the assertions and the Airlock receipt.
Exit codes
Section titled “Exit codes”| Code | When |
|---|---|
0 |
The request completed and every assertion passed. A request with no assertions exits 0 whatever its HTTP status. |
1 |
At least one assertion failed, or the firewall blocked the request (E_FIREWALL_BLOCKED). |
2 |
E_NOT_FOUND (unknown target), or any other error such as a connection failure (E_CLI_RUNTIME). |
recon test
Section titled “recon test”recon testrecon test "Students" --env stagingrecon test --data rows.csv --junit out/junit.xml --markdown-summary out/summary.mdSelection
Section titled “Selection”With no [FILTER], every saved request in the workspace runs. With a filter, a request runs if its name, its ID or its source file path contains the filter as a substring (case-sensitive). A filter that matches nothing runs zero requests, prints 0 passed, 0 failed, and exits 0.
Requests run one at a time, in the order the workspace loads them. There is no parallelism and no fail-fast option: a failing request does not stop the run.
| Flag | Default | Meaning |
|---|---|---|
[FILTER] |
none | Substring matched against request name, ID and source file path. |
--env <ENV> |
workspace default_env |
Environment for every request. |
--junit <PATH> |
none | Write a JUnit XML report. Parent directories are created. |
--markdown-summary <PATH> |
none | Write a Markdown summary. - prints it to stdout instead of the normal output. |
--data <PATH> |
none | CSV or JSONL dataset. Every selected request runs once per row. |
--openapi-spec <PATH> |
none | OpenAPI 3.0 or 3.1 document (YAML or JSON). Every response is validated against it. |
Global and transport flags apply as for send. File paths are resolved against the current directory, not against --workspace.
How a request passes
Section titled “How a request passes”For each request (and each dataset row), test runs the same steps as send: pre-request script, template and auth resolution, firewall check, send, post-response script. Template variables inside # @assert lines are resolved with the environment and the dataset row before evaluation.
A request passes when every assertion passed, and either it has at least one assertion or its HTTP status is below 400. Assertions include those from the file, those added by the post-response script, and the OpenAPI check when --openapi-spec is set.
A firewall block does not stop the run. The request counts as failed with the error Firewall blocked <n> violation(s) and status 0.
There are no timing budgets or SLA thresholds in recon test. Use Load Testing for latency and error-rate budgets.
Datasets (--data)
Section titled “Datasets (--data)”The format is chosen by file extension: .csv is CSV, .jsonl and .ndjson are JSONL. Any other extension is detected from content: if the first non-empty line starts with {, it is JSONL, otherwise CSV. A leading UTF-8 byte-order mark is ignored.
- CSV follows RFC 4180 (quoted fields, doubled quotes, embedded newlines). The first record is the header. Every data row must have the same number of columns as the header, otherwise the run stops with an error naming the row. Blank rows are skipped.
- JSONL needs one JSON object per non-empty line. Strings are used as is, numbers and booleans as their text,
nullas an empty string, and arrays or objects as compact JSON text. - A dataset with zero data rows is an error.
Each row’s columns become template variables for that iteration. They override environment variables with the same name and are also passed into the pre-request script. The row label is the first non-empty value of the _name, case or label column. Results are named <request> [row <n>: <label>], or <request> [row <n>] without a label, with n counting from 1.
### Program By Row# @name Program By Row# @assert status == 200# @assert jsonpath $.students[0].program == {{program}}GET {{base_url}}/v1/students?case={{_name}}Authorization: Bearer {{DEV_API_TOKEN}}_name,programmdiv-first,MDivwrong-program,MArecon test "Program" --data rows.csv --junit out/junit.xml --markdown-summary out/summary.md[PASS] Program By Row [row 1: mdiv-first][FAIL] Program By Row [row 2: wrong-program]1 passed, 1 failedOpenAPI validation (--openapi-spec)
Section titled “OpenAPI validation (--openapi-spec)”The spec is read once. After each response, test adds one assertion:
- Its name is
openapi: <METHOD> <matched path> -> <matched status>, for exampleopenapi: GET /v1/students -> 200. When no path matches it readsopenapi: REQUEST - -> <status>. - It passes with the detail
OpenAPI schema valid, or fails with every violation joined by;as<json path> (<code>): <message>. - An empty body is validated as JSON
null. A non-empty body that is not JSON fails the assertion withresponse body is not valid JSON: ....
With a spec that documents only GET /v1/students, the Create Enrollment POST fails the check. This is the failure line from the Markdown summary:
recon test "Create Enrollment" --openapi-spec openapi.yaml --markdown-summary -...- **Create Enrollment** (`http://127.0.0.1:8787/_sandbox/local/v1/enrollments`) - `openapi: REQUEST - -> 201` — $ (OPENAPI_PATH_NOT_FOUND): No OpenAPI path template matches `http://127.0.0.1:8787/_sandbox/local/v1/enrollments`...Path matching and the violation codes are covered in OpenAPI & ODCS Contracts.
Output
Section titled “Output”Human output is one line per case and a total:
[PASS] List Students[PASS] Create Enrollment[FAIL] Stripe Prod Key Leak Check2 passed, 1 failedJSON output has passed and failed counts and a results array. Each result has request, row_index (0-based, or null), row_label, passed, and either status, assertions and script_logs, or error for a firewall block:
{ "failed": 1, "passed": 2, "results": [... { "assertions": [ { "assertion": "status == 201", "detail": "observed status 201", "passed": true } ], "passed": true, "request": "Create Enrollment", "row_index": null, "row_label": null, "script_logs": [], "status": 201 }, { "error": "Firewall blocked 1 violation(s)", "passed": false, "request": "Stripe Prod Key Leak Check", "row_index": null, "row_label": null } ]}With --markdown-summary -, only the Markdown is printed to stdout.
JUnit XML (--junit)
Section titled “JUnit XML (--junit)”reporters.rs writes one <testsuites> element containing one <testsuite>, both named after the workspace name from .recon.toml, with tests, failures and time (seconds, summed from case durations). Each case is a <testcase>:
classnameis the request’s source file (reconif none),nameis the case name including the row suffix,timeis its duration in seconds.<properties>holdsmethod,url(secret values scrubbed),status,dataset.row(1-based, only with--data),airlock.verified,airlock.fields_maskedandairlock.secrets_scrubbed.- A failed case has
<failure type="AssertionFailure">. Itsmessageis the first failure line; its text is all of them: the error, then each failed assertion as<assertion>: <detail>. If there is neither, the line is<METHOD> <url> returned HTTP <status>. <system-out>lists every assertion as[PASS] ...or[FAIL] ...and every script log line as[script] .... It is left out when there are none.
All attribute and text values are XML-escaped.
<?xml version="1.0" encoding="UTF-8"?><testsuites name="recon-demo" tests="2" failures="1" time="0.001"> <testsuite name="recon-demo" tests="2" failures="1" time="0.001"> <testcase classname="collections/rows.http" name="Program By Row [row 1: mdiv-first]" time="0.000"> <properties> <property name="method" value="GET" /> <property name="url" value="http://127.0.0.1:8787/_sandbox/local/v1/students?case=mdiv-first" /> <property name="status" value="200" /> <property name="dataset.row" value="1" /> <property name="airlock.verified" value="true" /> <property name="airlock.fields_masked" value="11" /> <property name="airlock.secrets_scrubbed" value="0" /> </properties> <system-out>[PASS] status == 200 (observed status 200)[PASS] jsonpath $.students[0].program == MDiv (observed `MDiv`)</system-out> </testcase> <testcase classname="collections/rows.http" name="Program By Row [row 2: wrong-program]" time="0.000"> <properties> <property name="method" value="GET" /> <property name="url" value="http://127.0.0.1:8787/_sandbox/local/v1/students?case=wrong-program" /> <property name="status" value="200" /> <property name="dataset.row" value="2" /> <property name="airlock.verified" value="true" /> <property name="airlock.fields_masked" value="11" /> <property name="airlock.secrets_scrubbed" value="0" /> </properties> <failure message="jsonpath $.students[0].program == MA: observed `MDiv`" type="AssertionFailure">jsonpath $.students[0].program == MA: observed `MDiv`</failure> <system-out>[PASS] status == 200 (observed status 200)[FAIL] jsonpath $.students[0].program == MA (observed `MDiv`)</system-out> </testcase> </testsuite></testsuites>Markdown summary (--markdown-summary)
Section titled “Markdown summary (--markdown-summary)”The summary is written for the GitHub Actions step summary. It contains:
- The heading
## Recon API Test Summary. - A line with the environment,
Passed: x/n,Failed,Airlock Zero-PII Verified: y/n, andDatasetwhen--datais set. - A table with one row per case:
Request,Row(#n (label),#n, or—),HTTP(method and status, or method and—when nothing was sent),Latency,Assertions(passed/total),Airlock(Zero-PII (<masked>m/<scrubbed>s)orUnverified), andResult(PASSor**FAIL**). - When anything failed, a collapsed
<details>block titledFailed Checks (<n>)listing each failed case with its URL, its error and each failed assertion.
Pipe characters in cells are escaped and newlines are replaced with spaces.
## Recon API Test Summary
**Environment:** `local` · **Passed:** 1/2 · **Failed:** 1 · **Airlock Zero-PII Verified:** 2/2 · **Dataset:** `rows.csv`
| Request | Row | HTTP | Latency | Assertions | Airlock | Result || :--- | :--- | :--- | ---: | :--- | :--- | :--- || Program By Row | #1 (mdiv-first) | GET 200 | 0.4ms | 2/2 | Zero-PII (11m/0s) | PASS || Program By Row | #2 (wrong-program) | GET 200 | 0.2ms | 1/2 | Zero-PII (11m/0s) | **FAIL** |
<details><summary>Failed Checks (1)</summary>
- **Program By Row [row 2: wrong-program]** (`http://127.0.0.1:8787/_sandbox/local/v1/students?case=wrong-program`) - `jsonpath $.students[0].program == MA` — observed `MDiv`
</details>What test records
Section titled “What test records”Every executed case (not firewall-blocked ones) is recorded with actor cli and label ci. The URL has secret values scrubbed. The request body is not stored.
Exit codes
Section titled “Exit codes”| Code | When |
|---|---|
0 |
No case failed, including when the filter matched nothing. |
1 |
At least one case failed (assertion, status 400 or above without assertions, OpenAPI violation, or firewall block). |
2 |
Runtime error (E_CLI_RUNTIME): unreadable dataset or spec, invalid dataset, transport failure, and similar. |
Also available via
Section titled “Also available via”| Surface | send |
test |
|---|---|---|
| MCP | recon_send_request |
none |
| HTTP API | POST /api/v1/send |
none |
See MCP Tools, Resources & Prompts and HTTP API. For running recon test in GitHub Actions, see GitHub Action.