Configuration (.recon.toml)
A Recon workspace is a directory with a .recon.toml file, a folder of .http request files, and a folder of environment files. You edit .recon.toml to name the workspace, pick the default environment, point Recon at your collections, set diff ignore paths, and set the guardrails for AI agents.
Create a workspace
Section titled “Create a workspace”Run recon init in the directory you want to use, or pass --workspace to name another directory. The directory is created if it does not exist.
recon --format human init --demo --workspace my-api✓ Initialized Recon workspace at my-api → Demo collections + mask.toml + host-scoped secret rules written. Run `recon ui --port 8787` to explore live Twin-Run, PII Airlock, and Firewall protection.When output is piped (or with --format json or --format agent), init prints JSON instead:
{ "demo": true, "initialized": true, "workspace": "."}A plain recon init (no --demo) writes this .recon.toml. Every value except name is the built-in default:
name = "plain"default_env = "local"collections_dir = "collections"environments_dir = "environments"flight_db = ".recon/flight.db"volatile_paths = [ "$.request_id", "$.timestamp", "$.trace_id",]editor_uri_template = "vscode://file/{path}:{line}"
[agent_policy]allow_read_only = trueallow_local_mutations = truerequire_approval_for_mutations = falseapproval_timeout_secs = 60require_approval_envs = []allow_mutating_envs = []allow_load_envs = []blocked_hosts = []
[environments]What recon init writes
Section titled “What recon init writes”| Path | Plain init |
init --demo |
|---|---|---|
collections/ |
Created (empty) | Created, plus collections/campus-demo.http with three requests |
environments/ |
Created (empty) | Created, plus environments/local.toml and environments/staging.toml |
.recon/ |
Created (empty) | Created (empty) |
.recon.toml |
Written; mask_config is left out |
Written with mask_config = "mask.toml" and agent_policy.require_approval_for_mutations = true |
mask.toml |
Not written | Written (PII Airlock column rules) |
.gitignore |
Lines appended if missing | Lines appended if missing |
name is set to the last component of the workspace path. With the default --workspace ., the path has no final component, so the name falls back to recon-demo, even without --demo.
init adds these lines to .gitignore, each only if the file does not already mention the path. Existing lines are kept.
.recon/flight.db*.recon/secrets.local.toml.recon/tokens.json.recon/vault.keyThe demo environments point base_url at http://127.0.0.1:8787/_sandbox/local and /_sandbox/staging, the offline routes served by recon ui. See Offline Sandboxes.
How Recon finds the workspace
Section titled “How Recon finds the workspace”Every command takes the global flag --workspace <WORKSPACE>. Its default is ., the current directory. Recon uses that directory as the workspace root as given. It does not search parent directories for a .recon.toml.
- If
<root>/.recon.tomlexists, Recon parses it. A parse error stops the command. - If it does not exist, Recon uses the built-in defaults.
namebecomes the last component of the workspace path (workspacewhen the path is.;recon doctorresolves the path first, so it shows the real directory name), andmask_configdefaults tomask.toml.
So if you run a command from a subdirectory such as collections/, Recon treats that subdirectory as a separate workspace with default settings. Commands that open the Flight Recorder (for example recon doctor) then create .recon/flight.db inside it. Run commands from the workspace root, or pass --workspace.
Workspace layout
Section titled “Workspace layout”These are the files and directories Recon reads or writes inside a workspace. Paths in the first column are the defaults.
| Path | Read or written by | Commit to Git? |
|---|---|---|
.recon.toml |
Read by every command. Written by recon init and by Workspace Settings in the web UI. UI saves write .recon.toml.tmp first and rename it into place. |
Yes |
collections/**/*.http |
Request files. Loaded recursively from collections_dir, sorted by path. Only the .http extension is loaded. See .http Request Files. |
Yes |
collections/<format>-import.http |
Written by recon import --save. |
Your choice |
collections/discovered.http |
Written by code scanning sync. See Code Scanning. | Your choice |
environments/**/*.toml |
One environment per file, loaded recursively from environments_dir. |
Yes, if it holds no plaintext secrets |
mask.toml |
PII Airlock rules, read from the path in mask_config. See PII Airlock & Receipts. |
Yes |
.recon/flight.db (plus -wal and -shm files) |
Flight Recorder SQLite database, at the path in flight_db. The parent directory is created on first use. See Flight Recorder. |
No (gitignored by init) |
.recon/tokens.json |
OAuth 2.0 token cache. See Auth & Request Signing. | No (gitignored by init) |
.recon/vault.key |
Local Age identity for the team vault. See Vault & Secret URIs. | No (gitignored by init) |
.recon.secrets.age |
Encrypted team vault. See Vault & Secret URIs. | Yes |
.recon/network.json |
Workspace transport defaults (proxy, TLS, cookies). See Transport: TLS, Proxy & Cookies. | Your choice |
.recon/secrets.local.toml |
Added to .gitignore by init. No code in this release reads or writes it. |
No |
flows/*.flow.toml |
Flow definitions. See Flows. | Yes |
.recon.toml reference
Section titled “.recon.toml reference”The file is parsed with strict types but loose keys:
nameis the only required key. Without it, loading fails withmissing field `name`.- Keys Recon does not know are ignored silently.
- A key with the wrong type fails the load, for example
approval_timeout_secs = "sixty"givesinvalid type: string "sixty", expected u64.
Top-level keys
Section titled “Top-level keys”| Key | Type | Default | What it does |
|---|---|---|---|
name |
string | required | Display name. Shown in the web UI, used as the JUnit suite name and the default OpenAPI info.title. |
default_env |
string | "local" |
Environment used when a command gets no --env. |
collections_dir |
string | "collections" |
Directory, relative to the root, that holds .http files. |
environments_dir |
string | "environments" |
Directory, relative to the root, that holds environment .toml files. |
mask_config |
string, optional | not set | Path, relative to the root, of the PII Airlock rules file. If it is not set, the file does not exist, or the file does not parse, Recon uses empty default rules without an error. |
flight_db |
string | ".recon/flight.db" |
Flight Recorder database path, joined to the workspace root. An absolute path is used as is. |
volatile_paths |
array of strings | ["$.request_id", "$.timestamp", "$.trace_id"] |
Response JSON paths ignored by semantic diffs. See Diff ignore settings. |
editor_uri_template |
string | "vscode://file/{path}:{line}" |
Link format for Jump-to-Handler in the web UI. |
agent_policy |
table | see below | Guardrails for requests made through the MCP server. |
environments |
table of tables | empty | Inline environments, merged with the environment files. |
When .recon.toml does not exist, the in-memory default for mask_config is "mask.toml". When the file exists but has no mask_config key, it is not set.
editor_uri_template supports two placeholders. The web UI replaces {path} with the absolute path of the handler file (the workspace root joined with the file part of # @handler) and {line} with the line number, or 1 if there is none.
[agent_policy]
Section titled “[agent_policy]”These fields control what an AI agent may do through recon mcp. The table lists the fields and their defaults. How each rule is enforced is described in Agent Policy & Approvals.
| Key | Type | Default |
|---|---|---|
allow_read_only |
bool | true |
allow_local_mutations |
bool | true |
require_approval_for_mutations |
bool | false (true in init --demo) |
approval_timeout_secs |
integer | 60 |
require_approval_envs |
array of strings | [] |
allow_mutating_envs |
array of strings | [] |
allow_load_envs |
array of strings | [] |
blocked_hosts |
array of strings | [] |
Each key is optional. A missing key takes its default.
Environments
Section titled “Environments”An environment is a named set of variables that fill {{name}} placeholders in requests. You can define environments in two places:
- Inline in
.recon.toml, as[environments.<name>]tables. - In files under
environments_dir. The file stem is the environment name, soenvironments/staging.tomldefinesstaging. Subdirectories are searched too, and only the stem counts:environments/team/staging.tomlalso definesstaging.
Recon loads inline environments first, then reads the files in sorted path order. When a file defines a variable that already exists in the same environment, the file value replaces it. Other variables are kept, so inline and file variables merge.
An environment file is a flat TOML table of variables:
base_url = "https://staging.billing.example.com"region = "us-east-1"
[API_TOKEN]value = "age://BILLING_STAGING_TOKEN"secret = trueallowed_hosts = ["staging.billing.example.com"]allow_query_param = falselabel = "BILLING_STAGING_TOKEN"Selecting an environment
Section titled “Selecting an environment”Commands that resolve variables take --env <name>. Without it they use default_env. If the named environment does not exist, the command still runs with no environment variables, so every {{name}} that needs one stays unresolved. A URL that is still a placeholder then fails with an error such as:
invalid URL `{{base_url}}/v1/students`: relative URL without a base: relative URL without a baseVariable values
Section titled “Variable values”A variable is either a plain string or a secret table. Values must be strings. A number or boolean, such as retries = 3, fails the load with data did not match any variant of untagged enum EnvValue.
| Form | Example | Meaning |
|---|---|---|
| Plain | base_url = "http://127.0.0.1:8080" |
Substituted as is. Not tracked by the secret firewall. |
| Secret table | [API_TOKEN] with value and secret |
Substituted, and tracked as a secret when secret = true. |
Secret table fields:
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
value |
string | yes | The secret, a $ENV:NAME reference, or a secret URI. |
|
secret |
bool | yes | true turns on taint tracking. false makes the value behave like a plain variable. |
|
allowed_hosts |
array of strings | no | [] |
Hosts or wildcards (for example *.stripe.com, 127.0.0.1, localhost) that may receive this secret. |
allow_query_param |
bool | no | false |
Whether the secret may appear in a URL query string. |
label |
string | no | the variable name | Name used for the secret in exports and firewall reports. |
A table that has value but no secret key does not match either form and fails the load.
If value starts with $ENV:, Recon reads the rest as an operating system environment variable name. An unset variable resolves to an empty string, and an empty secret is not tracked. Values that are secret URIs (age://, env://, file://, op://, keychain://) are resolved before requests are sent; see Vault & Secret URIs.
Secrets and allowed_hosts
Section titled “Secrets and allowed_hosts”Every time a secret variable is substituted into a request, Recon records where it landed (URL, query, header or body) together with its allowed_hosts and allow_query_param. The Outbound Secret Firewall uses this record to block a request that would send the secret somewhere it is not allowed. The rules are on Outbound Secret Firewall.
The same record is what lets code export replace secret values with ${LABEL} placeholders.
Diff ignore settings
Section titled “Diff ignore settings”volatile_paths lists response fields that change on every call, such as request IDs and timestamps. Semantic diffs skip these fields and report how many differences they suppressed in ignored_count.
A pattern matches a response path when either:
- the two strings are equal, for example
$.request_id, or - the pattern contains
[*], has the same number of.-separated parts as the path, and every part is equal or isname[*]where the path part isname[<index>]. For example$.items[*].updated_atmatches$.items[0].updated_atand$.items[7].updated_at.
There is no recursive or partial matching. $..updated_at and $.items do not match $.items[0].updated_at.
Header differences ignore these headers no matter what volatile_paths says: date, etag, x-request-id, x-correlation-id, x-trace-id, cf-ray, x-amzn-requestid, set-cookie, expires, age.
Where volatile_paths applies:
recon twin,recon diffandrecon capsule reproduceusevolatile_pathsonly.- The web UI diff views and the MCP diff tools also add ignore rules saved in the Flight Recorder (global rules and rules for the request being compared). Those rules are managed in the web UI and through
/api/v1/volatile-ignores. recon shadowpassesvolatile_pathsto the shadow mirror.
How the diff itself works is covered in Twin-Run & Diff.
How Recon writes .recon.toml
Section titled “How Recon writes .recon.toml”The web UI (Workspace Settings) saves name, default_env, volatile_paths, editor_uri_template and agent_policy. Saving the PII Airlock rules from the UI sets mask_config = "mask.toml" if it was not set.
A save serialises the whole configuration again. Comments, key order and unknown keys in your file are not kept. Inline environments are kept.
Complete annotated example
Section titled “Complete annotated example”This file was checked with recon doctor, which reported Loaded `billing-api` (default_env=`local`, require_approval_for_mutations=true).
# Required. Display name for the workspace.name = "billing-api"
# Environment used when a command gets no --env flag.default_env = "local"
# Where Recon looks for .http files and environment .toml files.collections_dir = "api"environments_dir = "environments"
# PII Airlock masking rules, relative to the workspace root.mask_config = "mask.toml"
# SQLite Flight Recorder database, relative to the workspace root.flight_db = ".recon/flight.db"
# JSONPaths ignored by semantic diffs (Twin-Run, run diffs, Shadow).volatile_paths = ["$.request_id", "$.timestamp", "$.trace_id", "$.items[*].updated_at"]
# Link template for Jump-to-Handler in the web UI.editor_uri_template = "vscode://file/{path}:{line}"
[agent_policy]allow_read_only = trueallow_local_mutations = truerequire_approval_for_mutations = trueapproval_timeout_secs = 120require_approval_envs = ["staging"]allow_mutating_envs = []allow_load_envs = []blocked_hosts = ["*.prod.example.com"]
# Inline environments. Keys here are merged with environments/<name>.toml.[environments.local]base_url = "http://127.0.0.1:8080"
[environments.local.API_TOKEN]value = "$ENV:BILLING_LOCAL_TOKEN"secret = trueallowed_hosts = ["127.0.0.1", "localhost"]label = "BILLING_LOCAL_TOKEN"With environments/local.toml containing base_url = "http://127.0.0.1:9090", the file value wins over the inline one, and the secret is replaced by its label on export:
BILLING_LOCAL_TOKEN=tok_local_1 recon export code ping-get-base-url-pingcurl -X GET 'http://127.0.0.1:9090/ping' \ -H 'Authorization: Bearer ${BILLING_LOCAL_TOKEN}'Errors
Section titled “Errors”Configuration errors are reported as E_CLI_RUNTIME and the command exits with status 2.
| Message starts with | Cause |
|---|---|
parse error in `<path>/.recon.toml`: TOML parse error |
Invalid TOML, a missing name, or a value of the wrong type. |
parse error in `<path>/environments/<file>.toml` |
Invalid environment file, including non-string values. |
parse error in `collections/<file>.http` , parse error in `@assert` or parse error in `@auth` |
A request file failed to parse. One bad file stops every command that loads the workspace. |
I/O error at `<path>` |
A file or directory could not be read. |
Also available via
Section titled “Also available via”- HTTP API:
GET /api/v1/workspace(workspace, environments, requests),GETandPOST /api/v1/workspace/config(read and save the settings listed above),POST /api/v1/environments/saveandDELETE /api/v1/environments/{name}. See HTTP API. - MCP: the
recon://workspaceresource and therecon_list_requeststool return the workspace name,default_envand environment names. See MCP Tools, Resources & Prompts. - Web UI: the Settings button in the top bar opens Workspace Settings, with the tabs Environments & Secrets, Workspace & Diff, and Agent Governance. See Web Studio.