Skip to content

Error Codes

Recon reports failures with short, stable codes such as E_FIREWALL_BLOCKED. Programs and AI agents should branch on the code, not on the message text. This page lists every E_ code in the source, where each one appears, and the typed errors behind the messages.

Surface Format Details
CLI Error envelope on stderr: code, message, fix_hint, retryable. JSON in agent/json mode, two text lines in human mode. See Output Formats & Exit Codes.
HTTP API (recon ui server) JSON body { "code", "message" } with an HTTP status. E_FIREWALL_BLOCKED adds violations. See HTTP API.
MCP server A tools/call result with "isError": true whose text starts with <CODE>: . See MCP Server.
Flow step results The step’s error field starts with <CODE>: . See Flows.
Code Surfaces Meaning Typical cause HTTP status CLI exit code
E_CLI_RUNTIME CLI An error the command did not handle itself. The message is the full error chain. Unreadable .recon.toml, missing file, unknown environment in twin, unknown run ID in diff, connection refused, port already in use, a firewall block in recon twin. n/a 2
E_NOT_FOUND CLI, HTTP The named thing does not exist. CLI: the target of send, load, paginate, sse or ws is neither a saved request ID or name nor an http(s):// URL. HTTP: unknown request, run, approval or environment ID. 404 2
E_FIREWALL_BLOCKED CLI, HTTP, MCP, flow steps The Outbound Secret Firewall stopped a request before it connected. A secret was about to go to a host outside its allowed_hosts, or into a URL query parameter without allow_query_param. 403 1
E_INVALID_ARGS CLI Required arguments are missing. recon graphql without --query, --query-file or --introspect; recon grpc without <ENDPOINT>, --service and --method (and no --inspect). n/a 2
E_UNAUTHORIZED HTTP The X-Recon-Token header is missing or wrong. Calling a token-protected route without the per-session token that the server injects into the UI page. 401 n/a
E_BAD_REQUEST HTTP The server could not carry out the request as given. Template, auth or secret resolution failure, or a transport error, in a send or Twin-Run; invalid input to a handler. 400 n/a
E_INTERNAL HTTP A server-side failure. Workspace loading or Flight Recorder errors. 500 n/a
E_AGENT_POLICY_DENIED MCP, flow steps run through MCP The agent policy denied the call. Method, environment or host not allowed by [agent_policy]; MCP recon_load_test asked for more than 500 requests or more than 25 concurrent workers (or zero of either). n/a n/a
E_AGENT_APPROVAL_DENIED MCP A person denied the pending approval. The approval was rejected in the Web Studio. The text after the code is the decision note, or Denied by human operator. n/a n/a
E_AGENT_APPROVAL_TIMEOUT MCP No one decided the approval in time. Nobody approved within approval_timeout_secs (minimum 1 second). n/a n/a

The E_AGENT_* codes are explained in Agent Policy & Approvals.

Exit codes for E_FIREWALL_BLOCKED in detail

Section titled “Exit codes for E_FIREWALL_BLOCKED in detail”
  • send, load, paginate, sse, ws, graphql, grpc: envelope with E_FIREWALL_BLOCKED, exit 1.
  • test: no envelope. The case fails with the error Firewall blocked <n> violation(s) and the run continues; the run exits 1.
  • twin: reported as E_CLI_RUNTIME with the message outbound secret firewall blocked <n> violation(s), exit 2.
  • flow run: the step fails with E_FIREWALL_BLOCKED: ... in its error field; the flow fails and exits 1.

Every CLI envelope sets retryable to false.

A failed assertion is not an error envelope. recon send and recon test report it in their results and exit with 1. The doc comment on the CLI’s ErrorEnvelope mentions E_ASSERTION_FAILED, but no code path emits it.

CLI envelope (recon send "Stripe Prod Key Leak Check", stderr):

{
"code": "E_FIREWALL_BLOCKED",
"message": "Blocked secret `PROD_STRIPE_KEY` bound for `api.stripe.com` from being sent to unauthorized host `127.0.0.1`.",
"fix_hint": "Switch environment or update secret allowed_hosts.",
"retryable": false
}

The same request through POST /api/v1/send returns HTTP 403:

{"code":"E_FIREWALL_BLOCKED","message":"Outbound Secret Leak Firewall blocked 1 violation(s) before connecting.","violations":[{"allowed_hosts":["api.stripe.com"],"kind":"host_scope_violation","message":"Blocked secret `PROD_STRIPE_KEY` bound for `api.stripe.com` from being sent to unauthorized host `127.0.0.1`.","origin":"header","secret_label":"PROD_STRIPE_KEY","target_host":"127.0.0.1","target_name":"Authorization"}]}

Each violation’s kind is host_scope_violation or query_param_secret_leak.

A token-protected route without the header returns HTTP 401:

{"code":"E_UNAUTHORIZED","message":"Missing or invalid X-Recon-Token header"}

An unknown run ID returns HTTP 404:

{"code":"E_NOT_FOUND","message":"run `nope` not found"}

MCP tool error (a GET request that would send PROD_STRIPE_KEY to localhost):

{"id":1,"jsonrpc":"2.0","result":{"content":[{"text":"E_FIREWALL_BLOCKED: outbound secret firewall blocked 1 violation(s)","type":"text"}],"isError":true}}

MCP approval timeout (recon_send_request for the demo Create Enrollment POST, with require_approval_for_mutations = true and nobody deciding within the default 60 seconds):

{"id":1,"jsonrpc":"2.0","result":{"content":[{"text":"E_AGENT_APPROVAL_TIMEOUT: approval `01a22d2c-e22e-738d-95cc-b99aa770390b` timed out after 60s without human decision","type":"text"}],"isError":true}}
  • HTTP body parsing. If a JSON request body does not match the endpoint’s shape, the web framework rejects it before Recon’s handler runs. The response is HTTP 422 with a plain-text message such as Failed to deserialize the JSON body into the target type: missing field ..., not a JSON envelope.

  • MCP protocol errors use JSON-RPC error objects instead of tool results:

    JSON-RPC code When
    -32601 Unknown method (Method not found: <method>).
    -32602 prompts/get or resources/read failed, for example an unknown prompt or resource URI.
  • CLI argument errors come from the argument parser as plain text and exit 2.

Each crate returns its own error enum. These never carry an E_ code themselves. The CLI wraps them in E_CLI_RUNTIME; the HTTP server maps them per handler, usually to E_BAD_REQUEST for problems with the request being sent and E_INTERNAL for workspace and storage problems. The message text you see comes from these templates.

Variant Message
Io I/O error at <path>: <source>
Parse parse error in <context>: <message> (invalid .recon.toml, environment TOML, .http syntax, datasets)
InvalidUrl invalid URL <url>: <source> (for example an unresolved {{base_url}})
InvalidJsonPath invalid JSONPath <expr>: <message>
Import failed to import <format> payload: <message>
Serialize serialization error: <message>
Variant Message
InvalidUrl invalid URL <url>: <message>
Dns DNS resolution failed for <host>: <message>
Tcp TCP connection failed to <addr>: <message>
Tls TLS handshake failed with <host>: <message>
Http HTTP protocol error: <message>
Timeout request timed out after <n>ms
Decode failed to decode <encoding> response body: <message>
TooManyRedirects exceeded maximum redirects (<n>)
Variant Message
Config mask config error at <path>: <message>
FirewallBlocked outbound secret firewall blocked <count> violation(s) (surfaces as E_FIREWALL_BLOCKED where the caller handles it)
InvalidUrl invalid URL in firewall check <url>: <message>
Variant Message
Core core error: <CoreError>
Firewall the AirlockError message
Wire wire transport error: <WireError>
Io I/O error: <source>
Json JSON error: <source>
Vault vault error: <message>
SecretProvider secret provider <provider> failed: <message> (env, file, age, op, keychain; never includes secret bytes)
OAuth2 OAuth 2.0 error: <message>
Signing signing error: <message> (AWS SigV4 or HMAC)
Variant Message
Sqlite flight database error: <source>
Io flight storage I/O error at <path>: <source>
Worker flight recorder worker unavailable: <message>
Json flight serialization error: <source>
Variant Message
Io scan I/O error at <path>: <source>
Walk repository walk error: <message>
Parse parse error in <context>: <message>
Sync collection sync error: <message>
Variant Message
Io contract I/O error at <path>: <source>
Yaml YAML error: <source>
Json JSON error: <source>
InvalidContract invalid ODCS contract: <message>
ZeroLeakViolation zero-PII verification failed: <message> (capsule export blocked because PII or secrets remained)
Airlock airlock error: <AirlockError>
Wire wire replay error: <WireError>
Scan scanner error: <ScanError>
Url invalid replay base URL: <source>
Variant Message
Bind failed to bind proxy listener <addr>: <source>
Upstream upstream request error: <message>
Watcher file watcher error: <message>
Flight flight store error: <FlightError>
Scan scan error: <ScanError>
Core core error: <CoreError>
Io io error at <path>: <source>
Serialization serialization error: <message>
InvalidConfig invalid proxy configuration: <message>
Variant Message
CycleDetected dependency cycle detected involving workflow step(s): <ids>
MissingDependency step <step> references unknown dependency <dep>
DuplicateStep duplicate workflow step id <id>
StepNotFound step <step> references unknown request <request>
Firewall the AirlockError message
Wire the WireError message
SlaViolated load test violated SLA: <failures>
Pagination pagination error: <message>
Core the CoreError message
Flight the FlightError message
PolicyDenied agent policy denied execution: <reason>
Io io error at <path>: <source>
Parse parse error: <message>
Variant Message
InvalidUrl invalid endpoint URL <url>: <message>
Firewall, Auth, Core, Wire the wrapped error’s message
Transport transport error: <message>
Sse SSE stream error: <message>
WebSocket WebSocket error: <message>
GraphQl GraphQL error: <message>
ProtoCompile proto compilation error: <message>
Grpc gRPC protocol error: <message>
Serialization serialization error: <message>
PolicyDenied agent policy denied execution: <reason>
Timeout protocol operation timed out after <n> ms
Io io error at <path>: <source>
Variant Message
Compile script compile error: <message>
Runtime script runtime error: <message>
LimitExceeded script sandbox limit exceeded: <message> (operation cap, recursion depth or memory quota)
Variant Message
Io MCP transport I/O error: <source>
Core workspace error: <CoreError>
Flight flight store error: <FlightError>
Airlock airlock error: <AirlockError>
Wire wire error: <WireError>
Variant Message
Bind failed to bind loopback listener on <addr>: <source> (for example when recon ui --port is already taken)
Core workspace error: <CoreError>
Flight flight store error: <FlightError>
Airlock airlock error: <AirlockError>
Wire wire error: <WireError>
InvalidWorkspace invalid workspace directory <path>: <message> (mapped to E_BAD_REQUEST when switching workspaces)

In every template, names in angle brackets are placeholders, and values the source wraps in backticks (paths, URLs, hosts) appear in backticks in the real message. For example:

{
"code": "E_CLI_RUNTIME",
"message": "failed to bind loopback listener on `127.0.0.1:5000`: Address already in use (os error 98): Address already in use (os error 98)",
"fix_hint": "Check workspace `.recon.toml`, arguments, or network connectivity.",
"retryable": false
}

Contract checks report violations with their own codes. They appear inside reports (and in recon test --openapi-spec assertion details), not as error envelopes. Their rules are described in OpenAPI & ODCS Contracts.

OpenAPI (OPENAPI_*) Message
OPENAPI_INVALID_SPEC OpenAPI document is missing top-level paths object
OPENAPI_PATH_NOT_FOUND No OpenAPI path template matches the URL
OPENAPI_METHOD_NOT_FOUND The matched path does not define the method
OPENAPI_STATUS_UNDOCUMENTED HTTP status is not documented under responses
OPENAPI_UNRESOLVED_REF Unresolved OpenAPI $ref
OPENAPI_ANY_OF Value did not satisfy any branch of anyOf
OPENAPI_ONE_OF Value did not satisfy oneOf
OPENAPI_TYPE_MISMATCH Value has the wrong JSON type
OPENAPI_ENUM_MISMATCH Value is not in the allowed enum
OPENAPI_MINIMUM, OPENAPI_MAXIMUM Number violates minimum or maximum
OPENAPI_EXCLUSIVE_MINIMUM, OPENAPI_EXCLUSIVE_MAXIMUM Number violates exclusiveMinimum or exclusiveMaximum
OPENAPI_MIN_LENGTH, OPENAPI_MAX_LENGTH String length violates minLength or maxLength
OPENAPI_PATTERN String does not match pattern
OPENAPI_FORMAT String does not match format
OPENAPI_MIN_ITEMS, OPENAPI_MAX_ITEMS Array length violates minItems or maxItems
OPENAPI_REQUIRED_MISSING Missing required property
OPENAPI_ADDITIONAL_PROPERTY Unexpected additional property
ODCS (DK_*) Message
DK_INVALID_CONTRACT ODCS document defines no schema object
DK_NO_ROWS Response JSON contained no object rows matching contract schema
DK_UNEXPECTED_COLUMN Unexpected column in strict mode
DK_REQUIRED_NULL Required column is missing or null
DK_TYPE_MISMATCH Value has the wrong type
DK_DUPLICATE_KEY Duplicate value for a unique column
DK_RANGE_MIN, DK_RANGE_MAX Value is below the minimum or above the maximum
DK_ENUM_MISMATCH Value is not in the allowed enum