Skip to content

Crate Architecture

Recon is a Cargo workspace of 14 crates plus a web UI and a desktop wrapper. This page is for contributors and for anyone embedding a Recon crate. The crate list and the dependency table come from cargo metadata on the v0.3.2 source.

All 14 crates share these settings from the root Cargo.toml:

Setting Value
Version 0.3.2
Rust edition 2024
Minimum Rust version 1.90
License MIT OR Apache-2.0
Resolver 3

The 13 library crates each declare #![forbid(unsafe_code)]. So does the desktop wrapper. The recon-cli binary crate does not declare it.

Crate Kind Modules Owns Documented in
recon-core library model, http_file, template, assertions, jsonpath, dataset, diff, codegen, typegen, jwt, importers The workspace and request model, the .http parser and serialiser, variable templates, assertions, JSONPath, CSV and JSONL datasets, the semantic JSON diff, code and type generators, and the importers Configuration, .http Request Files, Importers, Code & Type Generation
recon-airlock library firewall, airlock, mask_engine, audit The outbound secret firewall, PII masking, compliance receipts and audit bundles Outbound Secret Firewall, PII Airlock & Receipts
recon-wire library client, tls, cookies, waterfall The HTTP/1.1 and HTTP/2 client, TLS and mTLS, proxying, the cookie jar and request timing Transport: TLS, Proxy & Cookies
recon-flight library schema, store The SQLite run history, its hash chain, full-text search, and the agent activity and approval tables Flight Recorder
recon-scan library model, sync, scanners Route discovery in source code and API spec files, and # @handler link syncing Code Scanning
recon-contracts library drift, sarif, branch_diff, openapi, odcs, capsule Drift reports, SARIF output, branch diffs, OpenAPI export and validation, ODCS contracts and bug report capsules Drift & Branch Diff, OpenAPI & ODCS Contracts, Bug Report Capsules
recon-proxy library mock, capture, shadow, watch The mock server, the capture proxy, the shadow mirror and the file watcher Mock Server, Capture Proxy, Shadow & Watch
recon-lab library flow, load, paginate Flow execution, load testing and pagination Flows, Load Testing, Pagination
recon-proto library sse, ws_client, graphql, grpc, transport The SSE, WebSocket, GraphQL and gRPC clients SSE & LLM Streams, WebSocket, GraphQL, gRPC
recon-auth library secrets, oauth2, signing The Age vault, secret URI resolution, OAuth 2.0 tokens, and AWS SigV4 and HMAC signing Vault & Secret URIs, Auth & Request Signing
recon-script library (single module) The Rhai engine for pre-request and post-response scripts Pre/Post Scripting
recon-mcp library server, policy The stdio MCP server and the agent policy evaluator MCP Server, MCP Tools, Resources & Prompts, Agent Policy & Approvals
recon-server library routes, workspaces, ws The local HTTP and WebSocket server, the embedded web UI and the offline sandboxes HTTP API, Offline Sandboxes
recon-cli binary (recon) main, output, reporters, setup_mcp, skill Command parsing, output formats, JUnit and Markdown reporters, MCP client setup and the bundled agent skill CLI Reference, Output Formats & Exit Codes, Setup, Skill & Doctor

Every library crate also has an error module with its own error type. The codes those errors map to are listed in Error Codes.

Each row lists the Recon crates a crate depends on directly.

Crate Depends on
recon-core none
recon-airlock recon-core
recon-scan recon-core
recon-script recon-core
recon-wire recon-core, recon-airlock
recon-auth recon-core, recon-airlock, recon-wire
recon-flight recon-core, recon-airlock, recon-wire
recon-proto recon-core, recon-airlock, recon-wire, recon-auth
recon-lab recon-core, recon-airlock, recon-wire, recon-flight
recon-contracts recon-core, recon-airlock, recon-wire, recon-flight, recon-scan
recon-proxy recon-core, recon-airlock, recon-wire, recon-flight, recon-scan
recon-mcp all of the above
recon-server all of the above except recon-mcp
recon-cli all 13 library crates

Three things follow from this table:

  • recon-core has no Recon dependencies. Everything else builds on its model.
  • recon-wire depends on recon-airlock. The HTTP client takes a request that has already passed the firewall, so sending a request through recon-wire means clearing the firewall first.
  • recon-mcp and recon-server do not depend on each other. The MCP server and the web studio are two separate front ends over the same library crates. They share state through the workspace files and the Flight Recorder database.
Area Crates used
Async runtime tokio
HTTP client hyper, hyper-util, http, http-body-util
TLS rustls, tokio-rustls, webpki-roots, x509-parser
Response decoding flate2, brotli
Local server axum, rust-embed, mime_guess
Storage rusqlite
Source parsing tree-sitter with the TypeScript, Python, Rust, Go, Ruby and Elixir grammars; ignore for repository walking
gRPC protox, prost, prost-reflect, prost-types
WebSocket tokio-tungstenite
Scripting rhai
Vault age, secrecy
Hashing and signing sha2, hmac
Load statistics hdrhistogram
File watching notify
CLI clap, owo-colors
Formats serde, serde_json, serde_yaml_ng, toml

The web studio is a React 19 application in ui/, built with Vite and Tailwind CSS 4, with CodeMirror 6 editors. Its tests use Vitest and Playwright.

recon-server embeds the built files from ui/dist into the binary with rust-embed. The directory must exist when recon-server is compiled, so build the UI before you build the Rust workspace:

Terminal window
cd ui
pnpm install
pnpm build
cd ..
cargo build --release -p recon-cli

The binary is target/release/recon. See Web Studio for the UI itself.

apps/desktop/src-tauri is a separate crate, recon-desktop, built with Tauri 2. The root Cargo.toml excludes it from the workspace, so cargo build at the root does not build it. It depends on recon-server and uses rfd for the native folder picker. See Desktop App.