Skip to content

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.

Terminal window
recon send "List Students"
recon send campus-demo-list-students --env staging
recon send -X POST http://127.0.0.1:8787/_sandbox/local/v1/enrollments

<TARGET> is matched in this order:

  1. A saved request whose id equals <TARGET> exactly, or whose name equals <TARGET> ignoring case. For example, the demo request named List Students has the ID campus-demo-list-students.
  2. Otherwise, if <TARGET> starts with http:// or https://, an ad-hoc request to that URL with the method from -X (default GET), no headers and no body.
  3. Otherwise recon prints an E_NOT_FOUND error 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.

  1. Loads the workspace and picks the environment.
  2. Runs the request’s pre-request script, if any. Its variable overrides, extra headers and extra query parameters are applied. See Pre/Post Scripting.
  3. Resolves templates, secret references and auth. See Auth & Request Signing.
  4. Checks the resolved request with the Outbound Secret Firewall. A violation stops here with E_FIREWALL_BLOCKED and exit status 1. Nothing is sent or recorded.
  5. Sends the request and evaluates the request’s # @assert lines. Template variables inside assertions are not resolved by send (they are by test), so an assertion such as == {{program}} compares against the literal text {{program}}.
  6. Saves cookies to --cookie-jar, if set.
  7. 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, send stops here with E_CLI_RUNTIME and exit status 2. The request has already been sent, but the response is not printed and the run is not recorded.
  8. Masks the response with the PII Airlock to build the AI-safe body and the compliance receipt.
  9. Records the run in the Flight Recorder.
  10. Prints the result.

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:

Terminal window
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.

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.

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).
Terminal window
recon test
recon test "Students" --env staging
recon test --data rows.csv --junit out/junit.xml --markdown-summary out/summary.md

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.

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.

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, null as 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.

collections/rows.http
### 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}}
rows.csv
_name,program
mdiv-first,MDiv
wrong-program,MA
Terminal window
recon 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 failed

The spec is read once. After each response, test adds one assertion:

  • Its name is openapi: <METHOD> <matched path> -> <matched status>, for example openapi: GET /v1/students -> 200. When no path matches it reads openapi: 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 with response 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:

Terminal window
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.

Human output is one line per case and a total:

[PASS] List Students
[PASS] Create Enrollment
[FAIL] Stripe Prod Key Leak Check
2 passed, 1 failed

JSON 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.

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>:

  • classname is the request’s source file (recon if none), name is the case name including the row suffix, time is its duration in seconds.
  • <properties> holds method, url (secret values scrubbed), status, dataset.row (1-based, only with --data), airlock.verified, airlock.fields_masked and airlock.secrets_scrubbed.
  • A failed case has <failure type="AssertionFailure">. Its message is 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>

The summary is written for the GitHub Actions step summary. It contains:

  1. The heading ## Recon API Test Summary.
  2. A line with the environment, Passed: x/n, Failed, Airlock Zero-PII Verified: y/n, and Dataset when --data is set.
  3. 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) or Unverified), and Result (PASS or **FAIL**).
  4. When anything failed, a collapsed <details> block titled Failed 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>

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.

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.
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.