Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rustman documentation

User and developer documentation for Rustman. Pages are added as the features they describe are implemented; the behavior itself is specified in openspec/.

The same pages are published as a book at https://cyberdynecorp.github.io/rustman/, built with mdBook from this folder: docs/SUMMARY.md is its table of contents, and python3 scripts/check_docs.py checks that every page is listed there and every relative link and anchor resolves.

Available

  • Install and quick start: building from source, a first workspace and a short tour of the commands
  • Migrating from Postman: Postman and Newman concepts mapped to Rustman, a step-by-step migration (export, rustman import, review the converted scripts, run in CI) and the known gaps
  • Installing: the release archives per platform and the features they are built with, verifying the Sigstore build provenance (gh attestation verify) and SHA256SUMS, installing from source with cargo install --locked, and cutting a release
  • Request files: the workspace layout, rustman.toml, the *.rman.yaml format with one example per body type, collections and rustman init
  • Environments, variables and secrets: environment files, the active environment, variable precedence, dynamic variables, rustman secret, secret storage and redaction, and the CI pattern
  • Secret providers: {{secret:<provider>/<path>#field}} references and provider-backed environment variables, resolution at send time only, [secret_providers.*] in rustman.toml and the user config (no credentials, no commands in the workspace), the keychain, env, sops (age, PGP via gpg), onepassword (op CLI, Connect), vault (KV v1/v2, token, AppRole, OIDC), cmd and cloud provider types, timeouts, the in-memory cache and Refresh secrets, failures and exit codes, redaction, rustman secret get|test|list-providers, and agents
  • Safety policy: the rules automated senders (exploration, agents) pass before a request is sent: method gating, the origin allowlist, the production guard, rate, concurrency and budgets, 429 backoff, the [safety] table in rustman.toml, and GovernedSender
  • HTTP requests: transport, timeouts, redirects, TLS and mTLS, proxies, cookie jars, default headers, auth helpers (including OAuth2 and rustman auth login), timings, response bodies, and rustman import curl / rustman export curl
  • Code snippets: rustman export snippet for curl, HTTPie, wget, Python, JavaScript, Go, Rust, PowerShell and C#, redaction and --show-secrets, signature-auth helpers, placeholder mode and GraphQL requests
  • Signature auth: Digest (challenge, nonce reuse, replayable bodies), AWS SigV4 (credential sources, redirects, unsigned payloads, clock skew) and JWT (algorithms, keys, claims, placement, redaction)
  • OpenAPI import: rustman import openapi for OpenAPI 3.0/3.1 files and URLs, format and version detection, $ref resolution and --allow-remote-refs, validation diagnostics with JSON pointers, the generated collection layout, example bodies and the schema synthesizer, servers as environments, security schemes as auth with secret placeholders, the import snapshot, and --sync (three-way merge, _removed/, the change summary, --json, --dry-run)
  • OpenAPI exploration: rustman explore plan, run, status, resume and export, dependency discovery (links, heuristics, [explore.producers]), the probe families, seeded fuzzing, the finding rules and their severities, cleanup and resources left behind, the exploration report and coverage, reproducing findings as curl and regression request files, Ctrl+C and resume, exit codes, [explore].disabled_rules, and the bad-api fixture
  • GraphQL: kind: graphql request files, their fields and defaults, interpolation (never inside the document), introspection and its legacy fallback, the schema cache in .rustman/graphql/schemas/, schema_file and [[graphql.endpoints]], how the schema is chosen, validation, sending over HTTP (GET, uploads, APQ), subscriptions over WebSocket (graphql-transport-ws and the legacy protocol) and SSE with their headless limits, GraphQL assertions and captures, history records, kind: graphql in rustman run, rustman graphql introspect / query, and the TUI GraphQL editor
  • JSON-RPC: kind: jsonrpc envelopes and id handling, notifications, response classification and errors, batches matched by id, timeouts, retries for idempotent calls, the WebSocket transport and its per-run connection reuse, and generic subscriptions with their headless bounds, the rpc_error assertion and envelope-wide JSONPath assertions and captures, history records with redacted params, OpenRPC catalogs ([jsonrpc.catalogs], the cache, validation and --no-validate), rustman rpc call / batch / discover, kind: jsonrpc in rustman run and its JSON report, the TUI editor, method guards and the agent rpc_call tool
  • EVM toolkit: the [evm] table in rustman.toml, chain pinning with chain_id in environments and the exact mismatch refusal, node client detection, the known-chain registry and [evm.chains.<id>] overrides, exact unit-aware quantities (hex, decimal, wei, gwei, ether, native symbols, token units), kind: evm-call and kind: evm-tx request files and their load-time checks (signing: EVM signing), ABI sources (built-in ERC-20/721/1155, JSON ABIs, Foundry and Hardhat artifacts, path containment, the content-hash cache), opt-in explorer ABI fetch with EIP-1967 proxy resolution and .rustman/abi-cache/, and decoding of calls, outputs, reverts (Error, Panic, custom errors), transactions, receipts and logs with token metadata; running calls with block selection, state overrides and gas estimates, call traces (debug_traceCall, trace_call), head and log streams (eth_subscribe or HTTP polling, reorgs marked), ENS names, local Anvil forks with a temporary environment, the send-method guard and the @evm-read preset; evm assertions (outputs with units, emits, reverts, reverts_with, gas_lt) and captures (evm_output, evm_event, evm_receipt), evm-call in rustman run, the rustman evm call / decode / logs / tx / block / ens / fork commands, the TUI EVM pane and status bar, and the read-only agent tools (evm_call, evm_decode, evm_tx, evm_block, evm_logs_query capped at 10,000 blocks, evm_ens); blockchain GraphQL presets (geth EIP-1767 and subgraph detection, display-only scalar formatting, --paginate, subgraph freshness and the subgraph assertion, result links into the toolkit)
  • EVM signing: the signing gate of kind: evm-tx requests: [evm] allow_signing, [evm.signers.<id>] keystore, keychain (rustman evm signer import) and hardware-wallet (hw-wallet feature) signers, the refusal of raw private keys everywhere, key material in zeroized secrets, and the rustman evm send preconditions (--sign and the decoded preview, the chain_id pin checked against the node, simulation from the signer and --force-revert) with their exact refusals and exit codes, node-suggested fee and gas ceilings, rustman run --sign with in-run nonces; agents never sign (rustman-mcp does not link the gate); signing in CI on a local Anvil
  • Probing EVM providers: rustman evm probe over one or more RPC providers (URLs, {{variables}} or environment names), the read-only method catalog (--methods standard|all|list) and support matrix (supported, unsupported, restricted, error), archive detection, latency per method, newHeads/logs subscription checks, multi-provider consistency (head drift, block hash, balance and --call at a fixed block), opt-in rate-limit discovery, safety budgets (skipped (budget)), the subject: evm-rpc exploration report, --fail-on, exit codes and --viz dashboards
  • gRPC: kind: grpc request files and their fields, interpolation and metadata redaction, schema sources (server reflection v1 with the v1alpha fallback, .proto files compiled in-process, descriptor sets), path containment and compile errors, the descriptor cache in .rustman/grpc/descriptors/ and offline browsing, the method browser with its message templates, message encoding and unknown-field errors, unary and streaming calls with the message timeline, headless stream bounds, deadlines, binary metadata, TLS, mTLS and h2c, gRPC-Web, rich status details, the grpc_status and metadata assertions and from: metadata captures, kind: grpc in rustman run and history, rustman grpc list / describe / call / health with their exit codes, the TUI gRPC editor, and the agent tools grpc_list, grpc_describe and grpc_call
  • WebSocket and SSE: kind: ws and kind: sse sessions, the WebSocket handshake (headers, auth, subprotocols, TLS, proxies, refused upgrades), scripted steps (send, wait_for, sleep, close), ping/pong and close handling, SSE streams over GET and POST and their WHATWG parsing, reconnect and resume with Last-Event-ID and retry, the message timeline, headless bounds and size limits, the messages and close_code assertions with JSONPath over $.messages, the realtime history and report record, rustman ws connect / rustman sse listen, the TUI realtime editor and the agent realtime_listen tool
  • Messaging: kind: kafka, kind: mqtt and kind: amqp request files (operation: produce|consume, brokers, destinations, limits, start, tls, auth), message payloads (text, compact JSON, base64, workspace files), Kafka produce (explicit partition, Java-compatible murmur2 key hashing, round robin, acks) with recorded partitions and offsets, Kafka consume by partition and offset (earliest, latest, absolute, timestamp) with no consumer group and no commits, bounded memory, TLS and SASL PLAIN/SCRAM with redacted passwords, Schema Registry decoding and encoding (Avro, Protobuf, JSON Schema) with a per-run cache, client limitations; MQTT 3.1.1/5 publish and subscribe (QoS 0-2, retain, MQTT 5 properties, wildcards, clean sessions, TLS, mutual TLS, WebSocket); AMQP publish with confirms and mandatory, temporary-queue consume, named queues with destructive or requeue; AsyncAPI 2.6/3.0 import and payload validation; runs with headless bounds, start: before_next, assertions and captures over consumed messages and history with 64 KiB previews; safety gating of produce and named-queue consume for agents; rustman kafka|mqtt|amqp produce|consume; the TUI messaging pane; and the broker tests
  • Agents (MCP server): rustman mcp serve for Claude Code, Claude Desktop and other MCP clients, stdio and Streamable HTTP (loopback bind, bearer token, Origin check), the [agent] table, the read-only default and human confirmation of mutations, redaction of results, output limits and rustman://bodies/, the audit log, background jobs (progress, cancellation, resume), the generated tool reference, and the tool error codes
  • MCP client: MCP server definitions ([mcp_servers] in rustman.toml and mcp/servers/*.yaml), interpolation, workspace trust for stdio commands (.rustman/trust.yaml, --trust), the stdio, Streamable HTTP and legacy HTTP+SSE transports, initialization, version negotiation and capabilities, tools (schema forms, argument validation, results, outputSchema), resources and templates, prompts and completion, notifications, progress, timeouts and cancellation, sampling, elicitation and roots, OAuth, kind: mcp request files (assertions, captures, runs with one session per server, history), rustman mcp-client and the TUI MCP inspector
  • Assertions and captures: status, header, JSONPath, JSON Schema, body and latency assertions, interpolated expected values, captures, and where captured values are kept
  • Snapshot testing: the snapshot assertion and its full form, where snapshots are stored, the snapshot file format, compared parts and the header include list, normalization (secret redaction, ignore, presets, replace, sort) and its fixed order, JSON, text and binary diffs, event-list snapshots, recording, update and CI modes, and reviewing failures in the TUI (Snapshot tab, a approve, r reject, Alt+A queue)
  • Trace propagation: the trace: environment block and [trace] in rustman.toml, --trace, W3C traceparent/tracestate, B3 single and multi, baggage with variables, scope: run, headers you set yourself, signed requests, the request kinds covered, recorded trace ids, traceresponse and Server-Timing, link templates and presets, rustman trace open and the TUI Ctrl+O, OTLP export of client spans ([trace.export], the otlp build feature)
  • Request history: what is recorded and where, retention, redaction at rest, rustman history list filters, show, replay with secret re-resolution, and clear
  • Importing collections: rustman import for Postman collections and environments, Insomnia exports, Bruno collections, HAR captures and .http files: format detection, the destination, dry runs, secret extraction, script handling and Postman script migration, deterministic names, the conflict policy, the import report and exit codes; and rustman export postman / rustman export http
  • API docs: rustman docs build and the rustman docs serve live-reload preview, the [docs] table in rustman.toml, the docs: key of request files, the generated site (sections, endpoint pages, OpenAPI enrichment, search, themes), opt-in examples from history or snapshots, code samples and custom sample templates, Markdown output, GraphQL schema and JSON-RPC method references, redaction and the leak scan, publishing variables, layout template overrides, the output folder and its manifest, and publishing to GitHub Pages
  • Stability and compatibility: the public contracts frozen for v1.0 (request-file version: 1, rustman.toml version = 1, rustman.report/v1, rustman-viz/1, the plugin WIT API and the exit codes), the additive-only promise within a major version, deprecations, what is not covered, and the tests that guard each contract
  • CLI reference: every command, global flags, rustman send (including ad-hoc requests), rustman run (filters, iterations, parallel folders, bail), the pretty, json, junit and tap reporters, terminal output and logs, completions and exit codes
  • Data-driven runs: rustman run --data with CSV and JSON rows, a collection’s default data file, row variables and their precedence, iteration labels in reports, --bail=iteration and secret columns
  • Reports: the canonical rustman.report/v1 report of runs and explorations, rustman report schema, render and diff, --report <format>[=<path>], the JSON, JUnit, SARIF, Markdown and HTML formats with examples, redaction, and CI recipes (GitHub code scanning)
  • Load testing: rustman bench for request files and collections, iterations and virtual users, the constant-vus, ramping-vus and constant-arrival-rate executors, think time and stages, open and closed models and coordinated-omission correction, data feeding (sequential, per-vu, random, stop and recycle), the safety policy pinned to --target, the [bench] caps in rustman.toml, metrics and the per-second series, thresholds (--threshold, [bench.thresholds], abort-on-fail !), Ctrl+C, generator lag, the live dashboard and progress lines, --viz streaming, JSON and HTML reports, redaction, the summary, error classes and exit codes
  • Load testing internals: VUs as runners over one execution path, the governed gates and the global governor, the crate’s modules, per-second HDR windows and their memory bound, the run controller and monitor, and the executor overhead benchmark with its last result
  • Stress testing: rustman stress and its breakpoint, spike, soak and fuzz modes, fuzz mixing (schema-less or --spec mutations, seeds, the baseline phase), malformed payload families, wire faults, the rustman.toml [stress] table (targets, production opt-in, costly families, caps), the stress gate and its refusals, SLOs over 5-second windows, breakpoint steps and bisection, failure modes, the first failing endpoint, rate limiting, spike recovery, soak drift, the client-saturation guard and the open-file check, VUs on worker threads, the kill switch and recovery check, minimization, the live dashboard, reports and --viz, regression export, a CI recipe, and exit codes
  • Monitors: monitors/*.rman-monitor.yaml files (targets, environment, cron or every schedules with timezones and DST, timeout, allow_mutations, alerts), rustman monitor list and rustman monitor run for external schedulers with their exit codes, the read-only monitor policy (the environment’s hosts, mutations opt-in, DELETE never), the whole-run deadline, the result store in .rustman/monitors/ (raw day files, hourly aggregates, state.json, locking), retention and compaction ([monitors].retention) and the git-ignore warning, alert rules with deduplication, cooldown and recovery, the desktop, webhook (templates) and email (smtp feature) channels with redaction and rustman monitor test-alert, the daemon (overlap skip, reload, lock, drain, no port) and schedule-recipe for cron, systemd, launchd and GitHub Actions, rustman monitor status and history, and the TUI Monitors view
  • Plugins: WebAssembly component plugins, the plugin package and rustman-plugin.toml, rustman plugin add|list|remove|verify|api|test|new, declaring plugins in rustman.toml (source, sha256, grants, limits), sha256 pinning and rustman.lock, URL sources and their cache, the grant vocabulary, the sandbox (no ambient WASI, files, network through the safety policy, secrets as handles, logs), CPU and memory limits and fault isolation, plugin API versions, the rustman-plugin-sdk bindings and project templates, and the host test harness with its fake clock, randomness, network and secrets
  • Report schema: the JSON Schema of rustman.report/v1 (kind: run, kind: exploration, kind: contract, kind: bench and kind: stress)
  • Terminal UI: starting rustman / rustman tui, workspace discovery, the create-or-scratch prompt, the responsive layout, focus, status bar, toasts, mouse, themes and colour detection, --ascii, tui.toml, the command palette, help, vim mode, keybindings.toml and the key reference, the collection tree, tabs, saving and changes on disk, the HTTP editor, the GraphQL editor (diagnostics, completion, schema explorer, refresh, subscriptions), the gRPC editor (method browser, message templates, interactive bidi streams, status details, filtered timeline), variable highlighting, the external editor, sending and cancelling, the environment switcher, secret masking and reveal, the TLS badge, the response viewer (JSON tree, JSONPath filter, search, highlighting, binary and large bodies, timing waterfall, latency sparkline, exchange diff), the viz companion hand-off and HTML report, copy as code (OSC 52), importing from the palette, quitting and terminal restore, rendering screenshots, and the platform checks (pty smoke test, manual terminal matrix)
  • Viz protocol: rustman-viz/1, the JSON-lines protocol between rustman and the optional graphical companion: transport, versioning, the handshake, every message with an example, and the companion’s exit codes
  • Webhook inspector: rustman webhook listen, the bind address ([webhook] in rustman.toml) and --allow-remote, JSON-lines output (--jsonl) and --max-captures, the TUI webhook pane, HTTP handling and limits (400/408/413/431), what a capture keeps, the capture buffer, the default reply, mocks in webhook/mocks.yaml and their hot reload, the event log, signature verification (GitHub, Stripe, generic HMAC), and replay and save with header hygiene
  • Traffic recorder: rustman record, the local recording proxy (loopback by default, --allow-remote, [record] in rustman.toml), the printed proxy exports, plain HTTP forwarding, opaque CONNECT tunnels and HTTPS interception scoped by --intercept, TLS REJECTED entries, the per-workspace local CA (rustman record ca init, export, install, uninstall, rotate, remove), its security model, the timeouts, trusting it per platform and in Firefox, saving captures as request files (--save), HAR 1.2 export (--har), and the TUI recorder pane
  • Mock server: rustman mock serve for an OpenAPI document, the bind address ([mock] in rustman.toml) and --allow-remote, document loading, route matching, problem+json errors, the response selection order, the Prefer header, content negotiation, seeded synthesis, request validation (400/415/422, --no-validate), --enforce-security and [mock.security], hand-written overrides in mocks/*.rman-mock.yaml, response templates, latency and faults, stateful mode and /__rustman/reset, request limits (413/431) and Ctrl+C, CORS, the request log (--jsonl) and its sources, --history, hot reload, --proxy-unmatched and --record, the explorer self-check, and the TUI mock server pane
  • Contract testing: rustman contract diff for two OpenAPI documents or --base <git-ref>, exit codes and strictness (--fail-on-unknown, --fail-on non-breaking), the contracts/allowlist.yaml allowlist (justification, expires, expired and unused entries), a GitHub Actions pull request workflow, Pact contracts (rustman contract pact generate from a collection, rustman contract pact verify against a provider with provider states and the safety policy), passive conformance of recorded traffic (rustman contract verify), kind: contract reports, and redaction
  • Contract rule catalog: rustman contract diff and rustman contract rules, how two OpenAPI documents are matched and compared (request and response directions, $refs, recursive schemas, compositions), the JSON pointers of each difference, and every rule with its classification, description and example (generated from the catalog, with its version)
  • Import report schema: the JSON Schema of rustman.import-report/v1
  • JSON schemas: the machine-readable output formats and where their schemas live

Install and quick start

There are no release binaries yet. Build from source with rustup; the pinned toolchain (see rust-toolchain.toml) is installed automatically. No system libraries are needed.

git clone https://github.com/CyberdyneCorp/rustman
cd rustman
cargo install --path crates/rustman-cli --locked
rustman --version

A first workspace

A workspace is a folder with a rustman.toml at its root; request files, environments and collections are plain files inside it, meant to be committed to Git (see Request files).

rustman init my-api && cd my-api       # rustman.toml, environments/local.yaml, examples/ping.rman.yaml
rustman env list                       # '*' marks the active environment (--env > RUSTMAN_ENV > default)
rustman send examples/ping             # send one request file and print the response
rustman send GET https://httpbin.org/uuid --body-only   # or an ad-hoc request, no file needed
rustman run                            # run every request and check its assertions (exit 1 on a failure)
rustman run --reporter pretty --reporter junit:out/junit.xml
rustman history list --limit 5         # past exchanges, redacted
rustman export snippet --lang python examples/ping       # the request as Python code
rustman                                # open the terminal UI (or: rustman tui)

rustman --help lists every command, and each one has its own --help.

Where to go next

Installing Rustman

Rustman is one binary, rustman. Install a release archive, or build it from source.

Release archives

Each GitHub release has one archive per platform, plus a SHA256SUMS file:

PlatformArchive
Linux x86_64 (static, any distribution)rustman-<version>-x86_64-unknown-linux-musl.tar.gz
Linux ARM64 (static, any distribution)rustman-<version>-aarch64-unknown-linux-musl.tar.gz
macOS Intelrustman-<version>-x86_64-apple-darwin.tar.gz
macOS Apple siliconrustman-<version>-aarch64-apple-darwin.tar.gz
Windows x86_64rustman-<version>-x86_64-pc-windows-msvc.zip

An archive holds a rustman-<version>-<target>/ directory with the binary, LICENSE-APACHE, LICENSE-MIT, README.md and completions/ (bash, zsh, fish, PowerShell and elvish scripts, the output of rustman completions). The Linux binaries are statically linked, and the Windows binary needs no Visual C++ redistributable.

What the release binaries include

Release binaries are built with these cargo features of rustman-cli, on top of the defaults (WASM plugins):

FeatureWhat it addsDocs
cloud-secretsThe AWS, Google Cloud and Azure secret provider typesSecret providers
otlpOTLP export of client spans, off until [trace.export] turns it onTrace propagation
smtpThe email notification channel of monitorsMonitors

Each one only does something when configured, and none needs a system library. Hardware-wallet signers (hw-wallet, Ledger and Trezor for rustman evm send) are not in release binaries; build from source with --features hw-wallet to get them.

Download and verify

Every archive and SHA256SUMS carry a build provenance attestation signed with Sigstore keyless signing: GitHub Actions signs it with a short-lived certificate bound to the release workflow run, so there is no long-lived key to trust or leak. Checking it proves the file was built by .github/workflows/release.yml in CyberdyneCorp/rustman from the tagged commit.

With the GitHub CLI (2.49 or later):

version=1.0.0                                  # the release you want
target=aarch64-apple-darwin                    # your platform, from the table above
gh release download "v$version" --repo CyberdyneCorp/rustman \
  --pattern "rustman-$version-$target.tar.gz" --pattern SHA256SUMS

# 1. Provenance: built by this repository's release workflow.
gh attestation verify "rustman-$version-$target.tar.gz" --repo CyberdyneCorp/rustman

# 2. Checksum: the archive matches SHA256SUMS.
sha256sum --check --ignore-missing SHA256SUMS  # macOS: shasum -a 256 --check --ignore-missing SHA256SUMS

To tie the check to a release tag as well, add --source-ref "refs/tags/v$version" to gh attestation verify. SHA256SUMS itself can be verified the same way (gh attestation verify SHA256SUMS --repo CyberdyneCorp/rustman). Without the GitHub CLI, download the files from the release page and check the checksum; the attestation can also be verified offline with cosign or the Sigstore tooling from the bundle gh attestation download fetches.

On Windows (PowerShell):

gh attestation verify rustman-1.0.0-x86_64-pc-windows-msvc.zip --repo CyberdyneCorp/rustman
(Get-FileHash rustman-1.0.0-x86_64-pc-windows-msvc.zip -Algorithm SHA256).Hash.ToLower()   # compare with SHA256SUMS

Install

tar -xzf "rustman-$version-$target.tar.gz"
install -m 755 "rustman-$version-$target/rustman" ~/.local/bin/   # or any directory on your PATH
rustman --version

On Windows, extract the zip and put rustman.exe in a directory on your PATH. For shell completions, copy the script for your shell from completions/ to where your shell looks for it (see Completions).

macOS marks files downloaded by a browser as quarantined, and Gatekeeper refuses binaries that are not notarized. Archives fetched with gh release download or curl are not quarantined; for one downloaded with a browser, run xattr -d com.apple.quarantine rustman after verifying it.

From source

Build with rustup; the pinned toolchain (see rust-toolchain.toml) is installed automatically. No system libraries are needed.

git clone https://github.com/CyberdyneCorp/rustman
cd rustman
cargo install --path crates/rustman-cli --locked
rustman --version

To check out a release, add --branch v<version> to git clone. A plain build leaves out the optional features. To build what the release binaries ship:

cargo install --path crates/rustman-cli --locked --features cloud-secrets,otlp,smtp

rustman-cli is not published on crates.io, so cargo install rustman-cli does not work; cargo install --locked --git https://github.com/CyberdyneCorp/rustman --tag v<version> rustman-cli builds a release straight from the repository.

Cutting a release (maintainers)

  1. Set version in [workspace.package] and the rustman-* entries of [workspace.dependencies] in Cargo.toml, run cargo check --workspace so Cargo.lock follows, and merge that to main.
  2. Tag the merged commit and push the tag: git tag -s v1.0.0 -m "rustman 1.0.0" && git push origin v1.0.0. The workflow fails if the tag is not v plus the workspace version.
  3. The Release workflow builds and smoke tests every target on its own runner, writes SHA256SUMS, attests every file and creates a draft release with generated notes.
  4. Review the draft (notes, the five archives and SHA256SUMS), then publish it.

Running the workflow by hand (Actions → Release → Run workflow) is a dry run: it builds, smoke tests and attests, and never creates a release. The archives are kept as workflow artifacts.

Migrating from Postman

This guide moves a Postman workspace (collections, environments, scripts, Newman jobs) to Rustman. It covers what maps to what, the steps of a migration, and what does not carry over. Everything here is what this build does; the details of each step live in the linked pages, mainly Importing collections.

Two differences shape the whole migration:

  • Rustman runs no scripts. Pre-request and test scripts are kept as comments and never executed. The importer converts the common pm.* statements into declarative assertions and captures, and lists everything else so you can replace it.
  • Rustman is local-first. Collections and environments are plain files in a Git repository; there are no accounts, cloud workspaces or sync. Secret values never go into those files: they live in the OS keychain (or an external secret store).

Concept map

Postman / NewmanRustmanSee
WorkspaceA workspace: a folder with rustman.toml, usually a Git repositoryRequest files
CollectionA folder with a _collection.yaml (name, order:, auth, headers, variables)Collections
FolderA nested folder with its own _collection.yaml; auth and headers are inheritedCollections
RequestA *.rman.yaml request file (kind: http, or kind: graphql for GraphQL bodies)Request files
Saved examples (responses)Not imported; use snapshot assertions to keep a reference response, or an OpenAPI document for the mock serverKnown gaps
Collection variablesvariables in the root _collection.yamlVariables
Environmentenvironments/<name>.yaml, selected with --env, RUSTMAN_ENV or default_environmentEnvironments
GlobalsNot imported; put shared values in [variables] of rustman.tomlPrecedence
Secret-type variablesNames listed under secrets: in the environment file, values in the OS keychainSecrets
Postman Vault, external vaults{{secret:<provider>/<path>#field}} references to 1Password, HashiCorp Vault, SOPS, cloud secret managers, …Secret providers
Path variables (:id){{id}} in the URL, with id under the request’s variablesImporting collections
Dynamic variables{{$uuid}} (from $guid / $randomUUID), {{$timestamp}}, {{$randomInt}}, {{$isoTimestamp}}, {{$randomString n}}; the faker-style $random* variables have no equivalentDynamic variables
pm.test / pm.expect checksDeclarative assertions: (status, header, JSONPath, JSON Schema, body, latency)Assertions and captures
pm.environment.set / pm.collectionVariables.setcaptures: (with persist: true for environment and global setters)Captures
Logic in scripts (loops, signing, computed values)WASM plugins: auth schemes, assertion functions, value generators, transformersExtension points
postman.setNextRequestNo equivalent; run order comes from order: in _collection.yamlCollections
Collection Runnerrustman run [paths] with --filter, --iterations, --bail, --parallelrustman run
Data files (-d data.csv)rustman run --data data.csv (CSV or JSON), or data: in _collection.yamlData-driven runs
Newman (newman run ... -r junit)rustman run --reporter junit:out/junit.xml in CI, with exit codes per outcomeReporters, Exit codes
Newman HTML reportersrustman run --report html=out/report.html (also markdown, sarif, json, junit)Reports
Auth: Basic, Bearer, API key, OAuth2 (client credentials, authorization code, PKCE)The same helpers, imported as they areAuth
Auth: Digest, AWS Signature, JWTBuilt in, but not converted by the importer: set them again by handSignature auth
Auth: Hawk, NTLM, OAuth 1.0, Akamai EdgeGridAuth-scheme pluginsAuth schemes
Cookie jarOne jar per environment in .rustman/cookies/; rustman cookies clearCookies
Code generationrustman export snippet --lang <lang> (or Alt+C in the TUI)Code snippets
Mock serversrustman mock serve <openapi>: served from an OpenAPI document, locallyMock server
Monitorsmonitors/*.rman-monitor.yaml, run by rustman monitor run, the daemon, cron, systemd, launchd or a CI scheduleMonitors
API documentationrustman docs build / rustman docs serve from your request filesAPI docs
Interceptor, proxy capturerustman record (a local recording proxy)Traffic recorder
Performance testsrustman bench (load) and rustman stress (breaking points)Load testing, Stress testing
Postbot and AI agent featuresrustman mcp serve: an MCP server any agent (Claude Code, Claude Desktop, IDE agents) can drive, read-only unless rustman.toml allows moreAgents (MCP server)
Postman’s MCP request typekind: mcp request files and rustman mcp client commandsMCP client
Team workspaces, sharing, history syncGit: review request-file changes in pull requests

Step by step

1. Export from Postman

  • Collections: in Postman, open the collection’s menu, choose Export and pick Collection v2.1 (v2.0 is read too). One file per collection.
  • Environments: export each environment you use (the environment’s menu, Export). Each gives a *.postman_environment.json file.
  • Globals are not exported in a format Rustman reads; note the values you need (see Known gaps).

Secret values may be in these files. They stay on your machine: the importer moves them to the keychain and never writes them into the workspace, but delete the exported files once the migration is done.

2. Create a workspace

rustman init my-api && cd my-api

rustman init writes rustman.toml, a local environment and a sample request. Pass --bare to skip the sample. If you keep the workspace in an existing repository, run rustman init there instead.

3. Import the environments

rustman import postman-env staging.postman_environment.json
rustman import postman-env prod.postman_environment.json

Each becomes environments/<slug>.yaml. Variables that Postman marks secret, and variables whose name looks like a credential (token, password, api_key, …), are listed under secrets:; their values go to the OS keychain (or .rustman/secrets.yaml when there is none), never into the file. Check the result with:

rustman env list
rustman secret list --env staging

4. Preview, then import the collection

Start with a dry run. It converts everything and prints the planned files, the secrets it would move and the report, without writing anything:

rustman import postman billing.postman_collection.json --into billing/ --env staging --dry-run

Then import for real, keeping both reports:

rustman import postman billing.postman_collection.json --into billing/ --env staging \
  --report out/import-report.json --migration-report out/migration.md
  • --into is the collection folder (default: a folder named after the collection).
  • --env is the environment that receives secrets found in the requests (default: the active environment; without one, a new environment named after the collection).
  • --report writes the JSON report (rustman.import-report/v1); --migration-report writes the Markdown list of script statements that were not converted, each with a suggestion.
  • Re-running the import is safe: existing files are skipped by default (--on-conflict skip|overwrite|rename), and unchanged files are never rewritten.

The summary says what happened:

imported Billing API (postman) into billing/
written: 11 requests, 4 collections, 1 environments; skipped: 0; dropped: 4; secrets moved: 9; unsupported: 1; unmapped: 1
3 scripts preserved as comments, not executed
scripts: 31/40 statements converted (77%)

Every dropped, unsupported, unmapped and secret line names the item it comes from. In CI, --fail-on-unsupported makes an import that loses anything exit with 1.

5. Review the converted scripts

Open a few request files. Each Postman script is kept verbatim in an # imported-script comment block at the top of the file (collection and folder scripts in _collection.yaml), and the statements Rustman understood are also written as assertions: and captures:. For example, a Postman test such as

pm.test("created", () => {
  pm.response.to.have.status(201);
  const body = pm.response.json();
  pm.expect(body.id).to.exist;
  pm.environment.set("invoice_id", body.id);
});

is written as

assertions:
  - status: 201
  - json:
      path: $.id
      exists: true
captures:
  - var: invoice_id
    from: json
    path: $.id
    persist: true

The statements that convert are listed in the script mapping table: status checks, pm.response.to.be.ok, header presence and value, response time, body text, pm.response.json() field checks (equality, existence, length, type, comparisons, include), and the environment, global, collection and plain variable setters whose value comes from the JSON body, a header or a cookie.

Go through out/migration.md for the rest. Typical replacements:

Script patternRustman replacement
Checks over every item of an array (items.every(...))A schema assertion; the migration report suggests the inline schema to paste
Validating a response against a JSON Schema with tv4 / ajvA schema assertion pointing at the schema file
postman.setNextRequest(...), request chainingOrder the requests with order: in _collection.yaml; values flow between them through captures
Logging in from a pre-request script to fetch a tokenA login request first in order: with a capture of the token, or the built-in OAuth2 helper
Signing requests (HMAC, custom headers)Built-in Digest, AWS SigV4 or JWT auth, or an auth-scheme plugin
Computed values (timestamps, random data)Dynamic variables, or a value-generator plugin
Custom checks with no declarative formAn assertion-function plugin

Once the replacements are in place, delete the # imported-script blocks you no longer need; they are never run.

6. Fill in what the import left out

  • Auth the importer reported as unsupported (digest, awsv4, hawk, ntlm, OAuth2 implicit or password grants, …) is written as auth: {type: none}, so the request inherits no parent credential. Set Digest, AWS SigV4 or JWT auth by hand (Signature auth); the others need a plugin.
  • Globals: add the values you used to [variables] in rustman.toml, or to the environments. Declare credentials as secrets and store them with rustman secret set <name> --env <env>.
  • OAuth2 tokens Postman had cached are not carried over. For the authorization-code grant, log in once on a workstation with rustman auth login <request> --env <env>.
  • Unmapped dynamic variables ($randomCity, …) are kept as written and reported; replace them with a fixed value, a data file column, or a value-generator plugin.

7. Run the collection

rustman run billing --env staging
rustman run billing --env staging --data customers.csv --data-label email
rustman run . --env staging --filter 'billing/**' --bail

rustman run sends every request under the given folders in collection order, checks the assertions and chains captures, like the Collection Runner. --iterations <n> repeats the run; --data runs once per CSV or JSON row with the columns as variables, like newman run -d.

You can also open the workspace in the terminal UI with rustman and send requests one at a time.

8. Replace Newman in CI

NewmanRustman
newman run collection.json -e staging.jsonrustman run billing --env ci
-d data.csv, -n 5--data data.csv, --iterations 5
--bail--bail (or --bail=iteration with data files)
--folder Invoicesrustman run billing/invoices, or --filter 'billing/invoices/**'
--env-var token=...--var token=... for plain values; declared secrets for credentials (below)
-r cli,junit --reporter-junit-export out.xml--reporter pretty --reporter junit:out/junit.xml
-r htmlextra--report html=out/report.html
--insecure, --timeout-request--insecure, --timeout 5s

Give CI its own environment (environments/ci.yaml) declaring the same secrets, and feed them from the CI’s secret variables into the file store at the start of the job (the CI pattern). In GitHub Actions:

env:
  RUSTMAN_ENV: ci
  RUSTMAN_SECRET_STORE: file
steps:
  - uses: actions/checkout@v5
  - run: cargo install --git https://github.com/CyberdyneCorp/rustman rustman-cli --locked
  - run: printf '%s' "$API_TOKEN" | rustman secret set api_token
    env:
      API_TOKEN: ${{ secrets.API_TOKEN }}
  - run: rustman run billing --reporter pretty --reporter junit:out/junit.xml

The exit code tells CI what happened: 0 when every request passed, 1 when an assertion failed, 2 for a usage or configuration error, 3 when a request errored (network, TLS, timeout, unresolved variable). Secrets are redacted as «redacted:<name>» in every reporter and log.

9. Move the rest

  • Mock servers: rustman mock serve api.yaml serves an OpenAPI 3.0/3.1 document, with responses from its examples or synthesized from its schemas. If your Postman mock was built from saved examples, describe the API in OpenAPI first (Mock server).
  • Monitors: write a monitors/<name>.rman-monitor.yaml with the targets, environment and schedule, then run it with rustman monitor daemon, or generate a cron, systemd, launchd or GitHub Actions configuration with rustman monitor schedule-recipe <name> --for github-actions. Monitors are read-only unless the file sets allow_mutations (Monitors).
  • AI features: register rustman mcp serve with your agent (claude mcp add rustman -- rustman mcp serve for Claude Code) to let it list, send and test your saved requests under the workspace’s permissions and safety policy (Agents (MCP server)).
  • Going back, or sharing with Postman users: rustman export postman billing -o billing.postman_collection.json writes a Collection v2.1 file; secrets are exported as {{name}} placeholders, never as values (Exporting).

Known gaps

What the importer does not carry over, or Rustman does not do:

  • Script execution. No JavaScript runs, by design. Unconverted statements are listed in the migration report and stay as comments.
  • Saved examples (responses) in a collection are not imported.
  • Globals exports are not read; move them by hand.
  • Folder-level variables are dropped (Postman itself never resolves them) and reported.
  • Disabled headers, query parameters, form fields and variables are dropped and reported.
  • Request settings (protocolProfileBehavior: redirects, TLS, encoding options) are not imported; set them under settings: in the request file or in rustman.toml (Settings).
  • Auth types other than Basic, Bearer, API key and OAuth2 client-credentials / authorization-code are written as auth: {type: none} and reported. Digest, AWS SigV4 and JWT exist in Rustman and must be set by hand; the rest need a plugin.
  • Cached OAuth2 tokens are dropped; Rustman fetches its own.
  • Faker-style dynamic variables ($randomCity, $randomEmail, …) are kept unchanged and reported as unmapped.
  • Secrets in free text (XML bodies, GraphQL query documents, descriptions, base64 blobs) may not be found; review them after an import (Secrets lists the limits).
  • Postman Flows, cloud collaboration, comments, forks and pull requests inside Postman have no equivalent: use Git and your code-review tool.
  • Mock servers are served from an OpenAPI document, not from a collection’s examples.

Terminal UI

rustman with no subcommand, or rustman tui [PATH], opens the full-screen terminal UI. The behavior is specified in openspec/specs/tui.

Starting

rustman              # open the TUI from the current directory
rustman tui          # the same
rustman tui api/     # start the search in api/ instead
rustman tui --theme light --ascii
rustman tui --vim    # vim keys for this run

The TUI looks for rustman.toml in PATH (default: the current directory) and then in each parent directory, and opens the first workspace it finds. Running it from /proj/api/users opens the workspace rooted at /proj.

If there is no rustman.toml anywhere above PATH, a prompt offers two choices:

  • Create workspace here creates a workspace in PATH, exactly like rustman init PATH, and opens it.
  • Scratch session opens an empty session that is not backed by any file.

Use ↑/↓ (or Tab, j/k) and Enter, or press c or s directly. If the workspace can’t be created, the error is shown in the prompt and you can choose again.

rustman with no subcommand only opens the TUI when stdin and stdout are a terminal; in a pipe or a script it prints the help instead. rustman tui without a terminal fails with exit code 2 and error: the terminal UI needs an interactive terminal (stdin and stdout must be a TTY).

Quitting and terminal restore

Ctrl+Q quits. Ctrl+C never quits (it is reserved for cancelling a request in flight).

The TUI runs in raw mode on the terminal’s alternate screen. On exit, and also if Rustman panics, the terminal is restored first (cooked mode, main screen, visible cursor), so any panic message lands on your normal screen and the shell keeps working.

The terminal is also restored when the process is told to stop: SIGTERM, SIGHUP (the terminal window was closed) or SIGINT from kill on Linux and macOS, and closing the console, logging off, shutting down or Ctrl+Break on Windows. Rustman then exits with status 128 plus the signal number (143, 129, 130; 130 on Windows). If background work (loading or creating a workspace) panics, or reading the terminal fails, the TUI also closes cleanly and prints the error, exit status 1.

Layout

The shell adapts to the terminal size:

SizeLayout
120 columns or moreSidebar (28 columns by default), request editor and response viewer side by side. Ctrl+B hides or shows the sidebar.
80–119 columnsRequest editor above the response viewer. The sidebar is hidden; Ctrl+B shows it as an overlay over the left edge (and again, or Esc, closes it).
Under 80 columns or under 24 rowsOne pane at a time, with a pane switcher bar (Sidebar, Request, Response) on top and the notice Smaller than the recommended minimum of 80x24 at the bottom. Tab moves between panes; Ctrl+B jumps to the sidebar and back.

Resizing the terminal re-lays out the screen without losing focus, sidebar width or anything else. The sidebar is 20 to 50 columns wide: drag its right border with the mouse, or use Alt+Right / Alt+Left.

The sidebar shows the workspace as a collection tree, the request editor edits the open request (see Requests) and the response viewer shows its last exchange (see Response viewer).

Focus

Tab and Shift+Tab move the focus around a ring: sidebar, method, URL, editor tabs, editor content, response viewer, and back to the sidebar. A hidden sidebar is skipped. The focused pane has a highlighted border and a › before its title.

Status bar

The bottom line shows, from the left: the workspace name (or Scratch session), the active environment (env: NAME or no environment), TLS verified or a red TLS: INSECURE badge while certificate verification is off (verify_tls = false in rustman.toml, or settings: verify_tls: false in the request open in the current tab), and how many requests are in flight. On the right: the vim mode (NORMAL, INSERT, VISUAL) when vim keys are on, a SECRETS VISIBLE badge in the warning colour while secrets are revealed, the webhook listener’s address while it runs (webhook 127.0.0.1:9090, or a red WEBHOOK ON NETWORK 0.0.0.0:9090 badge when it is reachable from the network; see Webhook pane), the recording proxy’s address while it runs (record 127.0.0.1:8888, or a red RECORDER ON NETWORK badge) and a CA TRUSTED badge while the workspace’s recorder CA is installed in a trust store (see Recorder pane), and the quit hint.

Toasts and the notification log

Messages appear as toasts in the top-right corner, newest on top, at most three at a time. Info and success toasts disappear after 3 seconds; warnings and errors stay until dismissed or for 10 seconds. Esc dismisses the newest toast, and clicking a toast dismisses it. Every toast is also kept in the notification log (the last 500), which Show notification log in the command palette opens; Esc closes it.

Warnings found while loading the workspace, a tui.toml that can’t be read, and bad entries in keybindings.toml are shown as warning toasts.

Requests

Collection tree

The sidebar shows the workspace’s folders and request files in run order (the order rustman run uses). Each request has a badge: its method (GET in the ok colour, POST accent, PUT/PATCH warn, DELETE error) or its kind for other request kinds (GQL, MCP, GRPC, …). A ● (* with --ascii) marks a request open in a tab with unsaved changes.

Key (sidebar)What it does
↑/↓, Home/End, PageUp/PageDownmove the selection
Enteropen the request in a tab (or focus its tab); on a folder, fold or unfold it
← / →fold / unfold the selected folder
/filter: type to keep the requests whose path fuzzy-matches (matched characters are highlighted), Enter opens the selection, Esc clears the filter
nnew request in the selected folder; a name such as admin/list also creates the folder
rrename the selected request or folder (open tabs follow)
ddelete the selected request or folder, after a confirmation (Cancel is preselected)

Request kinds this build does not know (for example kind: soap) still load: they open read-only, showing the file as it is, with the notice No editor for kind "soap".

Tabs

Several requests can be open at once; their tabs are listed in the request editor’s top border, the current one highlighted. Ctrl+T opens a new request, Ctrl+W closes the current tab, Alt+1 … Alt+9 go to a tab, and Ctrl+PageUp / Ctrl+PageDown go to the previous / next one (clicking a tab works too). Each tab keeps its own editor state, its last exchange and its in-flight request, so a request can keep running in one tab while you edit another.

Saving and unsaved changes

A tab whose request differs from its file shows ● after its title, and the request shows ● in the sidebar. Ctrl+S saves it (Ctrl+S is safe to use: raw mode turns off XON/XOFF flow control); a new tab asks for a file name first, relative to the workspace root (users/create, .rman.yaml is added). Files are written in Rustman’s canonical layout: a query string typed in the URL is saved as query: rows, and settings, variables, captures and descriptions are kept as they were. In a scratch session nothing is saved.

Closing a tab with unsaved changes, or quitting with any, asks Save / Discard / Cancel (s, d, c, or the arrows and Enter; Esc cancels).

The TUI watches the workspace for changes made by other programs (an editor, git checkout). The sidebar follows them. A tab without unsaved changes reloads its file; a tab with unsaved changes shows a conflict prompt: Keep mine (keep editing; saving overwrites the file) or Load from disk.

The HTTP editor

The first row holds the method and the URL. With the method focused, ←/→, Space or Enter cycle through GET POST PUT PATCH DELETE HEAD OPTIONS, and a letter jumps to the next method starting with it. The URL is a one-line text field.

Below them, the editor tabs: Params, Headers, Body, Auth and Assertions (with the tab bar focused, ←/→ or 1–5 switch; clicking a label does too).

  • Params and Headers are tables with an enable toggle per row. Keys in a table: Enter edits the name, then Tab moves to the value and Enter commits (Esc cancels the edit); Space turns the row on or off; a (or Insert) adds a row; x (or Delete) removes it; ↑/↓ move. A disabled row stays in the file (enabled: false) but is not sent. Params and the URL’s query string stay in sync both ways: adding the row page = 2 to https://api.test/users makes the URL https://api.test/users?page=2, and typing ?a=1 in the URL adds the row; disabled rows are left out of the URL.
  • Body: Alt+M cycles the mode: none, raw (JSON), raw (XML) (adds Content-Type: application/xml when no content type is set), raw (text), form-urlencoded and multipart. Raw bodies are text areas (modal with vim keys); form and multipart bodies are tables, where a multipart value @path sends a workspace file. A type: file body is shown, not edited.
  • Auth: Alt+M cycles inherit (no auth:, the nearest collection’s applies), none, basic, bearer and api_key; their fields form a table. OAuth2 is shown and kept as is; edit it in the file.
  • Assertions: the request’s assertions: as YAML, the same syntax as in the file (see Assertions). A list that does not parse cannot be saved: the error names the problem.

The GraphQL editor

A kind: graphql request (see GraphQL) opens in its own editor. The first row shows how the operation travels (POST, GET, WS or SSE) and the endpoint, a one-line text field. The editor tabs are Query, Variables and Schema (1–3 with the tab bar focused).

  • Query is the document, with syntax colours. Its first line says where the schema comes from (Schema: schema_file schema.graphql · 42 types, Schema: cache, fetched …), or No schema: syntax only when there is none. The document is checked as you type, without sending: every problem is underlined where it starts (in the error colour, the warning colour for deprecated fields) and the last line shows the one at the cursor, e.g. ✖ 2:8: Cannot query field "emial" on type "User"., or ✔ Valid. A document from document_file is shown read-only; edit the file.
  • Ctrl+Space opens the completion popup at the cursor: fields, arguments, enum values, variables, directives and fragments, each with its signature. ↑/↓ choose, Enter or Tab inserts, typing narrows the list and Esc closes it.
  • Variables is the variables: map as a JSON object; {{variables}} in it are resolved on send. JSON that does not parse is reported on the last line, and the request cannot be saved or sent until it does.
  • Schema browses the schema: the types with their kind, then (Enter) a type’s fields with their arguments and types, input fields, enum values, interfaces and possible types; deprecated members are struck through with their reason. Enter on a field opens its type; Backspace goes back.

The schema is the request’s schema_file, the schema_file of its endpoint in rustman.toml, or the cached introspection result, read when the tab opens. Opening or sending never introspects: Ctrl+G (Refresh GraphQL schema) runs the introspection query against the endpoint, in the active environment, and replaces the cache. Edits are saved to the request file with Ctrl+S; fields the editor does not show (headers, auth, transport, assertions) are kept.

Sending a document with errors asks first: Send anyway sends it without the check, Cancel (the default) does not send. A query or mutation shows its result in the response viewer’s Data, Errors and Extensions tabs. Each of these tabs starts with a summary line: the operation, the result (ok, partial, errors), the subscription protocol (graphql-transport-ws, legacy subscriptions-transport-ws or sse) and the APQ outcome, when there are any (subscription OnMessage · ok · legacy subscriptions-transport-ws). Alt+S (Start GraphQL subscription, or Ctrl+Enter) starts a transport: ws or sse subscription; it runs until the server completes it or you stop it, with no max_events or duration limit. While it runs, the response viewer counts the events and lists the newest (⠋ Subscribed: 3 events · 2.4 s). Alt+X (Stop GraphQL subscription) stops it and keeps what arrived: the Events tab lists every event with its time since the start and why it ended (Ended: stopped, 3 events). Esc cancels it instead, like any request.

The JSON-RPC editor

A kind: jsonrpc request (see JSON-RPC) opens in its own editor. The first row shows RPC (or SUB for a subscription) and the endpoint. The editor tabs are Call, Batch, Headers, Auth and Assertions (1–5 with the tab bar focused).

  • Call starts with where method completions come from (Catalog: 42 methods, from [jsonrpc.catalogs] or the rustman rpc discover cache; the endpoint is resolved in the active environment, without reading secrets), then the one-line Method field and the Params as JSON (an array or an object). Typing in the method field opens a popup of the catalog methods starting with what is typed, each with its param names (eth_getBalance(address, block?), ? marking optional ones); Ctrl+Space opens it too. ↑/↓ choose, Enter or Tab takes one, Esc closes it. Enter or ↓ moves from the method to the params, ↑ on the first params row moves back. Params that do not parse are reported on the last line. A batch file shows its calls in the Batch tab instead.
  • Batch, Headers, Auth and Assertions are those parts of the file as YAML, the same syntax as in the file. YAML that does not parse, or a file that no longer loads (for example a method left empty), cannot be saved or sent: the error says why.

An edited request is saved with its members in schema order; an unedited one keeps its file text. Ctrl+R sends it; the response viewer shows Result (each call’s result exactly as received, hex included), Error (code, message and data, and server rejected the batch when one error answered a whole batch) and Events, then the usual Body, Headers, Timing and Assertions. A subscription runs until you stop it: the viewer counts the events and lists the newest live (⠋ Subscribed: 3 events · 2.4 s (Esc unsubscribes)). Esc sends the unsubscribe call and stops it, keeping what arrived (Ended: stopped, 3 events); a second Esc cancels outright. A method guard that refuses the method stops the send with its message.

The gRPC editor

A kind: grpc request (see gRPC) opens in its own editor. The first row shows GRPC and the target. The editor tabs are Method, Message, Metadata and Assertions (1–4 with the tab bar focused).

  • Method starts with where the schema comes from: the request’s .proto files or descriptor set, else the descriptor cache, else the server by reflection (whose answer is then cached). It loads in the background when the tab opens, with the request resolved in the active environment, so errors are redacted. Ctrl+G asks the server again. When the server cannot be reached and the cache has the target, the cached schema stands in and the line says so: Schema (may be stale, Ctrl+G refreshes): 5 methods from the descriptor cache, fetched …. Below the picked method and its call type, the browser lists every method of every service with its call type; ↑/↓ select and Enter picks one.
  • Message is the request message as JSON, in the proto3 JSON mapping, with its request type on the first line. Picking a method puts its template in the tab (every field at its default, nested messages to depth 3, repeated fields as one-element lists, enums as their first value) unless you typed something there; a client-streaming or bidi method takes a list (messages), sent in order. JSON that does not parse is reported on the last line.
  • Metadata and Assertions are those parts of the file as YAML.

Ctrl+R sends the request. While a call streams, the response pane counts the messages and lists the newest live, each with its direction (> sent, < received), time since the call started, size and JSON (⠋ 5 messages · 2.4 s (Ctrl+R sends, Alt+X half-closes)). Interactive streams have no stream bounds: they run until the server ends them, the deadline expires, or you stop them. During a bidi call, Ctrl+R sends the Message tab (each entry of a list) on the open stream instead of starting a new call; a message the schema rejects is not sent and the toast says why. Alt+X half-closes the stream: the server may still answer, and the call ends when it does. Esc cancels the call outright.

The response viewer shows Messages (each received message), Status (the status code, name and message, the decoded google.rpc.Status details such as BadRequest field violations, an unknown detail as its type URL and base64, then the response headers and trailers), Timeline and Assertions. With the response focused, d cycles the timeline between all, sent and received messages, and f filters it by text as you type (Enter keeps the filter, Esc clears it); the filter line shows how many entries match (Direction: received (d) · Filter: more (f) · 1 of 5). Every value is redacted like history: a secret sent in metadata and echoed by the server shows «redacted:token».

The WebSocket and SSE editor

A kind: ws or kind: sse request (see WebSocket and SSE) opens in the realtime editor. The first row shows WS or SSE and the URL. The editor tabs are Timeline, Compose, Headers, Steps (WebSocket) or Body (SSE), and Assertions (1–5 with the tab bar focused).

  • Timeline shows the session: Connected · 12 of 80 entries (3 dropped), the filters, one row per entry (time since the session started, sent, recv or sys, the type, the size and the start of the payload) and, below, the payload of the selected entry, pretty-printed when it is JSON. With the content focused, d cycles the direction filter (all, sent, received, system), t the type filter (each type seen so far), / starts typing a text filter (Enter ends it), c clears the filters, ↑/↓ (or k/j) select an entry, g goes to the first and G (or End) follows the newest again. Only the rows that fit are drawn, and the pane keeps at most limits.max_timeline entries (default 10000), so a long session never slows down input.
  • Compose holds the frame to send: text, JSON (checked before it is sent) or binary as base64; Alt+M changes the type. It is sent as typed, without interpolation.
  • Headers, Steps / Body and Assertions are those parts of the file as YAML, as in the JSON-RPC editor.

Ctrl+R connects. The session runs the file’s steps, then stays open until you close it (no headless bounds); while it is open, Ctrl+R sends the Compose frame instead of starting another send, and Esc closes the session with code 1000, keeping its timeline. A second Esc cancels outright. When the session ends, the response viewer shows its record and assertions as for any request, and it is recorded in history. Entries are redacted before they reach the pane: a secret of the request that a server echoes shows as «redacted:<name>».

The messaging editor

A kind: kafka, kind: mqtt or kind: amqp request (see Messaging) opens in the messaging editor. The first row shows PRODUCE or CONSUME and the broker address. The editor tabs are Messages, Compose, Broker and Assertions (1–4 with the tab bar focused).

  • Messages shows the consumer: Consuming · 120 messages, one row per message (where it came from, its key and the start of its value) and, below, the selected message’s value: pretty-printed JSON, decoded from Schema Registry id <n>, text, or a hex dump for binary values. With the content focused, ↑/↓ (or k/j) select a message, g goes to the first and G (or End) follows the newest, and p (or Space) pauses the list (Paused · 120 messages (8 more since the pause)). The pane keeps at most 10000 messages; when the buffer is full the consumer stops (Buffer full).
  • Compose holds the messages a produce sends, Broker the destination and connection settings, and Assertions the assertions, each as YAML.

Ctrl+R runs the operation. A consume has no headless bounds: it runs until Esc stops it, keeping what it collected; a second Esc cancels outright. When it ends, the response viewer shows its record and assertions, and it is recorded in history. Messages are redacted before they reach the pane.

Variables

Every {{variable}} in the URL, params, headers, auth and body is highlighted: in the accent colour when it resolves, in the error colour (and underlined, so it shows without colour) when no layer defines it. When the cursor is on a variable (in the URL, a text body, or the selected table row) a line at the bottom of the editor shows its value and the layer it comes from, e.g. {{base_url}} = http://localhost:8080 · environment, or {{base_url}} is not defined in any layer. Variables are looked up with the request’s own precedence (request, collection, active environment, rustman.toml). Secrets are never read for this and show masked, {{token}} = •••••••• · secret (environment), unless you reveal secrets.

External editor

Ctrl+E (editor focused, raw body) writes the body to a temp file named for its type (.json, .xml, .txt), hands the terminal to $VISUAL, else $EDITOR, else vi (notepad on Windows), and waits. When the editor exits the TUI comes back with the edited body (the tab is marked dirty if it changed) and the temp file is deleted. Values with arguments such as EDITOR="code --wait" work. On Unix the value is split like a shell would. On Windows a value that names an existing file (quoted or not) is used as is, so EDITOR=C:\Windows\System32\notepad.exe and paths with spaces work; anything else is split with the Windows command-line rules (backslashes are literal, double quotes group). If the configured editor cannot be started, vi (notepad on Windows) opens instead and a warning toast says why.

Sending and cancelling

Ctrl+Enter sends the current tab’s request (Ctrl+R does too, for terminals that cannot encode Ctrl+Enter). The request is sent in the background with the active environment, through the same engine as rustman send: variables are resolved the same way, cookies, captures and OAuth2 tokens are shared with the CLI, and the exchange is recorded in history (redacted), unless [history] enabled = false. Unsaved edits are sent as they are; the file is not saved. A new tab that was never saved is sent and recorded as untitled.rman.yaml, and in a scratch session nothing is recorded.

While the request is in flight the response viewer shows a spinner and the elapsed time (⠋ Sending… 1.2 s), and the status bar counts the requests in flight. Everything else keeps working: other tabs, the sidebar, editing, even sending from another tab. Esc or Ctrl+C cancels the current tab’s request: the connection is closed at once and the viewer shows Cancelled after 3.0 s. Closing the tab or quitting cancels it too, and sending again from the same tab replaces the request in flight. Ctrl+C with nothing in flight never quits; it shows Press Ctrl+Q to quit.

Copy as code

Alt+C (or Copy as… in the palette) opens a picker of the snippet languages of rustman export snippet, the one you used last first. Type to filter (py req finds python-requests), ↑/↓ choose, Enter copies the current tab’s request, as edited, with the active environment: the toast reads Copied python-requests snippet. Each language is also in the palette as Copy as curl, Copy as go and so on. A graphql request is copied as its HTTP POST; other kinds have no snippet and Alt+C only shows a toast such as No snippet export for kind 'kafka'.

The snippet goes to the clipboard through the OSC 52 escape sequence, which works over SSH and inside tmux and needs no clipboard tool. Rustman uses it in Windows Terminal, iTerm2, WezTerm, kitty, Alacritty, foot, Ghostty, Contour, Rio and VS Code’s terminal (TERM, TERM_PROGRAM, or LC_TERMINAL, which SSH forwards), and inside tmux when tmux’s set-clipboard option is on (set -g set-clipboard on; tmux’s default, external, drops the sequence); set RUSTMAN_OSC52=1 to use it in another terminal, or RUSTMAN_OSC52=0 to never use it. Without it, or when the sequence would be over 100 KB (base64 makes it about 4/3 of the snippet, so a snippet over about 75 KB), the snippet opens in a read-only pane with the hint Select to copy; ↑/↓ scroll, Esc closes.

Snippets are redacted («redacted:token») like export snippet. While secrets are revealed (Alt+R) they hold the secret values instead: the picker shows the row Secrets revealed: snippet will contain secret values, and copying takes a second Enter (moving the selection or typing asks again). A palette Copy as entry opens the picker on its language in that case.

Importing collections

Import… in the palette imports a Postman collection or environment, an Insomnia export, a Bruno collection, a HAR capture or .http files into the workspace, with the engine of rustman import. Type the file or folder (relative to the workspace root, or absolute) and press Enter: the format is detected and a dry run shows its preview, the same summary as rustman import --dry-run: what would be written, skipped or updated, and which secrets move into the active environment (by name only). Enter imports that previewed source; Esc before it cancels without writing anything. Once the import runs it cannot be cancelled: the dialog shows Importing… until it is done, then the result is reported. The collection goes to the folder named after it, existing files are kept (--on-conflict skip), and the sidebar shows the new requests. For --into, other conflict policies, HAR filters or the JSON report, use the CLI.

Environments and secrets

Alt+E (or Switch environment in the palette) lists the workspace’s environments with the active one marked. Below the list it shows the variables the selected environment provides: each name, its layer (environment, or rustman.toml for workspace variables it does not override) and its value. Enter makes the selected environment active for this session: the status bar shows it and the next send resolves its variables from it. The default stays the one in rustman.toml (default_environment); switching in the TUI does not change any file.

Secret values are shown as •••••••• in the variable tooltip, the environment switcher and captured values. Response headers or bodies that echo a secret are redacted by the engine before the viewer gets them and show the engine’s marker, «redacted:token», the same text history, copies and saved bodies hold. Secret values are not read from the keychain or .rustman/secrets.yaml to draw the screen.

Alt+R reveals secrets for this session: the status bar shows a SECRETS VISIBLE badge in the warning colour, and the tooltip and the environment switcher show the active environment’s secret values, read once from the secret store (switching environment reads the new one’s). Press Alt+R again to mask them; the values are dropped from memory. Nothing about the reveal is saved, so the TUI always starts masked. Exchanges stay redacted while secrets are revealed: history, the response viewer, copies, saved bodies, reports and the viz companion never get secret values.

While certificate verification is off for the active environment’s sends (verify_tls = false in rustman.toml, which every environment uses, or verify_tls: false in the settings of the request in the current tab) the status bar shows TLS: INSECURE in the error colour, for as long as it stays off, and each exchange sent that way is marked TLS: INSECURE in its summary line. Environment files have no TLS setting of their own.

Response viewer

The response pane starts with a summary line: the status and reason, coloured by class (2xx ok, 3xx accent, 4xx warn, 5xx error, with ✔/✖ so it reads without colour), the total time, the body size and the assertion tally, e.g. ✔ 201 Created · 84 ms · 1.2 KiB · 3/3 passed. An exchange sent with TLS verification off ends with TLS: INSECURE. When no response arrived the line names the error category and the engine’s message instead (✖ DNS error · cannot resolve api.test: …; also TLS error, Timeout, Connection error, Proxy error, Auth error, Redirect error).

Below it are the viewer tabs Body, Headers, Timing and Assertions (a GraphQL exchange adds Data, Errors, Extensions and Events in front, see The GraphQL editor); with the response focused, ] and [ switch between them, and ↑/↓, PageUp/PageDown, Home/End (j/k, Ctrl+D/Ctrl+U, gg/G with vim keys) scroll.

Everything the viewer shows is redacted with the exchange’s secrets, as in history: a server echoing a token shows «redacted:token», and copying or saving the body copies or saves the redacted text.

  • Body: JSON is a collapsible tree, parsed once in the background so even large bodies scroll smoothly (only the rows on screen are drawn). Enter/Space folds or unfolds the selected node, ←/→ (or zc/zo) fold/unfold, zM/zR fold/unfold everything, and a folded array reads items: [1000 items]. y copies the selected value (a string without its quotes, anything else as JSON) with the system’s clipboard tool (pbcopy, clip, wl-copy, xclip or xsel), or else through the terminal with an OSC 52 escape sequence, which also works over SSH in terminals that support it. r switches between the tree and the pretty-printed text.
    • f opens a filter box that takes a JSONPath expression (not jq): $.items[*].id shows only the matching nodes, each named by its path, and the match count. An expression that does not parse shows its error inline and keeps the current view; an empty filter (or Esc in the box) shows the whole body again.
    • / searches keys and values as you type, unfolding the way to the first match; n/N go to the next/previous match. On large trees (above 20,000 nodes) the search runs in the background and the box shows searching… until it finishes; each keystroke cancels the previous search, so typing never waits for it.
    • HTML, XML, YAML, JavaScript and CSS bodies are highlighted according to the Content-Type (bodies above 512 KiB, or with a line longer than 20 KiB such as minified HTML, are shown plain); other text is shown as it is.
    • Binary bodies (images, audio, video, fonts, PDFs, application/octet-stream, or anything that is not UTF-8) show a hex dump of the first 4 KiB and the total size. s saves the body to a file (relative paths are taken from the workspace root); an existing file is never overwritten.
    • Bodies above the engine’s max_body_bytes (10 MiB by default, see Request files) are kept on disk instead of in memory. Above 50 MiB the tree is disabled: the viewer says so and shows the raw text a page at a time (scrolling past the end of a page loads the next one).
  • Headers: every response header in the order received, duplicates included (two Set-Cookie headers are two rows), then the request’s captured variables with their new values; secret ones show ••••••••.
  • Timing: a waterfall of the phases the engine measures (DNS, connect, TLS, waiting for the first byte, download), each bar placed and sized by its share of the total, with its duration. Phases that did not happen, such as DNS, connect and TLS on a reused connection, show —. The response’s Server-Timing metrics appear as labeled sub-bars under the waiting phase (db 53.2 ms), with their description. When the exchange carried trace context, a Trace block shows the trace id, the span id, the backend’s own trace id when its traceresponse names a different one, and the trace link when one is configured; Ctrl+O (trace.open) opens the link in the system browser. Below it, a sparkline of the total times of the last 30 exchanges of the same request file from history, the newest highlighted, with the min, median, p95 and max; with fewer than two exchanges it says not enough history.
  • Assertions: each assertion as passed or failed, with the expected and actual values of failures (✖ failed status == 200 · expected 200 · actual 404).
  • Snapshot (only when a snapshot failed, is missing or was just recorded): each snapshot with its file and diff. a approves (writes the received snapshot) and r rejects (keeps the stored file); Alt+A opens a queue over every failing snapshot in the open tabs. Approving is disabled in CI mode (CI=true).

D diffs the current exchange against an earlier one: a picker lists the exchanges in history, those of the same request first (Enter picks, Esc closes), and the diff compares the status, the headers and the body. JSON bodies are compared by path with key order ignored, so {"a":1,"b":2} against {"b":3,"a":1} reports only $.b: 2 → 3; other bodies are compared line by line.

Viz companion and HTML report

v (response focused) opens the current exchange in the optional graphical companion, rustman-viz, in its response inspector. The companion is looked for as the viz protocol defines: the path in RUSTMAN_VIZ, then rustman-viz on PATH, then rustman-viz (rustman-viz.exe) next to the rustman executable. A RUSTMAN_VIZ that is not an executable file is an error naming it; nothing else is tried. The TUI starts the companion, performs the rustman-viz/1 handshake and sends the exchange (already redacted; a body too large for one protocol line goes through a temp file, removed when the companion exits or when the TUI quits), then leaves the companion running on its own; a toast says Opened in rustman-viz ….

When the companion cannot be used, a warning toast says why and offers the HTML report instead:

ToastWhy
Viz companion not found: …no companion was found, or RUSTMAN_VIZ names a file that is not executable
Viz companion speaks rustman-viz/2, rustman needs rustman-viz/1; upgrade rustman-vizthe companion rejected the protocol version
Graphics unavailable (Vulkan)the companion could not start its graphics (exit code 3)
Viz companion failed: …it could not be started, did not answer within 10 s, or answered something else

Each ends with Export HTML report: H. H (response focused, or Export HTML report in the palette) writes the current exchange as a self-contained HTML page (summary, assertions, response headers and body, all redacted) to .rustman/reports/<request>-<time>.html in the workspace, which rustman init keeps out of Git, or to the temp directory in a scratch session, and the toast gives the path. The run dashboard (v in a run view) arrives with the TUI’s run view.

MCP inspector

Alt+I (or MCP inspector in the palette) shows the MCP inspector in place of the request and response panes; Esc or Alt+I hides it again, and the session keeps running while it is hidden. It lists the workspace’s MCP servers with their connection status, the connected server’s info and capabilities, and the Tools, Resources, Prompts, Notifications and Stderr tabs, with argument forms, the result view and the dialogs for stdio trust, sampling and elicitation. While a sampling or elicitation request waits for you, the status bar shows MCP APPROVAL (<n>) on every screen until it is handled.

Webhook pane

Alt+W (or Webhook inspector in the palette) shows the webhook inspector in place of the request and response panes; Esc or Alt+W hides it again, and the listener keeps running while it is hidden. The pane shows the listener’s state and address with the number of buffered captures and their size, the captures newest first (time, method, path, body size and the signature verdict as a coloured badge: valid, invalid, missing, expired), the selected capture (request line, receive time, every header in order, then the body), and the event log. Values are redacted with the signature verifier secrets; credentials such as Authorization show as placeholders.

KeyAction
sStart or stop the listener. It binds [webhook] host and port from rustman.toml (default 127.0.0.1:9090) and answers with the workspace’s webhook/mocks.yaml. An address reachable from the network asks for confirmation first (Cancel is preselected); while such a listener runs, the pane shows REACHABLE FROM THE NETWORK and the status bar a red badge on every screen.
↑ ↓ (j k), Home End (g G)Select a capture.
PageUp PageDownScroll the selected capture’s headers and body a page at a time; the title shows which lines are on screen (41-80 of 655366). The body is prepared once per capture and view, and only the lines on screen are drawn, so even a 10 MiB body scrolls smoothly.
vCycle the body view: auto (JSON pretty-printed, form fields, or text), text, JSON, hex. A body that is not UTF-8 is always shown as hex.
rReplay the capture to a URL (asked for; the last one is offered again) through the HTTP engine, with the header hygiene of replay. A toast gives the status.
wSave the capture as a kind: http request file: asks for the target URL ({{base_url}}<path> is offered) and the file name (webhook-<id>.rman.yaml).
hSave the capture to the workspace history as an inbound entry.
yCopy the capture as a curl command sent to the URL it was received on (its Host).
cClear the capture buffer.
mEdit webhook/mocks.yaml (a commented template when it does not exist yet). Ctrl+S checks and saves it: a file that does not parse is not written and the error is shown under the text; a running listener reloads the saved mocks. Esc closes the editor without saving.

? opens the help; other letters do nothing while the pane is shown. Quitting the TUI stops the listener.

Recorder pane

Alt+P (or Traffic recorder in the palette) shows the traffic recorder pane: start and stop the recording proxy, follow its captures live, filter and mark them, inspect one (redacted), and save the marked captures as request files or export them as HAR. The keys and the CA TRUSTED status badge are described in The TUI recorder pane.

Mock server pane

Alt+O (or Mock server in the palette) shows the mock server in place of the request and response panes; Esc or Alt+O hides it again, and the server keeps running while it is hidden. The pane shows the server’s state and address, and the live request log: time, method, status, the response source (example, synthesized, prefer, override, stateful, proxy, cors or error), the path, the operation or override that answered, and the first validation error. Reload notices appear in the log too. Entries are redacted by the server; credentials such as Authorization show as placeholders.

KeyAction
sStart or stop the server. Starting asks for the OpenAPI document (a file, relative to the workspace root, or a URL; the last one is offered again). The server binds [mock] host and port from rustman.toml (default 127.0.0.1:4010), answers with the overrides of the mocks directory and reloads both on change. An address reachable from the network asks for confirmation first (Cancel is preselected).
cClear the log.

? opens the help; other letters do nothing while the pane is shown. Quitting the TUI stops the server.

Monitors view

Monitors in the palette (monitors.open) lists the workspace’s monitors: last outcome, 24-hour uptime, a latency sparkline and whether a rule is firing, with the selected monitor’s firing rules and latest results. j/k select, r runs the selected monitor now in the background (through the monitor policy, the store and its alerts; the list refreshes when it finishes), v opens the monitors’ trends in the viz companion (or says why it cannot), and Esc closes.

Mouse

When the terminal reports mouse events, clicking focuses a pane, an editor field or a pane switcher label, selects a sidebar row, a request tab or an editor tab; the wheel scrolls the pane under the pointer; and dragging the sidebar’s right border resizes it. Set mouse = false in tui.toml to leave the mouse to the terminal, so its own text selection works; the TUI then doesn’t capture mouse events at all.

Themes, colours and ASCII

Three themes ship: dark (the default), light and high-contrast. Pick one with --theme NAME or theme = "NAME" in tui.toml; the flag wins. Themes are palettes of semantic colours (text, muted, accent, border, focus, selection, ok, info, warn, error, background), so every part of the UI changes together.

The colour depth is detected from the environment:

  • NO_COLOR set to a non-empty value: no colours at all. Focus, selection and badges use bold, dim and reverse video, and status uses symbols (✔, ✖).
  • COLORTERM=truecolor or COLORTERM=24bit: 24-bit colour.
  • Anything else: each theme colour is mapped to its nearest xterm-256 colour.

--ascii (or borders = "ascii" in tui.toml) replaces box drawing and other non-ASCII symbols with ASCII: borders use +, - and |, the pointer is >, and symbols such as ✖ become x. Use it on terminals or fonts that mis-render box drawing.

Settings: tui.toml

The TUI reads tui.toml from the Rustman config directory: $XDG_CONFIG_HOME/rustman/, else ~/.config/rustman/ on Linux and macOS, and %APPDATA%\rustman\ on Windows. Every key is optional:

theme = "dark"       # dark | light | high-contrast
borders = "unicode"  # unicode | ascii
mouse = true         # false leaves the mouse to the terminal
keymap = "default"   # default | vim (same as --vim)

Unknown keys are ignored. An invalid file is ignored as a whole, with a warning toast naming the problem.

Keys

Every key runs an action with a stable id such as request.send. Bindings belong to a context: global, sidebar, editor (method, URL, editor tabs and body) or response. A key is looked up in the focused context first, then in global.

While a text input has the focus (the URL, a text body, a table cell being edited, the sidebar filter), typed characters are text: ?, v and other plain keys type themselves instead of running their action. Keys with Ctrl or Alt, function keys, Tab and Esc still work.

Ctrl+C never quits. With a request in flight it cancels it; otherwise it shows Press Ctrl+Q to quit.

Command palette

Ctrl+P opens a fuzzy finder over every action (with its current keys on the right), every request file and every environment. Type to filter: the letters only have to appear in order, so swenv finds Switch environment. ↑/↓ (or Ctrl+P/Ctrl+N) choose, Enter runs, Esc closes. With nothing typed, the entries you used most recently in this session come first.

Choosing an action runs it. Choosing a request file opens it. Choosing an environment makes it the active one for this session; the status bar shows it.

Switch environment (Alt+E) opens the same finder with environments only, the active one marked, and lists what the selected one provides (see Environments and secrets).

Help

? (outside text inputs) or F1 lists the keys for the focused context and the global ones, exactly as they are bound after your keybindings.toml (with vim keys on and the body focused, the modal editing keys too). ↑/↓ scroll; Esc, ? or F1 close it.

Vim mode

keymap = "vim" in tui.toml, or --vim, adds vim keys on top of the defaults:

  • In the sidebar and the response viewer: j/k move, gg/G jump to the top or bottom, Ctrl+D/Ctrl+U page, and h/l move to the pane on the left or right.
  • The request body becomes modal. It starts in normal mode; i, a or o enter insert mode and Esc returns to normal mode; v starts a visual selection. The status bar shows NORMAL, INSERT or VISUAL.

This is not a full vim: there are no counts, registers, text objects, : commands or search in text areas.

Without vim mode the body is a plain text area: type, Enter, Backspace, Delete, arrows, Home/End. Until the request editor opens request files, the body is a scratch buffer that is not saved.

keybindings.toml

Put your own bindings in keybindings.toml next to tui.toml (~/.config/rustman/keybindings.toml on Linux and macOS, %APPDATA%\rustman\keybindings.toml on Windows). Each table is a context; each entry maps keys to an action id, or to "none" to remove a binding:

[global]
"F5" = "request.send"     # F5 sends, in addition to Ctrl+Enter and Ctrl+R
"Ctrl+R" = "none"         # Ctrl+R no longer sends

[sidebar]
"Ctrl+J" = "list.down"

Your entries win over the vim preset, which wins over the defaults. Adding a key keeps the action’s other keys; remove one with "none". Help and the palette show your keys first, and on-screen hints (No response yet · press F5 to send, the quit key in the status bar) name your first key, or drop the advice when an action has no key. The keys of the editor’s tables (a add, x remove, Space toggle) are fixed.

Keys are written as modifiers and a key joined by +: Ctrl, Alt and Shift with a character, Enter, Esc, Tab, Backspace, Delete, Insert, Home, End, PageUp, PageDown, Up, Down, Left, Right, Space or F1–F24 (Ctrl+Enter, Alt+E, Shift+Tab, F5). A shifted character is written as itself (G, ?). Up to three keys in a row make a sequence: "gg", or with spaces, "Ctrl+K Ctrl+S". Many terminals can’t tell Ctrl+Enter from Enter; that is why Ctrl+R also sends.

At start-up, every entry with an unknown action id, an unknown context or a key that can’t be parsed is reported in a warning toast (and the notification log) and skipped; the other bindings work. A file that isn’t valid TOML is ignored as a whole, with a warning.

Conflicts are reported the same way:

  • Two spellings of the same key in one table ("Ctrl+R" and "ctrl+r") are both skipped, since the file gives no order to pick one.
  • A binding that is the start of a longer one ("g" when gg is bound) wins as soon as it is typed, so the longer one can’t be typed there; the warning names both.
  • A pane binding ([editor], [sidebar], [response]) wins over a [global] binding of the same keys while that pane is focused, so binding "Ctrl+Q" under [editor] to another action makes quitting impossible from the editor; the warning names both.
  • If no key is left for app.quit, Ctrl+Q is bound to it again (replacing any other use of Ctrl+Q), so the TUI can always be closed.

Key reference

The table below is generated from the action registry; a test fails if it drifts from the code.

Esc (ui.escape) closes overlays and dismisses toasts today. Once requests can be sent, it also cancels the request in flight in the current tab, like Ctrl+C (spec: Default keymap and Sending requests).

ActionIdDefault keysVim preset adds
Send requestrequest.sendCtrl+Enter, Ctrl+R
Cancel requestrequest.cancelCtrl+C
Save requestrequest.saveCtrl+S
New tabtab.newCtrl+T
Close tabtab.closeCtrl+W
Next tabtab.nextCtrl+PageDown
Previous tabtab.prevCtrl+PageUp
Go to tab 1tab.goto_1Alt+1
Go to tab 2tab.goto_2Alt+2
Go to tab 3tab.goto_3Alt+3
Go to tab 4tab.goto_4Alt+4
Go to tab 5tab.goto_5Alt+5
Go to tab 6tab.goto_6Alt+6
Go to tab 7tab.goto_7Alt+7
Go to tab 8tab.goto_8Alt+8
Go to tab 9tab.goto_9Alt+9
Command palettepalette.openCtrl+P
Helphelp.open?, F1
Toggle sidebarsidebar.toggleCtrl+B
Widen sidebarsidebar.growAlt+Right
Narrow sidebarsidebar.shrinkAlt+Left
Open requestsidebar.openEnter (sidebar)
Filter requestssidebar.filter/ (sidebar)
New request filesidebar.newn (sidebar)
Rename request or foldersidebar.renamer (sidebar)
Delete request or foldersidebar.deleted (sidebar)
Collapse foldertree.collapseLeft (sidebar)
Expand foldertree.expandRight (sidebar)
Focus nextfocus.nextTab
Focus previousfocus.prevShift+Tab
Focus pane to the leftpane.lefth (response)
Focus pane to the rightpane.rightl (sidebar)
Close or dismissui.escapeEsc
Switch environmentenv.switchAlt+E
Reveal secretssecrets.revealAlt+R
Refresh secretssecrets.refresh
Edit in external editoreditor.externalCtrl+E (editor)
Change body mode or auth typeeditor.modeAlt+M (editor)
Show completionseditor.completeCtrl+Space (editor)
Open in viz companionviz.openv (response)
Show notification lognotifications.show
Move uplist.upUp (sidebar, response)k (sidebar, response)
Move downlist.downDown (sidebar, response)j (sidebar, response)
Go to toplist.topHome (sidebar, response)gg (sidebar, response)
Go to bottomlist.bottomEnd (sidebar, response)G (sidebar, response)
Page uplist.page_upPageUp (sidebar, response)Ctrl+U (sidebar, response)
Page downlist.page_downPageDown (sidebar, response)Ctrl+D (sidebar, response)
Next response tabresponse.next_tab] (response)
Previous response tabresponse.prev_tab[ (response)
Fold or unfold nodejson.toggleEnter (response), Space (response)
Fold nodejson.collapseLeft (response), zc (response)
Unfold nodejson.expandRight (response), zo (response)
Fold alljson.collapse_allzM (response)
Unfold alljson.expand_allzR (response)
Copy valuejson.copyy (response)
Toggle raw bodyresponse.rawr (response)
Cycle gRPC timeline directionresponse.timeline_directiond (response)
Filter body (JSONPath)response.filterf (response)
Search bodyresponse.search/ (response)
Next matchsearch.nextn (response)
Previous matchsearch.prevN (response)
Diff with an earlier exchangeresponse.diffD (response)
Save body…response.save_bodys (response)
Export HTML reportreport.htmlH (response)
Webhook inspectorwebhook.openAlt+W
Mock servermock.openAlt+O
MCP inspectormcp.openAlt+I
Traffic recorderrecorder.openAlt+P
Refresh GraphQL schemagraphql.refresh_schemaCtrl+G
Start GraphQL subscriptiongraphql.subscription_startAlt+S
Stop GraphQL subscriptiongraphql.subscription_stopAlt+X
Send following subgraph paginationgraphql.paginateAlt+G
Cycle blockchain scalar displaygraphql.displayu (response)
Open result value in EVM toolkitgraphql.linksL (response)
Copy as…request.copy_asAlt+C
Import…import.open
Review snapshotssnapshot.reviewAlt+A
Monitorsmonitors.open
Open trace linktrace.openCtrl+O
Quitapp.quitCtrl+Q

In vim mode, text areas (the request body) are modal:

KeysWhat they do
i a oinsert before / after the cursor, on a new line below
Escback to normal mode
h j k lleft, down, up, right (also the arrow keys)
w b enext word, previous word, end of word
0 $start, end of the line
gg Gfirst, last line
Ctrl+D Ctrl+Udown, up half a page
xdelete the character under the cursor
ddcut the line
yycopy the line
ppaste after the cursor
uundo
vvisual mode: move to select
y din visual mode: copy, cut the selection

How it works

The UI follows an Elm-style loop (design D2 of the change): key presses, mouse events, resizes, clock ticks and finished background work all become actions on one channel; a pure update function changes the state and returns effects (load or create a workspace, save, create, rename or delete files, re-read a changed file, run the external editor, send a request, filter or page a body, read history, copy or save, read secrets to reveal them, hand an exchange to the viz companion, write an HTML report); an effect runner task executes those off the render loop and reports back with new actions; view draws the state. Nothing on the render loop waits for the disk or the network. A send runs on a thread of its own with the engine’s runner and its own connection pool; cancelling drops the request, which closes its connection.

Screenshots

To render one frame without a terminal, for example for the README:

cargo run -p rustman-tui --example screenshot -- [--ansi] [--size WxH] [--theme NAME] [--ascii] [--no-color] [--open REQUEST] [--response BODY.json] [--keys KEYS] [PATH]

It opens PATH as rustman tui would, runs the start-up work synchronously, and prints a 120x36 frame (or --size) as plain text, or with ANSI colours with --ansi (view it with cat or less -R). It ignores tui.toml and renders in 24-bit colour unless --no-color is given, so the output depends only on the flags and the workspace.

The README images in docs/images/tui-*.svg are real frames rendered off-screen by the screenshot example. crates/rustman-tui/examples/screenshots/ holds the sample workspace (HTTP, GraphQL, JSON-RPC, evm-call, gRPC and Kafka requests, a .proto file, an OpenRPC catalog, MCP server definitions and two monitors) and the sample responses, and its render.sh renders every frame and converts it to SVG with ansi2svg.py next to it. The Monitors view reads its results relative to the current time, so monitor-store.py writes 24 hours of sample results into the copied workspace’s store just before that frame (a fixed seed keeps their shape; only the timestamps change between renders):

crates/rustman-tui/examples/screenshots/render.sh
FrameWhat it shows
tui-shella request’s Headers tab and its JSON response tree
tui-assertionsfailed assertions with expected and actual values
tui-timingthe timing waterfall and latency sparkline, with a masked bearer token
tui-environmentsthe environment switcher with each variable’s layer, the secret masked
tui-palettethe command palette fuzzy-matching swenv
tui-helpthe help overlay
tui-graphqlthe GraphQL editor’s inline validation and the response’s Errors tab
tui-graphql-schemathe GraphQL schema browser, with a deprecated field
tui-jsonrpcJSON-RPC method completion from an OpenRPC catalog
tui-evmthe EVM pane’s Function tab: the view functions of the built-in ERC-20 ABI, before anything is sent
tui-grpcthe gRPC method browser and a server-streaming call’s messages
tui-grpc-timelinea gRPC request message and the call’s timeline
tui-mcpthe MCP inspector asking for workspace trust before running a stdio server
tui-messagingthe messaging editor’s Compose tab for a Kafka produce request
tui-monitorsthe Monitors view: two monitors’ last outcome, uptime and latency sparkline, a firing rule and the recent runs

The animated GIF at the top of the README (docs/images/demo.gif) is a real session recorded with VHS: examples/demo/ holds the todo backend it talks to, its workspace, the demo.tape script and a render.sh that builds Rustman, starts the backend and records the tape.

To render a single frame:

cargo run -p rustman-tui --example screenshot -- --ansi --size 136x30 \
    [--open pets/get-pet.rman.yaml --response pet.json] [--keys "Ctrl+P s w e n v"] <workspace> > frame.ans

--open opens a request file (relative to the workspace root) in a tab, and its background loads (a GraphQL or gRPC schema, an OpenRPC catalog) run before the frame is captured. --response shows a JSON file as its exchange, so a frame with a response needs no network and is the same on every run: for an HTTP request it is the body of a 200 OK with fixed timings and history, and the request’s assertions are evaluated against it, so the Assertions tab and the summary line’s tally are real results; for a GraphQL request the body is read as a GraphQL result (Data, Errors and Extensions tabs); for a gRPC request the file is the call’s record, the grpc member of a rustman.report/v1 request. --keys presses space-separated chords before the frame is captured (for example Ctrl+P for the palette, F1 for help, Alt+I for the MCP inspector, Tab 2 Tab to show and focus the Headers tab, or Tab Tab Tab ] ] to focus the response and show its third tab; the URL has the focus first, so a printable key such as ? is typed into it). Frames that need a running listener or session (webhook captures, the mock server’s request log, a connected MCP server, the traffic recorder’s captures, a live messaging consume) can’t be rendered this way. Neither can a sent evm-call’s Result tab: --response has no form for an EVM call’s record.

Platform checks

Automated (CI, every pull request). The TUI smoke test opens a fixture workspace at 80x24, opens a request from the command palette, sends it to an in-process mock server, opens a slow request, sends it, cancels it with Esc (the server sees the connection close), and quits with Ctrl+Q.

  • cargo test -p rustman-tui --test pty_smoke runs the real rustman_tui::run in a pseudo-terminal on all three OSes: a Unix pty on Linux and macOS, ConPTY on Windows. Raw mode, the alternate screen, the input reader and the effect runner are the real ones. Keys are written to the pty and the screen is read back through a terminal emulator (vt100); after Ctrl+Q the test checks that the emulated screen is back to the main screen with the cursor shown.
  • On Windows, crossterm turns on VT processing (Windows 10 and later) and writes the same escape sequences as on Unix, so ConPTY sees the alternate screen and cursor changes. ConPTY re-renders the child’s output rather than passing it through byte for byte, so the exact ESC[?1049h / ESC[?1049l bytes are only asserted on Linux and macOS; Windows checks the resulting screen. portable-pty opens ConPTY with PSEUDOCONSOLE_INHERIT_CURSOR, which makes ConPTY ask for the cursor position first; the test answers it.
  • cargo test -p rustman-tui --lib smoke_tests also runs the same flow on every OS through the real event loop, effect runner, engine and mock server with an in-memory 80x24 terminal, so a ConPTY problem on a runner image is told apart from a TUI regression.

Manual check matrix. Pending manual runs: each cell is filled in (ok, or a link to an issue) after opening a workspace, sending, browsing a JSON response, the palette, help and --ascii in that terminal and colour mode.

TerminalTruecolor256 coloursNO_COLOR
Windows Terminalpendingpendingpending
conhost (classic console)pendingpendingpending
iTerm2pendingpendingpending
Alacrittypendingpendingpending
kittypendingpendingpending
tmux (in any of the above)pendingpendingpending
GNOME Terminalpendingpendingpending

Force a mode with COLORTERM=truecolor, COLORTERM= TERM=xterm-256color, or NO_COLOR=1.

CLI reference

rustman is the headless face of Rustman, for scripts and CI. Reports and response bodies go to stdout; warnings and errors go to stderr, prefixed with warning: and error:.

This page covers sending and running requests, reporters, terminal behavior, logging, completions and the exit codes. The other commands are described with the features they belong to.

Commands

CommandWhat it doesDescribed in
rustman / rustman tui [path]Open the terminal UI (rustman alone does so when stdin and stdout are a terminal, and prints help otherwise); --theme, --ascii, --vimTerminal UI
rustman init [dir] [--bare]Create a workspace: rustman.toml, a local environment and a sample requestRequest files
rustman env listList the environments and mark the active oneEnvironments
rustman secret set <name> --env <env>Store a secret value (read from stdin or a no-echo prompt)Secrets
rustman secret list --env <env>List the declared secrets and whether each is setSecrets
rustman secret rm <name> --env <env>Delete a stored secret valueSecrets
rustman secret get <ref>Fetch a secret reference (<provider>/<path>[#field]) from its provider and print •••••••• (<n> chars, <provider>); --reveal prints the value, on a terminal only (exit 2 otherwise); exits 3 when the secret cannot be resolved, whatever the cause (an unknown provider or a provider type not in this build included), as send does; --workspaceSecret providers
rustman secret test [<provider>]Check that secret providers (one, or every configured one) can authenticate and be reached; exits 0 when every check passes and 3 otherwise (an unknown provider name included)Secret providers
rustman secret list-providersList the configured secret providers: name, type, auth, origin (workspace or user) and whether the type is in this build, never values; --types lists the provider types this build supportsSecret providers
rustman cookies clearEmpty the cookie jar of an environmentCookies
rustman auth login <request>Run the OAuth2 authorization-code login for a request and cache its tokenOAuth2
rustman import curlCreate a request file from a curl commandCurl import
rustman import <src> / rustman import auto <src>Import a collection export, detecting its format from the contentImporting collections
rustman import postman <src>Import a Postman Collection v2.0 or v2.1 exportPostman
rustman import postman-env <src>Import a Postman environment export into environments/Postman environments
rustman import insomnia <src>Import an Insomnia v4 (JSON) or v5 (YAML) exportInsomnia
rustman import bruno <src>Import a Bruno collection folder or a single .bru fileBruno
rustman import har <src>Import the requests of a HAR 1.2 capture, with --host, --method, --content-type and --include-staticHAR
rustman import http <src>Import .http / .rest files (a file or a folder) and their environment filesHTTP files
rustman import <format> <src>Import a source with an importer plugin that registers <format>: the host checks the request files and environments it returns and writes them (nothing when one is invalid); --into, --dry-run, --on-conflict, --trust-pluginsImporters
rustman import openapi <file|url>Create a collection, environments and auth config from an OpenAPI 3.0 or 3.1 document; --into, --allow-remote-refs; --sync (with --dry-run, --json) updates an imported collectionOpenAPI import
rustman import asyncapi <file|url>Create Kafka, MQTT and AMQP request files (a folder per channel) and an environment per server from an AsyncAPI 2.6 or 3.0 document; --into, --allow-remote-refs, --workspace; other versions exit 2Messaging
rustman explore plan --spec <file|url> --target <url>Discover the resource graph and plan exploration probes without sending anything; --probes, --operations, --seed, --fuzz-cases, the safety flags, --graph, --jsonExploration
rustman explore run --spec <file|url> --target <url>Discover, plan, send the probes under the safety policy and write the report; the plan flags plus --rate, --concurrency, --max-probes, --max-duration, --fail-on, --report <format>[=<path>]Exploration
rustman explore resume <id>Continue an interrupted exploration with the probes not yet runExploration
rustman explore status [<id>]Show the phase, progress and findings by severity of an exploration (the latest by default); --jsonExploration
rustman explore export <id> --findings <ids|all> --into <dir>Write findings as regression request files for rustman runExploration
rustman report schemaPrint the JSON Schema of rustman.report/v1Reports
rustman report render <report.json> --format <format>Render a run or exploration report as json, junit, markdown, html or sarif, or with a report plugin (<plugin>/<format>, with -o); -o <file>, --fail-on, --trust-pluginsReports
rustman report diff <old.json> <new.json>List new, fixed and unchanged findings, coverage deltas and changed assertions; --fail-on, --format markdown|jsonReports
rustman export curl <request>Print a request as a curl command (redacted; secret provider references print as «redacted:<provider>/<path>» without being fetched)Curl export
rustman export postman <path>Write a collection folder or request file as a Postman Collection v2.1 (-o <file>)Exporting
rustman export http <path>Write a collection folder or request file as a .http file (-o <file>)Exporting
rustman export snippet --lang <lang> <request>Print a request as code for one of 11 languages and tools (redacted; secret provider references are never fetched); --list lists themCode snippets
rustman sendSend one request and print the responsebelow
rustman runRun the requests under files and folders and report the resultsbelow
rustman bench [path]... --target <url>Load test request files and collections as virtual-user iterations under the safety policy pinned to --target; --executor (constant-vus, ramping-vus, constant-arrival-rate), --vus, --duration, --iterations, --think-time, --stage (or rustman.toml [[bench.stages]]), --rate, --max-vus, --data, --data-mode, --data-exhaust, --secret-columns, --allow-mutations, --allow-destructive, --production, --timeout, --insecure/-k, --env, --var, --threshold, --report json=<file>/html=<file>, --viz, --trust-plugins; shows a live dashboard on a terminal (a progress line every 10 s otherwise); capped by rustman.toml [bench]; exits 1 when a threshold fails, 2 on a usage error or a cap, 4 when the policy refuses, 130 on Ctrl+CLoad testing
rustman stress <mode> [path]... --target <url>Find where a target listed in rustman.toml [stress] targets breaks, how, and whether it recovers: breakpoint (--start-rps, --step-factor, --step-duration, --refine, --require-rps), spike (--baseline-rps, --baseline, --spike-factor, --spike-duration), soak (--rps, --duration, --drift-threshold) or fuzz; --slo (or rustman.toml [stress.slo]), --treat-throttling-as-failure, --max-vus, --fail-on, --allow-mutations, --allow-destructive, --production, --timeout, --insecure/-k, --env, --var; fuzz mixing with --fuzz-ratio, --malformed, --spec, --seed and the fuzz phase’s --baseline, and wire faults with --wire and --allow-wire-faults, all checked by the stress gate first; the health request (--health, default the first GET) feeds the kill switch and the recovery check (--recovery-timeout, default 2m); a dashboard on a terminal, else one line per step; --report <format>[=<path>] and --viz; the report is kept as .rustman/stress/<id>/report.json; capped by rustman.toml [stress]; exits 1 on a finding at or above --fail-on or a max_sustainable_rps below --require-rps, 2 on a usage error or a cap, 4 when the safety policy or the stress gate refuses, 130 on Ctrl+CStress testing
rustman stress export <id> --findings <ids|all> --into <dir>Write the findings of a stress run as regression request files (the minimized input and a status: "4xx" assertion), wire faults as .wire.txt comment filesStress testing
rustman monitor <command>Scheduled monitors: monitor files in monitors/*.rman-monitor.yaml, results in .rustman/monitors/Monitors
rustman monitor run <name> / rustman monitor run --allRun monitors once on the run engine under the read-only monitor policy, store each result, compact old results when due, and evaluate and send alerts; exits 0 (pass), 1 (an assertion failed), 2 (an invalid monitor file, a missing target or environment), 3 (a request errored or the run passed its timeout), 4 (a request was blocked), 130 on Ctrl+CMonitors
rustman monitor listList the monitors with their schedule, environment and targets; --jsonMonitors
rustman monitor daemonRun every monitor of the workspace on its schedule until Ctrl+C or SIGTERM (10 s drain): overlapping runs skipped, monitor files reloaded, one daemon per workspace (exit 2 for a second one), no listening port, one log line per run on stderrMonitors
rustman monitor statusEach monitor’s last result, uptime over 24 h, 7 d and 30 d, p95 latency with a sparkline, coverage and firing rules, from the store only; --json; --viz also opens the trend view in the viz companion, or notes why notMonitors
rustman monitor history <name>The stored results of a monitor, newest first, compacted days as hourly aggregates; --since, --outcome, --jsonMonitors
rustman monitor test-alert <name>Send [TEST] <name> through every channel of a monitor and print ok or the error per channel; exits 0 when all succeed, 3 otherwiseMonitors
rustman monitor schedule-recipe <name> --for <scheduler>Print a cron, systemd, launchd or GitHub Actions configuration that runs the monitor on its schedule; writes only with --write <path>Monitors
rustman graphql introspect <endpoint|request>Fetch a GraphQL schema by introspection and cache it in .rustman/graphql/schemas/; --out <file> also writes it as SDLGraphQL
rustman graphql query <request> / --endpoint <url> --query <text>Validate, send and print a GraphQL operation or subscription; --no-validate, --json, --max-events, --duration, and for blockchain presets --paginate [id_gt|skip], --max-pages, --raw, --unitsGraphQL
rustman rpc call <endpoint|request> [method] [params-json]Send one JSON-RPC call (or a kind: jsonrpc request) and print its result or error object; --header, --id, --notify, --subscribe / --unsubscribe, --raw, --json, --no-validate; --param name=value for the typed eth_*, net_* and web3_* methods (EVM toolkit)JSON-RPC
rustman rpc batch <endpoint> <file|->Send calls from a JSON array, a YAML list or JSON lines as batches of 100 and print the results in input orderJSON-RPC
rustman rpc discover <endpoint>Fetch an OpenRPC document with rpc.discover and cache it in .rustman/cache/openrpc/JSON-RPC
rustman grpc list <target|request>List the services and methods of a gRPC target, by reflection through .rustman/grpc/descriptors/ or from the request’s schema; --refresh, --jsongRPC
rustman grpc describe <target|request> <symbol>Describe a service, a method (call type, message types and a request template) or a message; --jsongRPC
rustman evm call <request> / --to <a> --abi <abi> --function <f> [arg]...Run a read-only eth_call (an evm-call request, or ad hoc) and print the decoded outputs or revert; --block, --from, --value, --estimate, --trace, --rpc, --env, --jsonEVM toolkit
rustman evm decode --abi <abi> <hex>Decode call data, revert data or (with --topic) a log with an ABI, offline; --jsonEVM toolkit
rustman evm logsStream new heads (--heads) or logs (--address, --event, --topic) over eth_subscribe or HTTP polling, reorgs marked REORGED; or query --from-block/--to-block; --max-events, --duration, --poll-interval, --jsonEVM toolkit
rustman evm tx <hash>Show a transaction and its receipt with input and logs decoded; --jsonEVM toolkit
rustman evm block [number|tag|hash]Show a block (default latest); --jsonEVM toolkit
rustman evm ens <name|address>Resolve an ENS name, or an address to its verified primary name; --jsonEVM toolkit
rustman evm fork --chain <chain>Fork a chain (an environment, chain name or id; or --env/--rpc) with a local Anvil and a temporary fork-<chain> environment until Ctrl+C; --block, --port, --jsonEVM toolkit
rustman evm probe <rpc-or-env>...Probe EVM RPC providers: method support matrix, archive detection, latency per method, subscriptions, multi-provider consistency (exit 2 for providers on different chains) and, with --rate-discovery, rate limits; --methods, --block, --budget, --call, --address, --max-drift, --drift-interval, --max-rate, --fail-on, --report <format>=<path>, --vizProbing EVM providers
rustman evm send <request>Check an evm-tx request against the signing gate: [evm] allow_signing, a signer (never a raw key), --sign (without it only the decoded preview), the environment’s chain_id against the node, a simulation from the signer (--force-revert to go on after a revert), then the decoded confirmation (typed chain name on chain 1 and protected_chains; --yes-local without a terminal on local chains only), the send and the receipt (--confirmations, --receipt-timeout, exit 3 on timeout) with its assertions, captures and a history audit entry (--no-history); --signer (or RUSTMAN_EVM_SIGNER), --env, --var; refusals exit 4EVM signing
rustman evm signer / rustman evm signer import <id>Store a private key (no-echo prompt, or stdin) in the OS keychain as signer <id>, used with [evm.signers.<id>] keychain = true; the key is never printedEVM signing
rustman grpc call <request> / --target <t> --method <m> --data <json>Send one gRPC call and print the response messages and status; --metadata, --deadline-ms, --json (one line per message, then a status line)gRPC
rustman grpc health <target>Call grpc.health.v1.Health/Check and print the serving status; --service, --timeout, --jsongRPC
rustman ws connect <url|request>Open a WebSocket session (a ws:// / wss:// URL or a kind: ws request), send the lines of a piped stdin as text frames and print the received messages; --json, --max-messages, --duration, --header, --subprotocol, --traceWebSocket and SSE
rustman sse listen <url|request>Listen to a Server-Sent Events stream (an http(s):// URL or a kind: sse request) and print its events; --json, --max-messages, --duration, --header, --traceWebSocket and SSE
rustman kafka produce [request]Produce messages (a kind: kafka request, or --brokers, --topic, --partition, --key, --header and --value, or one message per line of a piped stdin) and print their partitions and offsets; --jsonMessaging
rustman kafka consume [request]Read a topic from --partitions and an --offset (earliest, latest, a number or an RFC 3339 timestamp) without a consumer group, printing messages as they arrive; --max-messages, --duration, --json (one line per message)Messaging
rustman mqtt produce [request]Publish messages (a kind: mqtt request, --value flags or stdin lines) with --broker, --topic, --qos, --retainMessaging
rustman mqtt consume [request]Subscribe to a topic filter (+, #) with a clean session and print messages as they arrive; --max-messages, --duration, --jsonMessaging
rustman amqp produce [request]Publish messages with publisher confirms to --exchange with --routing-key (--mandatory fails unroutable messages)Messaging
rustman amqp consume [request]Consume through a temporary queue bound to --exchange with --binding-key, or from an existing --queue with --destructive or --requeue; --max-messages, --duration, --jsonMessaging
rustman history listList past exchanges, newest first, with --status, --method, --grep, --since, --limit and --jsonHistory
rustman history show <id>Print one exchange in full (redacted)History
rustman history replay <id>Send an exchange’s request again, with secrets read from the store now (a plugin auth scheme signs it again: --trust-plugins as for send)History
rustman history clearDelete every recorded exchangeHistory
rustman trace open <id>Open the trace link of a history exchange (an id or a unique prefix) in the browser and print it; --no-browser only prints it; exits 2 without a link templateTrace propagation
rustman mcp serveServe the workspace to AI agents over MCP: stdio by default, or Streamable HTTP with --http [<addr>], --allow-remote and --token-fileAgents (MCP)
rustman mcp-client tools <server>List an MCP server’s tools; <server> is a workspace server, stdio:<command line> or an http(s):// URL; --json, --trust, --timeout, --envMCP client
rustman mcp-client call <server> <tool>Call a tool with --args <json> or --arg k=v / --arg k:=<json>; --no-validate, --sampling-response <file>; exits 1 on a tool or protocol errorMCP client
rustman mcp-client resources <server>List an MCP server’s resources, or read one with --read <uri>MCP client
rustman mcp-client prompts <server>List an MCP server’s prompts, or get one with --get <name> --arg k=vMCP client
rustman mcp-client logout <server>Delete the OAuth tokens stored for an MCP serverMCP client
rustman completions <shell>Print a shell completion scriptbelow
rustman snapshot list [path]List snapshot files with their request, name and state (ok, orphaned, unreferenced name); --jsonSnapshots
rustman snapshot prune [path]Delete snapshot files no request uses anymore; --yes, --dry-runSnapshots
rustman webhook listenCapture inbound webhooks on a local port, answer with mocks, check signatures and print the event log; --host, --port, --allow-remote, --max-body, --max-captures, --jsonl, --env, --workspaceWebhook inspector
rustman recordRun the local recording proxy (default 127.0.0.1:8888) and print one redacted line per capture until Ctrl+C; HTTPS is decrypted only for --intercept hosts; --host, --port, --allow-remote, --workspace, filters (--include-host, --exclude-host, --method, --content-type, --keep-static), --json, --upstream (reverse proxy, --insecure), --save (--into, --env, --store-secrets), --har (--show-secrets)Traffic recorder
rustman record ca initCreate the workspace’s local CA: the key in the OS keychain, the certificate in the user config directory; exits 2 without a keychainTraffic recorder
rustman record ca exportPrint the CA certificate in PEM (never the key) and its SHA-256 fingerprint; --outTraffic recorder
rustman record ca installTrust the CA in this machine’s trust store after a typed yes (or --yes); declining exits 1Traffic recorder
rustman record ca uninstallRemove the CA from every trust store Rustman installed it inTraffic recorder
rustman record ca rotateUninstall and delete the CA, create a new one and print both fingerprints; --yesTraffic recorder
rustman record ca removeUninstall the CA, then delete its key from the keychain and its certificate, after a typed yes (or --yes); declining exits 1Traffic recorder
rustman viz <report.json>Open a run, exploration or bench report in the graphical viz companion rustman-viz; --view graph opens the API graph of an explorationbelow
rustman mock serve <openapi>Serve an OpenAPI document as a local mock server until Ctrl+C; --host, --port, --allow-remote, --allow-remote-refs, --seed, --no-prefer, --no-validate, --enforce-security, --stateful, --env, --workspace, --cors, --no-cors, --jsonl, --history, --proxy-unmatched, --recordMock server
rustman contract diff <old> <new>Compare two OpenAPI 3.0/3.1 documents (files or URLs) and classify every difference as breaking, non-breaking or unknown with a rule id and JSON pointers into both documents; exits 1 on an unallowlisted breaking difference, 2 on an invalid document or allowlist; --base <ref> (old document from Git), --fail-on-unknown, --fail-on, --allowlist, --report, --env, --workspaceContract testing, Contract rules
rustman contract rulesList the rule catalog with its version; --json prints a JSON array (id, classification, description, example, catalog_version)Contract rules
rustman contract pact generate [<collection>...]Write a Pact v4 (or --pact-version 3) file from a collection’s http requests and assertions, to contracts/pacts/<consumer>-<provider>.json (or --output); secrets and dynamic values become regex matchers with «redacted:...» examples; assertions without a Pact equivalent warn; --consumer, --provider, --env, --workspaceContract testing
rustman contract pact verify <pact-file>...Replay Pact interactions against --provider-url through the safety policy, with provider states POSTed to --provider-states-url; exits 1 on a mismatch, 2 for stateful interactions without a state URL, 4 when an interaction is blocked (--allow-mutations, --allow-destructive) or the provider is an unconfirmed production host (--production <host>); --report, --env, --workspaceContract testing
rustman contract verify --spec <openapi>Check recorded exchanges (history with --since, --grep, --limit, or --from <run-report>) against a local OpenAPI document (URLs are refused) without sending anything: violations, undocumented exchanges and the operations observed (5/12 operations observed); exits 1 on a violation (or an undocumented exchange with --fail-on-undocumented); --report, --env, --workspaceContract testing
rustman docs buildGenerate a static, self-contained HTML site (--format html|markdown|both, default html) from the workspace (--workspace) into --out (default site/): one section per collection, one page per request, client-side search, dark and light themes, deterministic output; redacted examples for opted-in requests (--examples history|snapshot), published variables with --env; refuses a non-empty folder it did not generate unless --force; exits 1 when the leak scan finds a secret in an output fileAPI docs
rustman docs servePreview the docs on 127.0.0.1 only (--port, default 4000; --env, --examples): builds into a temporary folder, rebuilds 200 ms after a workspace change and reloads open pages; build errors appear on stderr and in a page overlay without stopping it; exits 2 when the port is takenAPI docs
rustman plugin add <path|url>Fetch a plugin from a folder or .wasm file inside the workspace or an https URL (TLS verified, 20 MiB, the workspace ca_bundle trusted), print its manifest and requested capabilities, pin its sha256 and declare it in rustman.toml with grants = [], update rustman.lock; --name, --workspace; exits 2 on http://, a manifest or component error, or a name already declaredPlugins
rustman plugin listList the declared plugins (name, version, API, source, grants) and whether this machine trusts their set; --workspacePlugins
rustman plugin remove <name>Remove a plugin’s table from rustman.toml and its rustman.lock entry; --workspacePlugins
rustman plugin verifyRe-hash every plugin against its pin (downloading URL sources not cached yet), check manifests and grants and bring rustman.lock in line; exits 0, or 2 on a mismatch; --workspacePlugins
rustman plugin apiPrint the plugin API package version and the API majors this build supportsPlugins
rustman plugin test [path]Run a plugin’s test cases (rustman-plugin-tests.toml, or --cases <file>) in the sandbox with a fake clock, randomness, environment, network and secrets; prints each case’s output (redacted), exits 0 when every case passes, 1 on a failure, 2 when the plugin or cases cannot be readPlugins
rustman plugin new <name> --kind <extension point>Scaffold a no_std Rust plugin project for auth, assertion, generator, transformer, importer, kind or report: manifest, sample, test cases and a cargo build --target wasm32-wasip2 recipe; --dir, --sdk <path> (build against a local rustman-plugin-sdk)Plugins

The command groups rustman env, rustman secret, rustman cookies, rustman auth, rustman import, rustman export, rustman explore, rustman report, rustman graphql, rustman rpc, rustman evm, rustman grpc, rustman ws, rustman sse, rustman kafka, rustman mqtt, rustman amqp, rustman history, rustman mcp, rustman mcp-client, rustman mock, rustman snapshot, rustman trace, rustman webhook, rustman contract, rustman contract pact, rustman docs, rustman plugin and rustman record ca only hold the commands above: on their own they print their subcommands and exit with 2. rustman import also takes a source file or folder directly (rustman import export.json), which is the same as rustman import auto export.json.

rustman --help and rustman <command> --help document every flag; rustman --version prints rustman <version>, such as rustman 0.1.0.

Global flags

These work before or after the command name (rustman -v run . or rustman run . -v):

FlagEffect
--color <auto|always|never>auto (the default) colors stdout only when it is a terminal, NO_COLOR is unset or empty and TERM is not dumb. always forces color, even when piped; never turns it off.
-v, -vv, -vvvLogs on stderr: -v one line per request, -vv also the redacted request and response headers, -vvv everything, including the HTTP and TLS libraries.

rustman send

rustman send <REQUEST> [--env <name>] [--var k=v]... [--timeout <duration>] [--insecure] [--body-only | -o <file>] [--show-secrets]
             [-u | --update-snapshots] [--ci] [--trust-plugins]
rustman send <METHOD> <URL> [-H 'K: V']... [-d <body> | --json <body>] [same flags]
rustman send <URL>                                    # an ad-hoc GET

<REQUEST> is a request file (relative to the current directory), its id (the path from the workspace root without .rman.yaml, such as users/get-user) or its name. A name shared by several requests fails with exit code 2:

error: request name 'List' is ambiguous: a/list.rman.yaml, b/list.rman.yaml

By default the status line, the headers and the body are printed:

HTTP/1.1 200
content-type: application/json
x-request-id: req-1

{"id":42,"name":"Ana","email":"ana@example.com","roles":["admin","dev"],"address":{"city":"Lisbon"}}

Headers and bodies are shown redacted: Authorization, Proxy-Authorization, Cookie and Set-Cookie, every secret the request references and every captured value that became a secret. A large body is streamed from its spill file, and a binary body (one that is not valid UTF-8) is redacted byte by byte. --show-secrets prints the headers and body as received instead, on the terminal only: history still stores them redacted. --body-only prints only the response body, redacted the same way (as received with --show-secrets). -o <file> writes the decoded body to a file, always byte for byte; use it to save an image or other binary body exactly:

rustman send get-user --env staging --body-only | jq .id
rustman send logo --env staging -o logo.png

The request’s assertions and captures run as in rustman run. Failed assertions are listed on stderr (fail: status: expected 200, got 404) and the exit code is 1; a request that gets no response prints error: <reason> and exits with 3. When the request carried trace context, stderr also shows trace: <trace id>, trace: backend <id> when the server’s traceresponse names another trace, and trace: <link> when a link template is configured. Snapshot assertions are recorded, compared and updated as in rustman run, with the same --update-snapshots (-u) and --ci flags and the same CI variable; a recorded or updated snapshot is noted on stderr (snapshot default recorded: users/__snapshots__/get-user.default.snap.yaml).

Ad-hoc requests

rustman send <METHOD> <URL> sends a request that has no file. -H adds a header (repeatable), -d / --data sends a body as is and --json sends a JSON body with Content-Type and Accept set to application/json. The flags mean what they mean for curl, and the request is built the same way rustman import curl builds one.

No workspace is needed. Outside a workspace, the request is sent with the default settings, its cookies last for the command only and nothing is written to the current folder; --env, secrets and other environment features need a workspace:

rustman send GET https://httpbin.org/get
rustman send POST https://api.example.com/users -H 'X-Team: core' --json '{"name":"Ana"}'

Inside a workspace, an ad-hoc request uses the workspace settings and the active environment, so {{base_url}} and secrets resolve. A URL that starts with a variable is an ad-hoc URL too; http:// is not added to it, the variable brings the scheme:

rustman send '{{base_url}}/users/42' --env dev
rustman send DELETE '{{base_url}}/users/42?key={{api_token}}' --env dev

rustman run

rustman run [<PATH>...] [--env <name>] [--var k=v]... [--timeout <duration>] [--insecure]
            [--bail[=iteration]] [--filter <tag:name | glob>]... [--iterations <n>] [--parallel <n>]
            [--data <file> | --no-data] [--data-label <column>] [--secret-columns <a,b>]
            [--reporter <format>[:<path>]]... [--report <format>[=<path>]]...
            [--max-events <n>] [--duration <duration>] [-u | --update-snapshots] [--ci]
            [--trust] [--trust-plugins] [--viz] [--sign [--yes-local]]

Runs every request file (kind: http, kind: graphql and kind: mcp) under the given files and folders (default: the current folder), in collection order: file-name order, or the folder’s _collection.yaml order: (see collections). Paths must exist and lie inside the workspace. Values captured by one request are available to every later request of the run.

FlagEffect
--env <name>The active environment (default: RUSTMAN_ENV, then default_environment).
--var k=vA variable above every other source (repeatable).
--timeout <duration>The total timeout of every request, replacing timeout_ms: 500ms, 5s, 2m, or a number of milliseconds. Also on send.
--insecure, -kNo TLS certificate verification; exchanges are flagged insecure: true. Also on send.
--no-historyDo not record the exchanges in history. Also on send.
--traceSend trace context headers (traceparent) even when no trace: block enables them. Also on send, ws connect and sse listen.
--bailAfter the first failed or errored request, the requests not started yet are reported as skipped (bail). --bail=iteration skips only the rest of the failing iteration and goes on with the next one.
--filter <value>Keep only matching requests (repeatable; a request matching any filter runs). tag:<name> matches the request’s tags; anything else is a glob over the request id or file path, where * and ? stay within one folder and ** crosses folders: users/*, **/login.
--iterations <n>Run the selected requests n times (default 1). Captures carry over between iterations. Cannot be combined with --data.
--data <file>Run the selected requests once per row of a CSV or JSON file, with the row’s values as variables; see data-driven runs. --no-data ignores the data file a _collection.yaml names.
--data-label <column>Label each iteration of a data-driven run with this column’s value (default row <n>).
--secret-columns <a,b>Data columns whose values are secrets, redacted in every output.
--parallel <n>Run up to n folders at once (default 1).
--reporter <format>[:<path>]pretty, json, junit or tap, written to stdout or to <path> (repeatable; default pretty on stdout). At most one reporter may write to stdout. A file is replaced atomically, a symlink is followed, and a device such as /dev/stdout is written in place. A report plugin’s <plugin>/<format>:<path> writes the bytes the plugin returns to <path>.
--report <format>[=<path>]Also render the canonical report as json, junit, markdown, html or sarif (repeatable), to <path> or stdout; see Reports. With a --report on stdout and no --reporter, the pretty report is not printed. At most one reporter or report may write to stdout.
--max-events <n>GraphQL and JSON-RPC subscriptions stop after n events, replacing each request’s max_events (default 10).
--duration <duration>GraphQL and JSON-RPC subscriptions stop after this long, replacing each request’s duration or max_duration_ms (default 30s).
--update-snapshots, -uOverwrite snapshots that differ from the response and report them updated; matching files are left untouched.
--ciCI mode: never write snapshots, and fail a request whose snapshot is missing. Also on when the CI environment variable is true or 1. Combined with --update-snapshots it is a usage error (exit code 2): --update-snapshots cannot be used in CI mode.
--trustSpawn the workspace’s stdio MCP servers that are not trusted yet, and record the approvals; without it, kind: mcp requests to an untrusted server error.
--trust-pluginsLoad the workspace plugins even when this machine has not trusted their set yet, and record the approval. Without it, an untrusted set stops the run with exit code 2 before any request is sent. Also on send, bench, history replay, import <format> and report render.
--vizShow the run live in the viz companion. Without one, the run continues without visuals and its exit code is unchanged.
--signSign and send the run’s kind: evm-tx requests through the signing gate, one at a time with in-run nonces; without it they are reported as skipped (signing not requested). A gate refusal makes the run exit with code 4.
--yes-localWith --sign: confirm evm-tx requests without a prompt on chain 31337 and [evm] headless_signing_chains only.

A filter or path that selects no request fails with error: no requests to run (check the paths and --filter) (exit code 2).

rustman run api/users --env staging
rustman run . --env ci --filter tag:smoke --bail
rustman run . --env ci --parallel 4 --reporter json:out/report.json --reporter pretty

Parallel folders

With --parallel <n>, each folder is a unit of sequential work and up to n units run at once, so the requests of one folder still run in order and their captures chain. A folder whose _collection.yaml sets parallel: true runs its requests concurrently instead, still up to n at once; with the default --parallel 1 it runs them in order like any other folder. Reports always list requests in collection order, whatever order they finished in.

# load/_collection.yaml
parallel: true

Reporters

pretty prints one line per request, the reasons below each request that did not pass, and a summary:

PASS  users/list  GET 200  12 ms
FAIL  users/create  POST 404  8 ms
      status: expected 201, got 404
ERROR users/slow
      timeout after 500 ms (response)
SKIP  users/delete  skipped (bail)

4 requests: 1 passed, 1 failed, 1 errored, 1 skipped (35 ms)

json writes a rustman.report/v1 document with "kind": "run", described by the JSON Schema in schemas/report.schema.json. It holds every request (with its redacted exchange, timings, assertion results and capture results) and summary.total, summary.passed, summary.failed, summary.errored, summary.skipped, summary.duration_ms and summary.interrupted. A request is passed when every assertion passed and every required capture matched, failed when an assertion failed or could not be evaluated or a required capture matched nothing, errored when no response arrived (unresolved variables, network, TLS, timeout, auth) and skipped with a skip_reason: bail, interrupted, or unsupported_kind for request kinds this build cannot send. Report files are replaced atomically.

A data-driven or repeated run (--data, or --iterations above 1) groups the pretty report under one iteration <i>/<n> line per iteration, adds [<label>] to JUnit test case names and TAP descriptions. Every JSON request has the 1-based integer iteration; with --data only, it also gets a data_row object (index, total, label); see iteration labels. A kind: jsonrpc request also gets a jsonrpc object with its envelopes, attempts and subscription events; see JSON-RPC in rustman run. A kind: grpc request gets a grpc object with its exchange (protocol: grpc, status, metadata, messages, timeline, timings); see gRPC in rustman run. A kind: evm-call request gets an evm object with the endpoint’s chain and client, the decoded outputs or revert and the gas estimate; see EVM in rustman run.

junit writes JUnit XML for CI systems: one <testsuite name="rustman"> with one <testcase> per request (named by its id, with classname set to its file). A failed request gets a <failure>, an errored one an <error> and a skipped one <skipped>; their message is the first reason, and the element text lists them all:

rustman run . --env ci --reporter junit:out/junit.xml --reporter pretty
<testcase name="users/create" classname="users/create.rman.yaml" assertions="1" time="0.008">
    <failure message="status: expected 201, got 404">status: expected 201, got 404</failure>
</testcase>

tap writes a TAP version 14 stream: one test point per request, # SKIP <reason> for skipped requests, and a YAML block with the reasons under each request that failed or errored. An interrupted run ends with Bail out!.

TAP version 14
1..2
ok 1 - users/list
not ok 2 - users/create
  ---
  status: failed
  file: "users/create.rman.yaml"
  reasons:
    - "status: expected 201, got 404"
  ...

Every reporter writes from the same redacted records: secret values and sensitive headers appear as «redacted:<name>» in all of them.

Runs with snapshot assertions add a summary line such as 1 snapshot recorded, 1 snapshot failed to pretty, a snapshot object to each snapshot assertion and summary.snapshots to json, the diff to the JUnit failure message, and # comments to tap.

Viz companion

rustman-viz is an optional graphical companion that draws runs, explorations and large responses as charts, tables and graphs. It is a separate program: rustman builds, installs and runs without it, and never needs a GPU. rustman talks to it over the viz protocol. Its views and how to install it are in viz.md.

rustman viz <REPORT> [--view dashboard|graph]
rustman run [<PATH>...] --viz
rustman explore run --spec <file|url> --target <url> --viz
rustman explore resume <id> --viz
  • rustman viz <REPORT> opens a saved JSON report (from rustman run --reporter json:<file>, rustman explore run or rustman bench --report json=<file>) in the run, exploration or bench dashboard, chosen from the report’s kind. --view graph opens the API graph of an exploration report instead. A file that is not a Rustman report exits with 2: error: notes.txt is not a Rustman report. Contract and stress reports have no view in the companion and also exit with 2, with a hint to render them as HTML; so does a bench report when the companion is too old to have the bench view.
  • --viz opens the matching dashboard and streams progress to it as requests or probes finish. The data is redacted before it is sent: secrets appear as «redacted:name», and the companion has no way to reveal them.

rustman finds the companion in this order:

  1. RUSTMAN_VIZ, the path of the executable. When it is set but does not name an executable file, rustman reports that path and looks nowhere else.
  2. rustman-viz (rustman-viz.exe on Windows) on PATH.
  3. rustman-viz next to the running rustman executable.

The first match is started once with --protocol-check to confirm that it speaks rustman-viz/1. Its stderr is appended to .rustman/viz.log in the workspace.

When the companion cannot be used, --viz prints the reason as a warning and the command carries on. Its exit code depends only on the run or exploration. rustman viz prints the same reasons as an error and exits with 2. Either way, the message suggests an HTML report instead.

ConditionMessage
Not foundViz companion not found; continuing without visuals (...)
Another protocol versionViz companion speaks rustman-viz/2, rustman needs rustman-viz/1; upgrade rustman-viz
No graphics (no Vulkan driver on Linux or Windows; a VM or remote session)Graphics unavailable (Vulkan); continuing without visuals
Exits or crashes during a runViz companion exited; continuing without visuals
Stops reading for 5 secondsViz companion stopped reading for 5 s; detached from it, continuing without visuals

Sending to the companion never slows a run down. When it falls behind, progress updates are dropped, but findings and the final summary are always kept. After 5 seconds of back-pressure, rustman stops sending to it.

Exit codes

CodeMeaning
0Every executed request passed.
1At least one request failed (an assertion, or a required capture) and none errored; for rustman bench, a threshold failed; for rustman stress, a finding at or above --fail-on, or --require-rps not reached.
2Usage or configuration error: a bad flag, no workspace, an invalid file, a missing environment, an ambiguous request name, no request to run.
3At least one request errored: network, TLS, timeout, auth or unresolved variable. It wins over 1.
4Refused by the safety policy (rustman explore, rustman bench, rustman stress), the stress gate or the monitor policy.
130Interrupted by Ctrl+C (SIGINT), or on Unix by SIGTERM or SIGHUP, handled the same way.

rustman import has its own: 0 when the import completed (even with unsupported features, unless --fail-on-unsupported), 1 with --fail-on-unsupported when a feature was unsupported, dropped or unmapped, and 2 for an unreadable, invalid, oversized or undetectable source (see Importing collections). rustman import openapi and rustman import asyncapi exit 0 on success, 3 when fetching the document failed, and 2 otherwise.

rustman graphql query exits 0 when the result has no errors, 1 when errors is not empty (or an assertion of the request failed), and 3 when no response came back or the document failed validation; rustman graphql introspect exits 3 when the server could not be reached or refused introspection (see GraphQL).

rustman rpc call and rpc batch exit 0 when every call returned a result, 1 when one returned a JSON-RPC error (printed on stdout) or an assertion failed, 2 when the OpenRPC catalog refuses a call, 3 when no usable answer came back, and 4 when a method guard refuses a call; rustman rpc discover exits 1 when the endpoint does not support rpc.discover (see JSON-RPC).

rustman evm commands exit 0 on success, 1 when an assertion fails or something is not found (a transaction, a block, an ENS name), 2 for a bad file, argument or ABI (and anvil not found), 3 when the node cannot be reached or answers with an error, and 4 when the call is refused (a chain mismatch, a send method, a host outside the agents’ allowlist); see EVM toolkit.

rustman grpc call exits 0 when the call passed (status OK without assertions), 1 for another status or a failed assertion, 2 when the call cannot be sent as written (no schema, unknown method or field, invalid metadata), and 3 when no status came back or the deadline expired. rustman grpc health exits 0 for SERVING, 1 for NOT_SERVING, SERVICE_UNKNOWN or UNKNOWN, and 3 when the check fails (UNIMPLEMENTED included); see gRPC.

rustman docs build exits 0 when the site was written, 1 when the post-build leak scan found a secret value in an output file (the file is removed), and 2 for a usage or configuration error: a non-empty --out folder without .rustman-docs-manifest (without --force), a secret in [docs].publish_variables, an unknown --env, an invalid template (see API docs). rustman docs serve exits 0 when stopped with Ctrl+C (or on Unix SIGTERM or SIGHUP), and 2 when it cannot start: the port is already taken or cannot be bound, or no workspace is found. It never exits 1: a failed build (including the leak scan, an unknown --env or an invalid [docs] setting) is printed on stderr and shown in a page overlay, and the server keeps serving the last good build (see API docs).

rustman ws connect and rustman sse listen exit 0 when the session ended normally (its steps done, a bound reached, or closed by the server), 1 when an assertion of the request failed, 3 when the session failed (a refused handshake such as ws: handshake failed: 401 Unauthorized, a transport error, a wait_for timeout, an oversized message) and 130 on Ctrl+C (see WebSocket and SSE).

rustman kafka, rustman mqtt and rustman amqp produce and consume exit 0 when the operation passed (a consume that reached its bounds, even with no message), 1 when an assertion of the request failed, 3 when it failed (an unreachable broker, kafka: unknown topic '<name>', amqp: unroutable, a failed login), 4 when the safety policy refused it, and 130 on Ctrl+C (see Messaging).

rustman explore run and explore resume exit 1 when a finding is at or above --fail-on (default high) instead of on failed requests, and 0 otherwise; see Exploration. rustman report diff exits 1 when a new finding is at or above --fail-on (default high), and report render and report diff exit 2 on a report with an unknown major schema version; see Reports.

On Ctrl+C (and on Unix SIGTERM or SIGHUP), in-flight requests are cancelled, stdio MCP servers are stopped with the processes they started, the requests not finished are reported as skipped with skip_reason: interrupted, every reporter writes its partial report (with summary.interrupted: true), and the exit code is 130. A second Ctrl+C quits at once, also with exit code 130, without waiting for reports to be written (stdio MCP servers still running are killed first).

Terminal output and logs

Reports and response bodies go to stdout; logs, warnings, errors and Ctrl+C notices go to stderr, so rustman run . --reporter json -vv > report.json leaves a valid JSON document in report.json and the logs on the terminal.

The pretty report is colored only when stdout is a terminal and color is not turned off (--color never, a non-empty NO_COLOR, or TERM=dumb); --color always forces it. Piped or redirected output has no ANSI escapes and no carriage-return progress lines. Reports written to a file (--reporter pretty:out/run.txt) are never colored.

Logs are off unless -v or RUST_LOG is given. RUST_LOG takes tracing filter directives and replaces the -v levels: RUST_LOG=rustman_http=debug shows the requests and headers, RUST_LOG=trace everything. Log lines carry only redacted text, and every line is scanned once more for the secret values the run resolved before it reaches stderr.

$ rustman run users -vv --reporter json > report.json
2026-11-17T09:30:00.101Z DEBUG rustman_http::runner::execute: sending request=users/list iteration=1
2026-11-17T09:30:00.113Z  INFO rustman_http::runner::execute: GET http://localhost:8080/users -> 200 (12 ms) request=users/list status=Passed
2026-11-17T09:30:00.113Z DEBUG rustman_http::runner::execute: > Authorization: «redacted:Authorization» request=users/list
2026-11-17T09:30:00.113Z DEBUG rustman_http::runner::execute: < content-type: application/json request=users/list

Completions

rustman completions <shell> prints a completion script for bash, zsh, fish, powershell or elvish on stdout:

rustman completions bash > ~/.local/share/bash-completion/completions/rustman
rustman completions zsh > "${fpath[1]}/_rustman"
rustman completions fish > ~/.config/fish/completions/rustman.fish
rustman completions powershell >> $PROFILE

OAuth2 without a terminal

When stdin is not a terminal (as in CI), send and run never open a browser: a request whose authorization_code token is not cached fails with oauth2: interactive login required (run 'rustman auth login <request>'). See OAuth2.

Request files

A Rustman workspace is a folder with a rustman.toml file. Every saved request is one YAML file named *.rman.yaml, and folders group requests into collections. Everything is plain text, meant to be reviewed and versioned in Git.

Every YAML example on this page is loaded by a test (crates/rustman-core/tests/docs.rs): the examples are written into a temporary workspace at the path in their first-line comment, and the workspace must load. The examples are also in the exact form Rustman writes, so saving them produces no diff.

Workspace layout

shop/
├── rustman.toml              workspace marker and settings
├── environments/             one file per environment (see environments.md)
│   └── local.yaml
├── users/                    a collection
│   ├── _collection.yaml      optional: order, parallel, inherited headers, auth and variables
│   ├── login.rman.yaml
│   └── get-user.rman.yaml
└── .rustman/                 per-user state (history, secrets): git-ignored

rustman init [dir] creates rustman.toml, environments/local.yaml, a sample examples/ping.rman.yaml, and adds .rustman/ to .gitignore (appending to an existing file). rustman init --bare creates only rustman.toml and the .gitignore entry. Running it where rustman.toml already exists fails with error: <dir> is already a rustman workspace (exit code 2) and changes nothing.

Commands find the workspace by looking for rustman.toml in the current directory and then in each parent directory. --workspace <dir> overrides the search. Without a workspace, commands that need one fail with error: no rustman workspace found (run 'rustman init') (exit code 2).

rustman.toml

# rustman.toml
[workspace]
name = "shop"
version = 1

[defaults]
timeout_ms = 30000          # total request timeout
follow_redirects = true
max_redirects = 10
verify_tls = true
default_environment = "local"

[http]
ca_bundle = "certs/dev-ca.pem"   # extra trusted CAs (PEM), relative to the workspace root
proxy = "http://127.0.0.1:3128"
max_body_bytes = 10485760         # larger response bodies are spilled to disk
max_download_bytes = 1073741824   # an undecoded response body larger than this fails
client_cert = "certs/client.pem" # mutual TLS for requests without their own client certificate
client_key = "certs/client.key"
# or: client_pkcs12 = "certs/client.p12" with client_pkcs12_password = "{{p12_password}}"

[variables]
api_version = "v2"

Only [workspace] with name and version = 1 is required; every other key has the default shown above (default_environment, ca_bundle, proxy and the client certificate keys are unset by default). The [http] client certificate (client_cert and client_key, or client_pkcs12 and client_pkcs12_password) applies to every request that sets none of its own. The optional [safety] table (allowed_hosts, production_hosts, rate, concurrency) configures the safety policy for automated senders. Optional [[graphql.endpoints]] entries set a schema_file per GraphQL endpoint (see graphql.md), [graphql] max_schema_bytes (64 MiB by default) caps an introspection response (see graphql.md), and [explore] configures OpenAPI exploration. The optional [bench] table (max_vus, max_duration, max_rps) raises the load-testing caps. Unknown keys produce a warning, not an error (except in [safety], where they are errors). A version newer than this build supports fails with error: rustman.toml version 2 is newer than this rustman supports (1).

Common fields

Every request file has these fields, in this order:

FieldRequiredMeaning
versionyesAlways 1.
kindyesThe request kind: http, graphql, jsonrpc, grpc, mcp, ws, sse, evm-call or evm-tx.
nameyesThe name shown in reports and used by rustman send <name>.
descriptionnoFree text.
tagsnoA list of strings.
docsnoHow rustman docs shows the request: example: true publishes its latest recorded exchange (redacted), hidden: true leaves it out of the site, description adds Markdown to its page (see API docs).
variablesnoRequest-level variables (see environments.md for precedence).
assertionsnoChecks on the response (see assertions.md).
capturesnoValues extracted from the response for later requests.

graphql files have their own fields (see GraphQL requests); their variables are GraphQL variables sent with the operation, not a layer of Rustman variables. jsonrpc, mcp and grpc files have their own fields too (see their sections below), and rustman run runs them alongside http and graphql requests. evm-call and evm-tx files are described in EVM toolkit. A kind this build does not know is reported as skipped with request kind '<kind>' is not supported by this build.

HTTP requests

A minimal HTTP request:

# users/get-user.rman.yaml
version: 1
kind: http
name: Get user
method: GET
url: '{{base_url}}/users/1'

The kind: http fields, in the order Rustman writes them:

FieldMeaning
methodAny RFC 9110 token, so custom methods such as PURGE work. Defaults to GET. GET USERS is rejected with invalid HTTP method 'GET USERS'.
urlThe request URL. {{variables}} are resolved at send time.
queryAn ordered list of name/value pairs. Names may repeat.
headersAn ordered list of name/value pairs.
bodyOne of the body types below.
authnone, basic, bearer, api_key, oauth2, digest, aws_sigv4, jwt or plugin (auth plugins).
settingsPer-request overrides for timeouts, redirects, TLS and transport.
transform{request: [...], response: [...]}: plugin transformers (<plugin>/<name>) the request goes through before auth, and the response before assertions and captures.

Header and query order is kept when the request is sent:

# cache/purge.rman.yaml
version: 1
kind: http
name: Purge tagged pages
method: PURGE
url: '{{base_url}}/path'
query:
  - name: tag
    value: a
  - name: tag
    value: b
headers:
  - name: X-Purge-Key
    value: '{{purge_key}}'

This is sent as PURGE /path?tag=a&tag=b.

A query, headers or form fields row with enabled: false stays in the file but is not sent, and a disabled header does not replace a header inherited from a collection. The TUI’s per-row toggle writes it; the key is left out for enabled rows.

Body types

Every body has a type. File paths are resolved relative to the request file and must stay inside the workspace (see File paths).

json

content is a YAML value converted to JSON, so {name: Ana, age: 3} is sent as {"name":"Ana","age":3} with Content-Type: application/json. Only true and false are booleans and numbers with a leading zero stay strings, so no, on and 0755 are sent as the strings "no", "on" and "0755". Other numbers follow YAML 1.2, which JSON writes in decimal: 0x1F, 0o17 and +12 are sent as 31, 15 and 12. An integer too large for 64 bits can’t be sent exactly, so it is a load error; quote it, or use a string content (below).

# users/create-user.rman.yaml
version: 1
kind: http
name: Create user
method: POST
url: '{{base_url}}/users'
body:
  type: json
  content:
    name: Ana
    age: 3
    roles:
      - admin
    active: true

A string content is sent as is, which is useful for JSON that YAML can’t express directly:

# users/create-raw.rman.yaml
version: 1
kind: http
name: Create user from raw JSON
method: POST
url: '{{base_url}}/users'
body:
  type: json
  content: '{"name":"Ana","age":3}'

text

Sent with Content-Type: text/plain; charset=utf-8. A literal {{ is written as \{{.

# notes/create-note.rman.yaml
version: 1
kind: http
name: Create note
method: POST
url: '{{base_url}}/notes'
body:
  type: text
  content: |
    Shopping list for {{user_name}}
    Template syntax looks like \{{this}}

form

URL-encoded fields (application/x-www-form-urlencoded), in order:

# auth/login-form.rman.yaml
version: 1
kind: http
name: Log in with a form
method: POST
url: '{{base_url}}/login'
body:
  type: form
  fields:
    - name: user
      value: ana
    - name: password
      value: '{{password}}'

multipart

Each part has a name and either a text value or a file. A file part is sent with its file name (a.png) and a content type guessed from the extension (image/png), unless content_type is set.

# users/upload-avatar.rman.yaml
version: 1
kind: http
name: Upload avatar
method: POST
url: '{{base_url}}/users/1/avatar'
body:
  type: multipart
  parts:
    - name: caption
      value: Profile picture
    - name: avatar
      file: ./fixtures/a.png
    - name: metadata
      file: ./fixtures/meta.json
      content_type: application/json

file

The raw bytes of a workspace file, sent with Content-Type: application/octet-stream unless a header overrides it.

# blobs/put-blob.rman.yaml
version: 1
kind: http
name: Upload blob
method: PUT
url: '{{base_url}}/blobs/1'
headers:
  - name: Content-Type
    value: application/pdf
body:
  type: file
  path: ../fixtures/report.pdf

none

No body. This is the same as leaving body out, but makes the intent explicit.

# users/delete-user.rman.yaml
version: 1
kind: http
name: Delete user
method: DELETE
url: '{{base_url}}/users/{{user_id}}'
body:
  type: none

Auth

# auth/basic.rman.yaml
version: 1
kind: http
name: Basic auth
url: '{{base_url}}/me'
auth:
  type: basic
  username: ana
  password: '{{password}}'

The other types:

  • {type: bearer, token} sends Authorization: Bearer <token>.
  • {type: api_key, name, value, in} sends the key as a header (in: header, the default) or a query parameter (in: query).
  • {type: oauth2, grant, token_url, client_id, ...} with grant: client_credentials or grant: authorization_code (which also needs auth_url). Optional: client_secret, scopes.
  • {type: digest, username, password}, {type: aws_sigv4, region, service, ...} and {type: jwt, algorithm, ...} compute their credentials for every request; see Signature auth.
  • {type: none} sends no auth, even when the collection defines some.

Auth never replaces an explicit Authorization header.

# auth/oauth2.rman.yaml
version: 1
kind: http
name: OAuth2 client credentials
url: '{{base_url}}/me'
auth:
  type: oauth2
  grant: client_credentials
  token_url: https://auth.example.com/token
  client_id: rustman
  client_secret: '{{client_secret}}'
  scopes:
    - read

Settings

Every key is optional and overrides rustman.toml for this request:

# slow/report.rman.yaml
version: 1
kind: http
name: Slow report
url: https://reports.example.com/build
settings:
  timeout_ms: 120000
  connect_timeout_ms: 5000
  follow_redirects: false
  max_redirects: 3
  verify_tls: true
  http2_prior_knowledge: false
  proxy: none
  cookies: false
  decompress: true
  ca_bundle: ../certs/dev-ca.pem
  client_cert: ../certs/client.pem
  client_key: ../certs/client.key

proxy: none bypasses every proxy, including HTTPS_PROXY. A PKCS#12 client certificate uses client_pkcs12 plus client_pkcs12_password, which should reference a secret variable.

Assertions and captures

Each assertion is a one-key mapping naming its type. Captures extract values for later requests in the same run. assertions.md covers every operator.

# users/login.rman.yaml
version: 1
kind: http
name: Log in
method: POST
url: '{{base_url}}/login'
body:
  type: json
  content:
    user: ana
    password: '{{password}}'
assertions:
  - status: 200
  - status: '2xx'
  - header:
      name: content-type
      contains: json
  - json:
      path: $.access_token
      exists: true
  - schema:
      file: ../schemas/token.json
  - body:
      not_contains: error
  - latency:
      total_lt: 500
captures:
  - var: token
    from: json
    path: $.access_token
  - var: session
    from: cookie
    name: sid
    persist: true

GraphQL requests

A kind: graphql file names an endpoint and exactly one of document (inline) or document_file (a path relative to the request file). {{variables}} are interpolated in the endpoint, headers, auth and the string values of variables, never in the document. graphql.md lists every field.

# graphql/get-user.rman.yaml
version: 1
kind: graphql
name: User by id
endpoint: '{{base_url}}/graphql'
document: |
  query GetUser($id: ID!) {
    user(id: $id) { name email }
  }
operation_name: GetUser
variables:
  id: '{{user_id}}'
headers:
  - name: X-Client
    value: rustman

JSON-RPC requests

A kind: jsonrpc file sends JSON-RPC 2.0 to an endpoint (http, https, ws or wss; {{variables}} work). It is chain-agnostic: method names are not interpreted and results are shown exactly as received, so hex quantities stay hex. jsonrpc.md describes ids, batches, errors, retries, WebSocket and subscriptions.

FieldMeaning
methodThe method of a single call. Required unless the file has a batch (or a subscription, which defaults it to subscription.subscribe).
paramsA list (sent as a JSON array) or a map (sent as a JSON object). Left out of the envelope when absent; a scalar fails to load with params must be a list or a map. {{variables}} are interpolated in string values only.
idA string or an integer, sent unchanged. Without it, ids are sequential from 1 per connection.
notificationtrue sends no id and expects no answer. Assertions on $.result fail to load.
batch1 to 100 calls (method, params, id, notification, assertions, captures each), sent as one JSON array instead of method.
subscription{subscribe, unsubscribe, notification} method names, plus optional notification_id_path (default $.params.subscription), max_events (default 10) and max_duration_ms (default 30000). WebSocket endpoints only.
idempotenttrue allows settings.retry; calls are never retried otherwise.
headers, auth, variables, assertions, capturesAs for kind: http. Status and header assertions fail to load for ws:// and wss:// endpoints.
settingsThe kind: http settings, plus retry: {attempts, backoff_ms} (defaults 0 and 500) and validate.

Quote hex values ('0x10'): YAML reads an unquoted 0x10 as the number 16.

An Ethereum read, retried when the node rate-limits it:

# eth/block-number.rman.yaml
version: 1
kind: jsonrpc
name: Block number
endpoint: '{{rpc_url}}'
method: eth_blockNumber
idempotent: true
settings:
  timeout_ms: 5000
  retry: {attempts: 2, backoff_ms: 500}
captures:
  - {var: head, from: json, path: $.result}

A Bitcoin Core batch with Basic auth:

# btc/tip.rman.yaml
version: 1
kind: jsonrpc
name: Chain tip
endpoint: http://127.0.0.1:8332
auth:
  type: basic
  username: '{{btc_user}}'
  password: '{{btc_password}}'
batch:
  - method: getblockcount
  - method: getblockhash
    params: [800000]
  - method: getblockchaininfo
    id: info

A Solana call with named params, and an Ethereum newHeads subscription over WebSocket:

# solana/balance.rman.yaml
version: 1
kind: jsonrpc
name: Balance
endpoint: https://api.devnet.solana.com
method: getBalance
params: ['{{wallet}}', {commitment: finalized}]
# eth/new-heads.rman.yaml
version: 1
kind: jsonrpc
name: New heads
endpoint: wss://{{node_host}}/ws
params: [newHeads]
subscription:
  subscribe: eth_subscribe
  unsubscribe: eth_unsubscribe
  notification: eth_subscription
  max_events: 3
assertions:
  - json: {path: $.events, length: 3}

gRPC requests

A kind: grpc file makes one gRPC call to a target (host:port, grpc://host:port for plaintext HTTP/2, or grpcs://host:port for TLS; {{variables}} work). Message types come from server reflection unless schema names local .proto files or a descriptor set. grpc.md describes schemas, encoding, streaming, deadlines, TLS, gRPC-Web, status details and the rustman grpc commands.

FieldMeaning
methodThe fully qualified method, package.Service/Method.
messageThe request message of a unary or server-streaming call, in the proto3 JSON mapping. {{variables}} are interpolated in string values.
messagesThe request messages of a client-streaming or bidi call, sent in order before half-close. Exactly one of message or messages is allowed.
metadataAn ordered list of {name, value} pairs sent as request headers; names ending in -bin take base64.
deadline_msThe call deadline (default: [defaults] timeout_ms, else 30000).
tlsenabled, insecure, ca_bundle, client_cert, client_key, client_pkcs12, client_pkcs12_password.
transportgrpc (default) or grpc-web.
schemaprotos with import_paths, or descriptor_set; paths are relative to the request file.
streammax_messages (default 100) and duration_ms (default 30000): when rustman run stops a response stream.
variables, assertions, capturesAs for kind: http, plus the grpc_status and metadata assertions and from: metadata captures. Without assertions a call expects grpc_status: OK.

A unary call with a token in its metadata:

# grpc/get-product.rman.yaml
version: 1
kind: grpc
name: Get product
target: '{{grpc_host}}'
method: shop.v1.Catalog/GetProduct
message:
  id: p-1
metadata:
  - name: authorization
    value: 'Bearer {{token}}'
deadline_ms: 5000
assertions:
  - grpc_status: OK
  - json: {path: $.id, equals: p-1}
captures:
  - {var: product_name, from: json, path: $.name}

A server-streaming call compiled from local .proto files, stopped after 3 messages, and a client-streaming upload:

# grpc/list-products.rman.yaml
version: 1
kind: grpc
name: List products
target: grpc://localhost:50051
method: shop.v1.Catalog/ListProducts
message: {pageSize: 10}
schema:
  protos: [protos/shop/v1/catalog.proto]
  import_paths: [protos]
stream:
  max_messages: 3
assertions:
  - json: {path: $.messages, length: 3}
# grpc/upload-products.rman.yaml
version: 1
kind: grpc
name: Upload products
target: grpc://localhost:50051
method: shop.v1.Catalog/UploadProducts
messages:
  - {id: p-1, name: Mug}
  - {id: p-2, name: Plate}
assertions:
  - json: {path: $.count, equals: 2}

WebSocket and SSE requests

A kind: ws file opens a WebSocket session and a kind: sse file listens to a Server-Sent Events stream. Both record a message timeline, end on their own under rustman run, and take assertions and captures over the messages they received. realtime.md describes sessions, the timeline, reconnects and the history record.

kind: ws fields:

FieldMeaning
urlA ws:// or wss:// URL; {{variables}} work. Any other scheme fails to load with ws: url must use ws:// or wss://.
headers, auth, variables, assertions, capturesAs for kind: http. Headers and auth go into the opening handshake.
subprotocolsAn ordered list offered in Sec-WebSocket-Protocol; the server picks one.
stepsA scripted sequence, run in order (see below).
limitsmax_messages (default 50), duration_ms (default 30000), max_message_bytes (default 16777216, 16 MiB) and max_timeline (default 10000).
tlsverify, ca_bundle, client_cert, client_key, client_pkcs12 and client_pkcs12_password, as the kind: http settings of the same names (verify is verify_tls).

kind: sse fields:

FieldMeaning
urlAn http:// or https:// URL; any other scheme fails to load with sse: url must use http:// or https://.
methodGET (default) or another method, such as POST for LLM token streams.
bodyA body of any kind: http type, for POST streams.
headers, auth, variables, assertions, captures, limits, tlsAs for kind: ws. Accept: text/event-stream is sent unless the file sets Accept.
last_event_idSent as Last-Event-ID on the first connection.
reconnectmax_attempts (default 5; 0 disables reconnecting).

The headless bounds are named limits.max_messages and limits.duration_ms, next to the other limits of a session. GraphQL and JSON-RPC subscriptions keep their own top-level max_events and max_duration_ms.

A WebSocket step is a map with exactly one key:

StepMeaning
send: {text: <string>}A text frame.
send: {json: <value>}A YAML or JSON value sent compactly as a text frame: {op: subscribe} sends {"op":"subscribe"}.
send: {binary: <base64>} or send: {binary: {file: <path>}}A binary frame from base64 text, or from a file relative to the request file.
send: {ping: <base64>}A ping carrying that data; its pong is recorded with the round-trip time.
wait_for: {json: {path, equals | matches | exists}, timeout_ms} or wait_for: {regex: <pattern>, timeout_ms}Wait for a message received after the step starts that matches, up to timeout_ms (default 5000). A timeout fails the session with ws: wait_for timed out after <n> ms (<matcher>).
sleep: <ms>Wait, recording what arrives.
close: {code, reason}Close (code default 1000) and wait up to 2000 ms for the server’s close.

{{variables}} are interpolated in the string values of steps: texts, the strings of JSON frames, base64 data, file paths, wait_for paths, patterns and expected values, and close reasons.

A subscription driven by steps, checked on its first message:

# feeds/ticker.rman.yaml
version: 1
kind: ws
name: Ticker
url: wss://{{feed_host}}/v2/feed?token={{api_token}}
subprotocols:
  - v2.feed
  - v1.feed
steps:
  - send: {json: {op: subscribe, channel: ticker}}
  - wait_for: {json: {path: $.type, equals: snapshot}, timeout_ms: 3000}
limits: {max_messages: 20, duration_ms: 10000}
assertions:
  - messages: {count_gte: 3}
  - json: {path: '$.messages[0].type', equals: snapshot}
captures:
  - {var: last_price, from: json, path: '$.messages[1].price'}

A request and response over a socket, then a close:

# feeds/ping.rman.yaml
version: 1
kind: ws
name: Ping
url: ws://localhost:8080/rpc
steps:
  - send: {json: {id: 1, op: ping}}
  - wait_for: {json: {path: $.id, equals: 1}}
  - send: {binary: {file: ./fixtures/blob.bin}}
  - sleep: 100
  - close: {code: 1000, reason: done}
assertions:
  - close_code: 1000

An LLM token stream over a POST, resumed after a drop:

# llm/chat-stream.rman.yaml
version: 1
kind: sse
name: Chat stream
method: POST
url: https://{{llm_host}}/v1/chat/completions
auth:
  type: bearer
  token: '{{llm_token}}'
body:
  type: json
  content:
    stream: true
    messages:
      - {role: user, content: Hello}
reconnect: {max_attempts: 2}
limits: {max_messages: 200, duration_ms: 60000}
assertions:
  - messages: {count_gte: 1}
  - latency: {ttfb_lt: 5000}

Messaging requests

A kind: kafka, kind: mqtt or kind: amqp file is one broker operation: operation: produce sends messages, operation: consume reads them. A missing or other operation fails to load with messaging: operation must be produce or consume. messaging.md describes every field, message payloads, the Kafka client, security and the Schema Registry.

Collections

Every folder under the workspace root is a collection, except environments/, folders whose name starts with . or _ (such as .rustman/, __snapshots__/ or _removed/), and folders with no request file at any depth (such as mocks/). Symlinked folders are not followed.

Requests run in file-name order unless the folder has a _collection.yaml with order:. Entries named there (request file names without .rman.yaml, or sub-folder names) run first, in that order, and the rest follow by file name. An order: entry that matches nothing produces a warning.

A _collection.yaml may also set name, description, parallel: true (under rustman run --parallel <n>, the folder’s requests run concurrently instead of one after another; see the CLI reference), data and secret_columns (the folder’s default data file for rustman run, and its secret columns), and headers, auth and variables that the requests inside inherit. A request’s own value wins. A header set closer to the request replaces every header with the same name (case-insensitive) set further up.

# users/_collection.yaml
name: Users
description: User management endpoints
order:
  - login
  - get-user
headers:
  - name: X-Team
    value: core
auth:
  type: bearer
  token: '{{token}}'
variables:
  page_size: 50

With this file, users/get-user.rman.yaml above is sent with X-Team: core and the bearer token, while a request with auth: {type: none} is sent without Authorization.

A collection created by rustman import openapi also records its source (format, location and the sha256 of the document), which --sync uses; see OpenAPI import.

File paths

Paths in body.path, multipart file, settings.ca_bundle, settings.client_cert, settings.client_key, settings.client_pkcs12 and schema file are relative to the request file. The [http] file paths in rustman.toml (ca_bundle, client_cert, client_key, client_pkcs12) are relative to the workspace root. A path that leaves the workspace, through .., an absolute path or a symlink, fails to load:

users/upload.rman.yaml:9: file path escapes workspace: ../../etc/passwd

Paths containing {{variables}} are checked after the variables are resolved, before anything is sent, with the same error (any secret value in the path is redacted from it). rustman.toml values are not interpolated, so {{ there is literal, except [http] client_pkcs12_password, which is resolved with the request’s variables so that it can reference a secret.

Errors

Load errors name the file and line, and Rustman reports every broken file at once:

legacy/soap.rman.yaml:2: unknown request kind 'soap' (expected one of: http, graphql, jsonrpc, grpc, mcp, ws, sse, kafka, mqtt, amqp, evm-call, evm-tx)
users/list.rman.yaml:5: unknown field `header`, expected one of version, kind, name, description, tags, docs, method, url, query, headers, body, auth, settings, transform, variables, assertions, captures

Unknown fields, duplicate keys, wrong types, bad indentation and unclosed quotes are all errors with exact positions. Rustman never guesses what a misspelled key meant.

Stable serialization

When Rustman writes a request file (save or import), keys follow the order in the tables above, indentation is 2 spaces, the file ends with a newline, and strings are quoted only when YAML needs it (for example '{{base_url}}/users', '2xx' or 'no'). Loading and saving a file that Rustman wrote produces no diff. Comments in a hand-edited file aren’t preserved when Rustman rewrites it.

Environments, variables and secrets

An environment is a named set of variables, such as local, staging or prod. Request files refer to variables as {{name}}, and Rustman fills them in when a request is sent. Some variables are secrets: their values never live in workspace files. They’re stored in your OS keychain (or a private, git-ignored file) and redacted everywhere they could leak.

The examples on this page are checked by an integration test (crates/rustman-cli/tests/docs_environments.rs): the files below make up one workspace, every $ rustman command runs against it in order with the output shown, and the error messages shown are the ones Rustman produces. Only the interactive prompt and the CI configuration snippet are not run.

Environment files

Each file environments/<name>.yaml defines one environment. The name is the file stem and must match [A-Za-z0-9_-]+; a file such as environments/my env.yaml is skipped with warning: ignoring environment 'my env': invalid name. A symlinked file is followed when its target is inside the workspace; one that resolves outside it is skipped with warning: ignoring environment '<name>': resolves outside the workspace. A dangling symlink (or a folder named <name>.yaml) is skipped with warning: ignoring environment '<name>': not a readable file.

# environments/local.yaml
variables:
  base_url: http://localhost:8080
  page_size: 50
  verbose: true

variables holds string, number or boolean values. Only true and false are booleans, and a number with a leading zero stays text, so 0755 and no are kept exactly as written. An integer too large for 64 bits can’t be used exactly, so it is a load error; quote it to keep it as text.

secrets lists variables whose values are stored outside the workspace. A secret must not also have a value under variables.

# environments/prod.yaml
variables:
  base_url: https://api.example.com
  page_size: 100
secrets:
  - api_token
production: true

An environment may also set chain_id: <integer> to pin the EVM chain its endpoints must report; see EVM toolkit.

production: true marks an environment as production for the safety policy: automated senders such as OpenAPI exploration refuse to target it unless the host is confirmed, and never send destructive requests to it. Environments named prod or production are treated as production even without the key. It defaults to false.

# environments/ci.yaml
variables:
  base_url: http://127.0.0.1:9000
  page_size: 10
secrets:
  - api_token

Workspace-wide defaults go in rustman.toml:

# rustman.toml
[workspace]
name = "shop"
version = 1

[defaults]
default_environment = "local"

[variables]
api_version = "v1"

A request uses variables anywhere a value is written:

# users/me.rman.yaml
version: 1
kind: http
name: Me
method: GET
url: '{{base_url}}/{{api_version}}/me'
query:
  - name: limit
    value: '{{page_size}}'
headers:
  - name: Authorization
    value: Bearer {{api_token}}

The active environment

At most one environment is active. It is chosen by, in order:

  1. --env <name>
  2. the RUSTMAN_ENV environment variable
  3. [defaults] default_environment in rustman.toml
  4. otherwise none.

rustman env list lists the environments and marks the active one with *:

$ rustman env list
  ci
* local
  prod
$ RUSTMAN_ENV=prod rustman env list
  ci
  local
* prod

Naming an environment that doesn’t exist fails with exit code 2:

$ rustman env list --env qa
error: environment 'qa' not found (available: ci, local, prod)

Variables

Precedence

When a name is defined in several places, the first source in this list wins:

#Source
1Runtime overrides: --var name=value
2Captures from earlier requests in the same run (in a data-driven run, of the same iteration)
3The current row of a data file (rustman run --data)
4The request file’s variables
5_collection.yaml variables, nearest folder first
6Persisted captures (.rustman/state/<env>.yaml)
7The active environment, including its secrets
8rustman.toml [variables]

Names are case-sensitive: {{Token}} and {{token}} are different variables.

Where and how {{name}} is filled in

{{name}} is filled in in the URL, query parameters, headers, body content, form and multipart text fields, auth fields and file paths.

  • Escaping: write \{{ for a literal {{. The text \{{not_a_var}} is sent as {{not_a_var}}.
  • No recursive expansion: a value is inserted exactly as written. If a is {{b}}, then {{a}} becomes the literal text {{b}}. This also applies to values in environment files: {{...}} inside a value is never expanded.
  • Unresolved names are errors: if any placeholder has no value, the request is not sent at all (no connection is opened), and every missing name is listed: error: unresolved variable(s): base_url, token. The runner counts this as an error, not as a failed assertion.

Dynamic variables

These are computed again for every occurrence:

PlaceholderValue
{{$uuid}}A random UUID v4
{{$timestamp}}Unix time in seconds
{{$timestampMs}}Unix time in milliseconds
{{$isoTimestamp}}RFC 3339 UTC time, e.g. 2026-11-17T09:30:00.123Z
{{$randomInt}}An integer from 0 to 1000, inclusive
{{$randomInt min max}}An integer from min to max, inclusive
{{$randomString n}}n random letters and digits (16 if n is omitted)
{{$env NAME}}The OS environment variable NAME; unresolved if it isn’t set

Secrets

Secrets can also come from external stores (Vault, 1Password, SOPS files, cloud secret managers…) through {{secret:<provider>/<path>}} references or variables written {secret: "<provider>/<path>"}: see Secret providers.

Declaring and setting a secret

List the variable under secrets in the environment file (as api_token in prod.yaml above), then store its value:

$ rustman secret set api_token --env prod
value for api_token (prod):
stored secret 'api_token' for environment 'prod' in the OS keychain

On a terminal the value is prompted for without echo. When stdin is not a terminal, the value is read from stdin instead, without its final line break, which is how scripts and CI set secrets (see the CI pattern). Without --env, the active environment is used. Only names listed under the environment’s secrets can be set, and an empty value is refused.

rustman secret list shows each declared secret and whether a value is stored. Values are never printed:

$ rustman secret list
ci/api_token  not set
prod/api_token  not set

rustman secret rm api_token --env prod deletes a stored value.

Until a value is stored, a request that uses the secret fails without being sent:

error: unresolved variable(s): api_token (secret not set; run 'rustman secret set api_token --env prod')

If the value is stored but can’t be read (the keychain refused access, or .rustman/secrets.yaml is malformed), the hint names the store error instead, for example api_token (could not read secret: OS keychain error: ...).

Where secrets are stored

  • OS keychain (the default): the macOS Keychain, the Windows Credential Manager, or the Secret Service (GNOME Keyring, KWallet) on Linux. Entries use the service rustman and the account <workspace-id>/<env>/<name>.
  • Workspace id: .rustman/workspace-id holds a UUID created the first time a secret is stored in the keychain. It’s per clone and git-ignored, so two clones of the same repository on one machine never share secrets.
  • File fallback: when no keychain is available (for example on a headless Linux host with no Secret Service running), secrets go to .rustman/secrets.yaml, and the warning OS keychain unavailable; storing secrets in .rustman/secrets.yaml is printed once. On Unix the file has mode 0600 (its folder, when Rustman creates it, 0700). On Windows, inherited permissions and the broad groups (Everyone, Authenticated Users, Users) are removed and the current user is granted full control (with the built-in icacls); SYSTEM and Administrators may keep access, as root does on Unix. The file is replaced atomically on every write. If its permissions were loosened (say, by a copy or a restore), reading a secret from it prints warning: .rustman/secrets.yaml is readable by other users; ... once, and the next rustman secret set restores mode 0600.
  • Git-ignore guard: before writing .rustman/secrets.yaml or .rustman/workspace-id, Rustman asks Git whether the path is ignored. If the workspace is in a Git repository and .rustman/ is not ignored (or the file is tracked), the write is refused with error: refusing to write secrets: .rustman/ is not git-ignored. rustman init adds .rustman/ to .gitignore. Without git, or when Git reports that the folder is not in a repository, the check passes; any other check Git can’t answer (inside a repository, or when Git fails for another reason, such as an unsafe repository owner) is a refusal with error: refusing to write secrets: could not check that .rustman/ is git-ignored.
  • No symbolic links: a .rustman that is a symbolic link (or a link in place of the secrets file) could send secrets into a tracked folder or out of the workspace, so the write is refused with error: refusing to write secrets: .rustman is a symbolic link.
  • OAuth2 tokens: the access and refresh tokens that rustman auth login and OAuth2 requests cache are secrets too, stored the same way. When they go to .rustman/secrets.yaml (no keychain, or RUSTMAN_SECRET_STORE=file), rustman auth login prints, once, warning: OAuth2 tokens are stored in .rustman/secrets.yaml (git-ignored, readable by you only), not in the OS keychain in place of the generic fallback warning.
  • Choosing the store: set RUSTMAN_SECRET_STORE=file to use only .rustman/secrets.yaml and never touch the keychain (useful in CI and containers). RUSTMAN_SECRET_STORE=keychain, or leaving it unset, means the keychain with the file fallback.

When a value exists in both places, the keychain wins. Storing a secret in the keychain removes any old copy from the file.

Redaction

Secret values never appear in any artifact Rustman produces: terminal output, logs, history, reports, copy-as-curl and error messages. They’re replaced by «redacted:<name>», for example «redacted:api_token». The values of the Authorization, Proxy-Authorization, Cookie and Set-Cookie headers are always replaced too, even when they don’t come from a secret:

Authorization: «redacted:Authorization»

Rustman tracks which bytes of a request came from a secret, and also scans every output for the secret values themselves. That second check catches a server that echoes a secret back in its response, as is or in the form a common encoder writes it. It covers the secrets the requests of the command reference (every request of a rustman run, from its first request on, whether or not that request sends them; the one request of rustman send or history replay), resolved before anything is sent, plus captured values that became secrets (see below). An environment secret no request of the command references is not read from the store, so it is not recognized if a server happens to send it. The forms matched:

  • JSON string escapes (\", \\, control characters), each with or without \/ for / (PHP), with or without \u0026, \u003c and \u003e for &, < and > and \u2028 and \u2029 for U+2028 and U+2029 (Go), and with non-ASCII characters as is or as \uXXXX escapes in upper- or lowercase hex (Python, PHP);
  • Rust Debug escapes;
  • percent-encoding in upper- or lowercase hex: every byte but A-Z a-z 0-9 - . _ ~ encoded, with a space as %20 or as + (form encoding); the same leaving / as is (Python’s quote); or leaving !'()* as is (JavaScript’s encodeURIComponent);
  • W3C Baggage value encoding (space, ,, ;, \, " and % escaped, everything else printable kept), the form a baggage header carries;
  • HTML escapes of &, < and > as &amp;, &lt; and &gt;, with " and ' as &quot; and &#x27; (Python), &quot; and &#39;, or &#34; and &#39; (Go); or every character but letters and digits as a decimal entity such as &#47;.

A secret value longer than 8 KiB is redacted in output only as is, not in these encoded forms: building a matcher over the encoded forms of very long values would take memory out of proportion. Captures are still checked for it through decoding (below), so a captured echo of it in any of these forms is still treated as a secret: never persisted, and redacted wherever a later request uses it.

Not covered: Java’s URLEncoder and PHP’s urlencode (which keep * and encode ~), XML escapes (&apos;), hexadecimal HTML entities other than &#x27;, and Go’s \u0008 and \u000c for backspace and form feed.

Redaction happens before anything is quoted or shortened: an assertion message that quotes 200 characters of a body, or the 64 KiB preview of a large body, never ends with the start of a secret, and never splits a «redacted:<name>» placeholder.

Two kinds of files are working state rather than artifacts, and hold what the server sent as is: the cookie jar (.rustman/cookies/), which keeps a cookie whose value echoes a secret so it can be sent back, and a large response body spilled to .rustman/bodies/ while history keeps its entry. Both are readable by the current user only and live in the git-ignored .rustman/ folder.

A secret the server transforms before echoing it (base64-encodes it, changes its case, hashes it, splits it) is not recognized, and is shown as the server sent it. Only the forms listed above are matched.

A captured value that holds any piece of a known secret at least 4 characters long (a capture that straddles the secret, or a masked echo such as ****wP3K) is treated as a secret for the rest of the run and never persisted (see Captures). The piece counts as is, or once the captured value is percent-decoded (+ as a space or as is), JSON-unescaped (\uXXXX, \/, \", \\…) or HTML-unescaped (named and numeric entities), so %2Fc%2Fd%2Fe%2F reveals a/b/c/d/e/f/g; invalid sequences are left as they are. Pieces shorter than 4 characters are too common to tell apart from other text and are not recognized.

Short secrets may also redact unrelated text: every occurrence of the value is replaced wherever it appears, so a 4-digit PIN 1234 also turns "duration_ms":1234 in a report into "duration_ms":«redacted:pin», and a secret shorter than 4 characters is matched in almost any text. rustman secret set warns when it stores a value shorter than 8 characters.

The only exception is an explicit, per-command opt-in, --show-secrets, which affects terminal output only: history, reports and logs stay redacted. rustman send and rustman history replay accept it to print the response headers and body as received, and rustman export curl accepts it to print the real values in the command. Without it, send and replay print the response redacted, a large body streamed from its spill file too:

OutputBody
default (status, headers, body)redacted
--body-onlyredacted
--show-secrets (with or without --body-only)as received
-o <file>as received

A binary body (any body that is not valid UTF-8, such as an image, or JSON in Latin-1) is redacted byte by byte like a text one: every other byte is printed as received. -o writes the file you named byte for byte, as curl -o does: it is how to save a body exactly (an image, say), so treat that file like the response itself.

An end-to-end test (crates/rustman-cli/tests/e2e.rs) checks this contract: it runs a workspace through init, secret set, run with the json and junit reporters and -vvv logs, export curl, a failing request, and history list, show and replay, then searches every file it produced and everything it printed for the secret, and finds nothing. Its secret is non-ASCII and contains a ", and the server also echoes it JSON-escaped, in a failing assertion message cut mid-secret and across the cut of a spilled body’s preview.

The CI pattern

CI systems keep secrets in their own secret variables, and runners usually have no OS keychain. Give CI its own environment (environments/ci.yaml above) that declares the same secrets, and feed each one from a CI secret variable into the file store at the start of the job:

$ printf '%s' "$API_TOKEN" | RUSTMAN_SECRET_STORE=file rustman secret set api_token --env ci
stored secret 'api_token' for environment 'ci' in .rustman/secrets.yaml
$ RUSTMAN_SECRET_STORE=file rustman secret list --env ci
ci/api_token  set

Then select the environment with RUSTMAN_ENV=ci (or --env ci) and keep RUSTMAN_SECRET_STORE=file set for the rest of the job. Because api_token stays a declared secret, it is redacted from reports and logs like any other secret. printf '%s' keeps the value off the command line, so it doesn’t show up in the process list or in the job log.

For example, in GitHub Actions:

env:
  RUSTMAN_ENV: ci
  RUSTMAN_SECRET_STORE: file
steps:
  - run: printf '%s' "$API_TOKEN" | rustman secret set api_token
    env:
      API_TOKEN: ${{ secrets.API_TOKEN }}

A request can also read an OS environment variable directly with {{$env NAME}}. Such values are not secrets, so only the sensitive headers are redacted. Prefer a declared secret for credentials.

Clean up at the end of a job on a shared runner:

$ RUSTMAN_SECRET_STORE=file rustman secret rm api_token --env ci
removed secret 'api_token' from environment 'ci'

Secret providers

Rustman can read secrets from where your team already keeps them: the OS keychain, environment variables, SOPS files, 1Password, HashiCorp Vault, a command you trust, and (in release builds) AWS, Google Cloud and Azure secret managers. A request names a secret with a secret reference. The value is fetched when the request is sent, used on the wire, and never written anywhere.

The behavior is specified in openspec/specs/secret-providers.

Secret references

headers:
  - name: Authorization
    value: Bearer {{secret:vault/kv/app/stripe#api_key}}

A reference is {{secret:<provider>/<path>[#<field>]}}:

  • <provider> is the name of a provider configured in [secret_providers.<name>].
  • <path> is handed to that provider as is. Its meaning depends on the type (a Vault path, a 1Password vault/item/field, a SOPS file, an environment variable name…).
  • #<field> picks a field of a structured secret (JSON or YAML), as a dotted key path: #db.password, #hosts.0. Strings come out as they are, numbers and booleans as text, objects and arrays as JSON.

The path and field may contain spaces, as 1Password vault and item names often do ({{secret:op/Eng Team/Stripe Key/api token}}), but not at either end; the provider name may not. Tabs, line breaks and braces are not allowed anywhere in a reference.

References work anywhere {{variable}} interpolation does: URLs, query parameters, headers, bodies, auth fields, and the other request kinds. A reference without a path is reported when the workspace loads:

api.rman.yaml:5: invalid secret reference 'secret:vault' (expected secret:<provider>/<path>)

Environment variables backed by a provider

An environment variable can take its value from a provider:

# environments/prod.yaml
variables:
  base_url: https://api.example.com
  api_token: {secret: "op/Engineering/Stripe/token"}

{{api_token}} then resolves through the op provider when a request is sent with --env prod. It behaves like any secret: it is redacted as «redacted:api_token», and the environment file keeps the reference. Saving the environment from the TUI writes it back unchanged.

When values are fetched

Only when a request is about to be sent, and only for that request. Loading the workspace, listing requests, opening the TUI, browsing and rendering request definitions (rustman export snippet placeholders, agent tools) never contact a provider. Saved request and environment files always keep the reference text.

All references of one request are fetched together, at most 4 at a time.

Configuring providers

Providers are declared in rustman.toml. The workspace file holds settings only, never credentials: every provider type gets its credentials from its own native chain (environment variables, its CLI’s login, files in your home directory).

[secret_providers.ci]
type = "env"
timeout_ms = 5000
cache_ttl_s = 60

Every provider accepts:

KeyDefaultMeaning
type(required)One of the types below.
timeout_ms10000How long one fetch may take. A fetch that takes longer is unresolved, with <provider>: timed out after <n> ms.
cache_ttl_s300How long a fetched value is reused, in seconds. 0 disables caching.

Keys that look like credentials are refused in rustman.toml, with exit code 2: token, password, secret, secret_id, client_secret, private_key, and any key whose name contains token, password, passwd, secret, private_key, api_key, apikey, access_key or credential (ignoring case, - read as _), such as secret_access_key or auth_token:

error: rustman.toml:4: credentials must not be stored in rustman.toml (token)

The check covers nested values too (a credential key inside an inline table or array is reported by its dotted path, such as auth.token), and a URL with a user:password@ part in any string value is refused as credentials must not be stored in rustman.toml (address: URL with credentials). No provider setting is a table: a nested table such as [secret_providers.vault.auth] is an error (secret provider 'vault': 'auth' must not be a table, exit code 2) rather than being ignored, in rustman.toml and in the user config.

Unknown keys only produce a warning, like other rustman.toml keys.

The user config

Your own config file, config.toml in the user config directory, can also declare [secret_providers.*]:

PlatformUser config file
Linux$XDG_CONFIG_HOME/rustman/config.toml, else ~/.config/rustman/config.toml
macOS$XDG_CONFIG_HOME/rustman/config.toml, else ~/.config/rustman/config.toml
Windows%APPDATA%\rustman\config.toml

A cloned workspace is untrusted input, so anything that makes Rustman run a program is accepted only from the user config: cmd providers, the binary paths op_path and gpg_path, and the cloud providers’ endpoint (which would otherwise let a workspace send your cloud credentials to a host of its choice). In rustman.toml they are refused with exit code 2 (cmd secret providers can only be defined in user config, or 'op_path' can only be set in user config).

For the same reason, a host named in rustman.toml never receives credentials Rustman finds on your machine. A Vault address from the workspace gets your token (VAULT_TOKEN, ~/.vault-token) or AppRole ids only when VAULT_ADDR names the same address or your user config sets address; otherwise resolution fails with vault: address <url> is set in rustman.toml; set VAULT_ADDR to it, or 'address' in user config, to send your Vault credentials there, an unresolved secret (exit code 3). An OIDC login is allowed, since that token is issued by the server itself. A 1Password connect_host works the same way with OP_CONNECT_HOST and OP_CONNECT_TOKEN. AWS region values must be region names ([a-z0-9-]), since they become part of the endpoint host.

A user table with a type defines a provider (or replaces the workspace’s provider of the same name). A user table without one overrides keys of the workspace’s provider of that name, which is how you point a shared onepassword provider at your own op binary:

# ~/.config/rustman/config.toml
[secret_providers.op]
op_path = "/opt/1password/op"

Provider types

TypeBuilt<path>
keychainalways<env>/<name>
envalwaysan environment variable name
sopsalwaysa workspace-relative SOPS file
onepasswordalways<vault>/<item>/<field>
vaultalways<mount>/<path>[?version=<n>]
cmdalways, user config onlypassed as the last argument
aws-secrets-managerfeature secrets-awsa secret name or ARN
aws-ssmfeature secrets-awsa parameter path
gcp-secret-managerfeature secrets-gcp<secret>[@version]
azure-key-vaultfeature secrets-azure<name>[/version]

Official release binaries enable every cloud feature. A build without one still accepts the configuration, and every reference to it fails with:

secret provider type 'aws-secrets-manager' is not available in this build (feature secrets-aws)

keychain

The secrets rustman secret set stores (see Environments), read with <path> as <env>/<name>. It honors RUSTMAN_SECRET_STORE like the rest of Rustman.

[secret_providers.kc]
type = "keychain"

{{secret:kc/prod/api_token}} reads what rustman secret set api_token --env prod stored.

env

The process environment: <path> is the variable name. This is the usual CI provider.

[secret_providers.ci]
type = "env"

{{secret:ci/STRIPE_KEY}} is the value of STRIPE_KEY; an unset variable is unresolved.

sops

SOPS-encrypted YAML or JSON files inside the workspace. <path> is the file, relative to the workspace root; #field is a dotted key path into the decrypted document. Paths that leave the workspace are refused (sops: path escapes the workspace).

[secret_providers.sops]
type = "sops"

{{secret:sops/secrets/prod.sops.yaml#db.password}} is the decrypted db.password.

  • age recipients are decrypted natively. Identities come from SOPS_AGE_KEY (inline keys), SOPS_AGE_KEY_FILE, or SOPS’ default key file (sops/age/keys.txt in $XDG_CONFIG_HOME, ~/Library/Application Support on macOS, ~/.config on Linux, %APPDATA% on Windows).
  • PGP recipients are decrypted by running an installed gpg (gpg --batch --decrypt), found on PATH or at gpg_path from the user config. Without it: sops: PGP decryption requires gpg, which was not found.
  • The file’s MAC is checked before any value is returned; a modified file fails with sops: MAC mismatch in <file>.

onepassword

1Password items, with <path> as <vault>/<item>/<field> (or <vault>/<item>/<section>/<field>). Names may contain spaces. A path with fewer parts fails with onepassword: path '<path>' must be <vault>/<item>/<field> before op or Connect is contacted.

[secret_providers.op]
type = "onepassword"

By default the provider runs the 1Password CLI: op read op://<vault>/<item>/<field>. Sign in once with op signin (or the desktop app integration); a signed-out CLI fails with onepassword: not signed in (run 'op signin'). account selects an account when you have several; op_path (user config only) names the binary.

For CI, point the provider at a 1Password Connect server. Its token is read from OP_CONNECT_TOKEN, never from the file:

[secret_providers.op]
type = "onepassword"
connect_host = "https://connect.example.com"

vault

HashiCorp Vault KV secrets. <path> starts with the mount; the provider asks Vault whether the mount is KV v1 or v2 (once per mount) and reads ?version=<n> from KV v2.

[secret_providers.vault]
type = "vault"
address = "https://vault.example.com"
namespace = "team-a"
auth = "token"

{{secret:vault/kv/app/db?version=3#password}} reads version 3 of kv/app/db and returns its password field.

  • address defaults to VAULT_ADDR. namespace is sent as X-Vault-Namespace (Vault Enterprise and HCP).
  • auth = "token" (the default) uses VAULT_TOKEN, else the ~/.vault-token file that vault login writes.
  • auth = "approle" logs in once per session with VAULT_ROLE_ID and VAULT_SECRET_ID from the environment; mount changes the auth mount (default approle).
  • auth = "oidc" opens your browser for an OIDC login once per session and keeps the token in memory. role picks the Vault role, mount the auth mount (default oidc), and oidc_port the local callback port (default 8250). The role must allow http://localhost:8250/oidc/callback as a redirect URI, as for vault login -method=oidc.
[secret_providers.vault]
type = "vault"
address = "https://vault.example.com"
auth = "oidc"
role = "developer"

A 403 is reported as vault: permission denied for <path>, without the token.

cmd

Runs a command you trust and uses its trimmed standard output. The argv runs directly, with no shell, and <path> is appended as the last argument. Allowed in the user config only.

# ~/.config/rustman/config.toml
[secret_providers.pass]
type = "cmd"
command = ["pass", "show"]

{{secret:pass/work/api}} runs pass show work/api. A non-zero exit fails with pass: command failed (exit status <n>); its output is never shown. Since the path comes from the workspace, a path starting with - is refused (pass: path '<path>' must not start with '-') so it cannot pass an option to your command. A command that does not finish within the provider’s timeout_ms is killed; on Linux and macOS so are the programs it started (it runs in a process group of its own, so it cannot prompt on the terminal), while on Windows only the command itself is.

Cloud providers

The cloud types are thin REST clients on Rustman’s own HTTP engine: no cloud SDK and no system library. Each one finds credentials through its platform’s documented chain, in the same order as the official SDKs, so whatever already works for the platform’s CLI works here. Instance metadata endpoints, which exist only on cloud machines, get 1 s to answer.

endpoint (user config only, like every setting that could send credentials elsewhere) points a provider at an emulator such as LocalStack:

# ~/.config/rustman/config.toml
[secret_providers.localstack]
type = "aws-secrets-manager"
region = "us-east-1"
endpoint = "http://localhost:4566"

Release binaries include all three (cargo feature cloud-secrets of rustman-cli); a source build adds them with cargo build --features rustman-cli/cloud-secrets, or one at a time with secrets-aws, secrets-gcp or secrets-azure.

aws-secrets-manager and aws-ssm

[secret_providers.aws]
type = "aws-secrets-manager"
region = "eu-west-1"
profile = "prod"

[secret_providers.ssm]
type = "aws-ssm"
region = "eu-west-1"

{{secret:aws/prod/db#password}} returns the password field of the JSON secret prod/db (<path> is a secret name or ARN; a binary secret must be UTF-8 text). aws-ssm reads a parameter with decryption; a reference cannot start its path with /, so {{secret:ssm/app/key}} reads /app/key.

  • region defaults to AWS_REGION, then AWS_DEFAULT_REGION. Without one, its references are unresolved with aws-secrets-manager: no region (set 'region' or AWS_REGION) (exit code 3).
  • Credentials come from the AWS default chain: AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN, the shared profile (AWS_PROFILE, else default) in ~/.aws/credentials and ~/.aws/config, container credentials (ECS, EKS Pod Identity), then the EC2 instance metadata service (IMDSv2; AWS_EC2_METADATA_DISABLED=true skips it). With profile, only that profile is used. Profiles that need SSO, a role or credential_process are refused: export temporary credentials (aws configure export-credentials --format env) instead.
  • Nothing found: aws-secrets-manager: no credentials found in the default chain.
  • Requests are signed with SigV4; the endpoint is https://secretsmanager.<region>.amazonaws.com (or ssm.), or AWS_ENDPOINT_URL_SECRETS_MANAGER, AWS_ENDPOINT_URL_SSM, AWS_ENDPOINT_URL.

gcp-secret-manager

[secret_providers.gcp]
type = "gcp-secret-manager"
project = "my-project"

<path> is <secret>[@version] (default latest): {{secret:gcp/db-password@3}}.

  • project defaults to GOOGLE_CLOUD_PROJECT, then the project of the credentials file.
  • Credentials come from Application Default Credentials: the file named by GOOGLE_APPLICATION_CREDENTIALS (a service account key), else the file gcloud auth application-default login writes, else the metadata server of a Google Cloud machine. Workload identity federation files are refused. Nothing found: gcp-secret-manager: no credentials found (Application Default Credentials).

azure-key-vault

[secret_providers.azure]
type = "azure-key-vault"
vault = "my-vault"

<path> is <name>[/version], read from https://<vault>.vault.azure.net.

  • Credentials come from DefaultAzureCredential’s chain: a service principal from AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET, workload identity (AZURE_FEDERATED_TOKEN_FILE), managed identity (App Service, or the instance metadata service), then the Azure CLI (az login). Nothing found: azure-key-vault: no credentials found (DefaultAzureCredential).

Network settings

Provider calls (Vault, 1Password Connect and the cloud types) connect directly and verify servers against the operating system’s trust store. The workspace’s TLS files (ca_file, client certificates), insecure and proxy settings, and the HTTPS_PROXY/HTTP_PROXY environment variables, are not applied to them, so a workspace cannot weaken them. A server behind a private CA needs that CA in the system trust store, and a server reachable only through a proxy cannot be used.

Caching

Fetched values are kept in process memory only, per provider and path, for cache_ttl_s (300 s by default). Requests that need the same secret at the same time share one fetch, so a rustman run of 50 requests using {{secret:vault/kv/app#pw}} contacts Vault once. Cached values are zeroized when they expire and when the process exits; nothing is ever written to disk. In the TUI, the Refresh secrets palette action (secrets.refresh) clears the cache so the next send fetches again.

Failures and exit codes

A reference that cannot be resolved (missing secret or field, failed auth, timeout, provider error, unknown provider) stops its request before anything is sent:

unresolved secret vault/kv/app/db#user: field 'user' not found
unresolved secret lastpass/x: unknown secret provider 'lastpass' (configured: ci, vault)

It counts as a request error: rustman send and rustman run exit with code 3. A misconfigured provider (a credential, a command or a binary path in rustman.toml, an unknown type, a missing type) is a configuration error, exit code 2, reported when the configuration loads. A problem found only while resolving a reference (a provider type not in this build, a Vault without an address) makes that reference unresolved: exit code 3, in send, run and secret get alike. Messages never contain a secret value or a credential.

Redaction

Every fetched value joins the redaction set of environments for the life of the process. It is shown as «redacted:<provider>/<path>[#field]», or «redacted:<variable>» when it backs an environment variable, in terminal output, logs, history, reports, snippets and agent results, including when a server echoes it back.

rustman export curl, rustman export snippet and the TUI’s “Copy as…” never contact a provider: a reference is printed as «redacted:<provider>/<path>[#field]» (or «redacted:<variable>» for a provider-backed environment variable), even with --show-secrets, which reveals keychain secrets only. With --placeholders, references stay as written ({{secret:...}}).

The secret commands

$ rustman secret get vault/kv/app#pw
•••••••• (24 chars, vault)
$ rustman secret test
ci: ok
error: vault: authentication failed
$ rustman secret list-providers
NAME   TYPE   AUTH  ORIGIN     STATUS
ci     env    -     workspace  available
vault  vault  oidc  workspace  available
  • rustman secret get <ref> fetches a reference (<provider>/<path>[#field], also accepted as {{secret:...}}) and prints its length and provider, never the value. --reveal prints the value, and only when standard output is a terminal: rustman secret get vault/kv/app#pw --reveal | cat fails with --reveal requires an interactive terminal (exit code 2) before contacting the provider. A reference that cannot be resolved exits with code 3, whatever the cause (an unknown provider, or a type not in this build, included), the same code send and run give it.
  • rustman secret test [<provider>] checks that each provider (or the one named) can authenticate and be reached, without reading a secret: Vault looks its token up, 1Password runs op whoami (or lists Connect vaults), the cloud types obtain a token (AWS reads a secret name that does not exist: a not-found answer means the keys were accepted). It exits with 0 when every check passes and 3 otherwise, an unknown provider name included; use it to fail a CI job early, before a long run.
  • rustman secret list-providers lists each provider’s name, type, auth method, origin (workspace or user) and whether its type is in this build. It contacts no provider. --types lists the provider types this build supports, without a workspace.

Agents

Agents (rustman mcp serve) can send requests that use secret references: they are resolved inside the engine, through the same providers and cache. No agent tool returns a value: get_request shows the reference text (Bearer {{secret:op/Eng/API/token}}), results show «redacted:op/Eng/API/token» even when a server echoes the value, and there is no tool that reads or tests a secret.

Agents cannot write references themselves. A tool call whose arguments contain a {{secret:...}} placeholder (an ad-hoc URL, header, body, JSON-RPC params, WebSocket frames, gRPC message or metadata, or vars) is refused with invalid_input (secret references ({{secret:...}}) are allowed only in saved request and environment files, not in tool arguments) before any provider is contacted, so a prompt-injected agent cannot choose which secret is fetched or where it is sent. Values inserted from variables and captures are never resolved again, so a server response that contains {{secret:...}} text is sent back as that text. Importers, including the agent-reachable import_openapi tool, write a {{secret:...}} reference found in an imported document escaped (\{{secret:...}}, see Importing collections and Importing OpenAPI), so a document cannot plant a reference either.

Plugins

A value a provider resolved reaches a plugin (an auth scheme’s parameters, a transformer’s message, an assertion’s exchange) only when the plugin holds secrets:read:<name>, where <name> is the environment variable the reference backs, or the reference itself (secrets:read:vault/kv/app#key) when the request uses {{secret:...}} directly. Without the grant the plugin sees «redacted:<name>». Captured secrets and secret data columns are treated the same way, and everything a plugin returns is redacted of all of them.

HTTP requests

How Rustman sends a kind: http request: transport and timeouts, redirects, TLS, proxies, cookies, auth helpers, the timing breakdown, response bodies, and curl import and export. The request file format itself is in request-files.md; variables and secrets are in environments.md.

The examples on this page are tested. The YAML files are written into one workspace that must load, every $ rustman ... line runs against it and must print the lines shown (crates/rustman-cli/tests/docs_http.rs), and the messages listed under Errors and warnings are produced by the engine (crates/rustman-http/tests/docs_http.rs).

Transport

Rustman uses its own HTTP stack (hyper with a timed connector and rustls); it does not use the system’s curl or TLS libraries.

  • https:// URLs negotiate HTTP/2 through ALPN and fall back to HTTP/1.1.
  • http:// URLs use HTTP/1.1, unless settings.http2_prior_knowledge: true (HTTP/2 over cleartext, “h2c”).
  • Connections are reused between requests that share the same TLS, proxy and timeout settings.
  • When a host name resolves to several addresses (for example localhost as ::1 and 127.0.0.1), Rustman tries them in resolver order and starts the next one if an attempt fails or has not connected within 250 ms; the first to connect is used (Happy Eyeballs, RFC 8305).

The exchange records the negotiated http_version (HTTP/1.1 or HTTP/2).

Timeouts

SettingDefaultCovers
timeout_ms30000The whole exchange: connect, send, response and body. Set in rustman.toml [defaults] or the request’s settings.timeout_ms; --timeout on rustman send and rustman run replaces both.
connect_timeout_ms10000DNS, TCP connect, proxy tunnel and TLS handshake. Set in settings.connect_timeout_ms.

A timeout fails the request with timeout after <n> ms (<phase>), where the phase is connect or response.

Redirects

Redirects are followed by default, up to max_redirects (10) hops, and every hop is recorded in the exchange. A 301, 302 or 303 turns a non-GET/HEAD request into a GET without a body; 307 and 308 keep the method and body. Credentials are dropped when a hop goes to another origin (scheme, host or port): Authorization, Proxy-Authorization, an explicit Cookie header (the cookie jar still sends the cookies that match the new host) and the api_key header or query parameter. Any other header whose value carries a secret (such as X-Api-Key: '{{token}}'), and a 307/308 body that carries one (such as a form with a client_secret), are dropped too, so a secret never follows a redirect to another server; the hop is still sent, without them, and the exchange gets the warning cross-origin redirect to <origin>: dropped header x-api-key, the body, which carry a secret. A secret is found the way output is redacted: a secret variable’s value, or a literal credential in Authorization, Cookie and the like, in any of its encoded forms. An aws_sigv4 request is signed again on each same-origin hop and not at all once a hop leaves the origin (see SigV4). Same-origin hops keep everything. With follow_redirects: false the 3xx response is returned as is. Too many hops fail with too many redirects (<max>).

# http/no-redirects.rman.yaml
version: 1
kind: http
name: Login redirect
url: https://app.example.com/login
settings:
  follow_redirects: false
  max_redirects: 3

TLS

Certificates and host names are verified against the operating system’s trust store, plus any ca_bundle (PEM) from rustman.toml [http] and the request’s settings.ca_bundle. With a ca_bundle, the operating system’s root certificates are loaded as a list next to the bundle, so OS-only checks such as revocation do not apply to that request. A failure starts with tls: certificate verification failed.

verify_tls: false (in [defaults] or the request’s settings) or --insecure on rustman send and rustman run turns verification off. Every exchange sent that way is flagged insecure: true, plain http:// ones included.

For mutual TLS, give a PEM certificate and key, or a PKCS#12 bundle whose passphrase comes from a secret variable:

# http/mtls.rman.yaml
version: 1
kind: http
name: Internal API with a client certificate
url: https://internal.example.com/health
settings:
  ca_bundle: ../certs/dev-ca.pem
  client_cert: ../certs/client.pem
  client_key: ../certs/client.key

A client certificate in rustman.toml [http] (client_cert and client_key, or client_pkcs12 and client_pkcs12_password, with paths relative to the workspace root) applies to every request that sets none of its own; see request-files.md. The certificate is presented to the origin server only, never to an https:// proxy on the way.

# http/mtls-p12.rman.yaml
version: 1
kind: http
name: Internal API with a PKCS#12 bundle
url: https://internal.example.com/health
settings:
  client_pkcs12: ../certs/client.p12
  client_pkcs12_password: '{{p12_password}}'

Proxies

The proxy for a request is, in order: settings.proxy, rustman.toml [http] proxy, then the HTTPS_PROXY, HTTP_PROXY and ALL_PROXY environment variables (either case). NO_PROXY lists hosts that bypass a proxy taken from the environment. Supported schemes are http://, https:// and socks5://; https:// URLs go through an HTTP proxy with CONNECT. settings.proxy: none bypasses every proxy.

# http/via-socks.rman.yaml
version: 1
kind: http
name: Through the SOCKS tunnel
url: https://api.internal.local/status
settings:
  proxy: socks5://127.0.0.1:1080

Cookies

Each environment has its own cookie jar, .rustman/cookies/<env>.json, kept across runs and following the RFC 6265 domain, path, expiry and Secure rules. A Set-Cookie received under staging is never sent with --env prod. settings.cookies: false leaves the jar out of one request, and an explicit Cookie header replaces the jar’s cookies. Jar files are readable by the current user only, and are written only when .rustman/ is a real folder (not a symbolic link) that Git ignores.

$ rustman cookies clear --env prod
no cookies stored for environment 'prod'

Headers

Unless the request sets them, every request carries User-Agent: rustman/<version> and Accept: */*. The body type sets a default Content-Type, which an explicit header replaces (exactly one is sent):

Body typeDefault Content-Type
jsonapplication/json
texttext/plain; charset=utf-8
formapplication/x-www-form-urlencoded
multipartmultipart/form-data; boundary=… (a random boundary)
fileapplication/octet-stream

Content-Length and Host are always computed from the body and the URL. A request that sets a different value gets the computed one, and the exchange records a warning such as ignored stale Content-Length: 3 (sent the computed 10).

Auth

Auth is applied after variables are filled in, and never replaces an explicit Authorization header (or, for an API key, an explicit header of the same name).

TypeSends
{type: basic, username, password}Authorization: Basic <base64 of username:password>
{type: bearer, token}Authorization: Bearer <token>
{type: api_key, name, value, in: header}the header <name>: <value> (in defaults to header)
{type: api_key, name, value, in: query}the query parameter <name>=<value>
{type: oauth2, ...}Authorization: Bearer <access token>
{type: digest, ...}, {type: aws_sigv4, ...}, {type: jwt, ...}credentials computed per request; see Signature auth

When a Basic username or password holds a secret, the encoded credential is redacted too, so a server that echoes the Authorization header back cannot leak it.

# http/me.rman.yaml
version: 1
kind: http
name: Me
url: '{{base_url}}/me'
auth:
  type: bearer
  token: '{{api_token}}'
# http/search.rman.yaml
version: 1
kind: http
name: Search
url: '{{base_url}}/search'
query:
  - name: q
    value: rust
auth:
  type: api_key
  name: key
  value: '{{api_key}}'
  in: query

OAuth2

grant: client_credentials gets a token from token_url with the client id and secret. grant: authorization_code also needs auth_url: Rustman opens the browser (and prints the URL) with a PKCE code_challenge_method=S256 challenge, and receives the code on a loopback listener at http://127.0.0.1:<ephemeral port>/callback. The listener serves at most 16 connections at once (each gets 5 s to send its request), and when accepting a connection fails (for example when the process is out of file descriptors) it retries after a delay that doubles from 10 ms up to 1 s, rather than spinning.

Tokens are cached per environment in the secret store, never in workspace files. A cached token is reused until shortly before it expires, refreshed with its refresh token when there is one, and acquired again when a request gets a 401. Calls to token_url never follow redirects, so the client secret and codes in the form cannot be re-posted elsewhere; point token_url at the final URL.

# http/oauth-login.rman.yaml
version: 1
kind: http
name: Profile
url: '{{base_url}}/profile'
auth:
  type: oauth2
  grant: authorization_code
  auth_url: https://auth.example.com/authorize
  token_url: https://auth.example.com/token
  client_id: rustman-cli
  scopes:
    - profile

The authorization-code grant needs a person at a terminal. When rustman send or rustman run has no terminal on stdin (as in CI) and no cached token, the request fails with oauth2: interactive login required (run 'rustman auth login <request>'). Run rustman auth login http/oauth-login --env prod once on a workstation; later runs reuse and refresh the cached token. When the token goes to .rustman/secrets.yaml rather than the OS keychain (no keychain, or RUSTMAN_SECRET_STORE=file), rustman auth login says so once: warning: OAuth2 tokens are stored in .rustman/secrets.yaml (git-ignored, readable by you only), not in the OS keychain. See secret storage.

Timing breakdown

Each exchange records, in milliseconds with microsecond precision:

PhaseFrom → to
dnsname lookup
connectTCP connect (and proxy tunnel)
tlsTLS handshake
ttfbconnection ready (request start on a reused connection) → first response byte
downloadfirst response byte → last body byte
totalthe whole exchange; at least the sum of the phases
autha Digest challenge round trip answered before the final one (absent otherwise); total includes it

Phases that did not happen are null, never 0: tls on plain HTTP, dns for an IP address, and dns, connect and tls on a reused connection.

Response bodies

  • Bodies are decompressed (gzip, br, deflate, zstd) unless settings.decompress: false. An unknown Content-Encoding leaves the body as received, with a warning. Decoding goes through a fixed 64 KiB buffer, so memory stays bounded whatever the compression ratio, and a body that decodes to more than 1 GiB fails with network: the decompressed response body is larger than <n> bytes (use decompress: false to keep such a body encoded).
  • A body that is not decoded (no Content-Encoding, or decompress: false) is limited by rustman.toml [http] max_download_bytes (1 GiB): past it the request fails with network: the response body is larger than <n> bytes, so an endless stream cannot fill the disk before the timeout.
  • Bodies up to rustman.toml [http] max_body_bytes (10 MiB) stay in memory. A larger body is streamed to .rustman/bodies/<uuid>.bin (a random name per exchange; outside a workspace, a folder of the current user in the temp folder: rustman-bodies-<uid> on Unix, rustman-bodies in the per-user temp folder on Windows); the exchange keeps its first 64 KiB as a preview and its full size_bytes. The file is removed again when the request fails or times out before the body ends, and redirect hops keep none. Once the request is done, the file is kept only while a history entry refers to it: with --no-history, history disabled or outside a workspace, it is deleted when the command has used it (after rustman send printed the body). Pruning history deletes it with its entry, along with any spill file no entry refers to that is more than an hour old, and rustman history clear deletes every spill file. Spill files are readable by the current user only, and, like cookie jars, are written only when .rustman/ is a real, git-ignored folder. A spill folder that is a symbolic link, or (on Unix) belongs to another user, is refused; one of ours that others can access is set back to mode 0700. A spill file is always created new, never opened when something already exists at its path. A 50 MiB download keeps well under 16 MiB of memory for its body.
  • A body that is not valid UTF-8 (an image, a PDF) is marked binary: true, and its bytes are kept exactly as received, never decoded lossily.
# rustman.toml
[workspace]
name = "shop"
version = 1

[http]
max_body_bytes = 1048576   # spill bodies over 1 MiB
max_download_bytes = 104857600   # fail undecoded bodies over 100 MiB

Curl import and export

Import

rustman import curl reads a curl command, from one argument, from its words after --, or from stdin, and prints the equivalent request file. --out <file> writes it instead (an existing file is never replaced).

$ rustman import curl "curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -d '{\"name\":\"ana\",\"admin\":false}'"
version: 1
kind: http
name: POST /users
method: POST
url: https://api.example.com/users
body:
  type: json
  content:
    name: ana
    admin: false
curl optionBecomes
-X, --requestmethod
URL, --urlurl (http:// is added when the scheme is missing, unless the URL starts with a variable such as {{base_url}})
-H, --headerheaders
-d, --data, --data-ascii, --data-binary, --data-raw, --data-urlencode, --jsonbody: json when the content type is JSON, form for a=1&b=2 data, a file body for @file, else text
-F, --form, --form-stringa multipart body (@file parts and ;type= included)
-u, --userauth: {type: basic}
-b, --cookiea Cookie header (cookie files are not read)
-k, --insecuresettings.verify_tls: false
-L, --locationsettings.follow_redirects: true
--compressedan Accept-Encoding header (responses are always decompressed)
-G, --getthe -d data becomes query parameters of a GET (an @file is not read)

Data without -X makes the method POST, as in curl. A Content-Type header that the body type implies is left out of the file. Every other option is reported, not silently dropped:

$ rustman import curl "curl --limit-rate 1k https://api.example.com/health"
warning: ignored unsupported curl option --limit-rate
version: 1
kind: http
name: GET /health
method: GET
url: https://api.example.com/health

Export

rustman export curl <request> prints the request, with its variables filled in for the active environment, as a single POSIX-shell-quoted curl command. Secrets are replaced by «redacted:<name>» unless --show-secrets is passed (a secret provider reference is never fetched: it is always printed as «redacted:<provider>/<path>[#field]»), as are the values of Authorization, Cookie and the other credential headers. A request holding a NUL byte (in its body, for example) is printed as a comment with a warning instead, since a shell argument cannot carry one.

# environments/prod.yaml
variables:
  base_url: https://api.example.com
secrets:
  - api_token
  - api_key
  - p12_password

With the secret api_token set for prod:

$ rustman export curl http/me --env prod
curl 'https://api.example.com/me' -H 'Authorization: «redacted:api_token»' -L
$ rustman export curl http/no-redirects
curl 'https://app.example.com/login'

Exporting and importing back gives the same method, URL, headers and body. An OAuth2 token is not part of the export (a warning says so), since it only exists once the request runs. For other languages and tools, see Code snippets.

Errors and warnings

The messages on this page, as Rustman prints them (<...> marks the variable part):

timeout after 500 ms (response)
too many redirects (10)
tls: certificate verification failed for <host>: <reason>
network: the decompressed response body is larger than <n> bytes
network: the response body is larger than <n> bytes
oauth2: interactive login required (run 'rustman auth login <request>')
ignored stale Content-Length: 3 (sent the computed 10)
ignored Host: <value> (sent the URL's host <host>)
cross-origin redirect to <origin>: dropped <parts>, which carry a secret
ignored unsupported curl option <option>

Request failures (network, TLS, timeout, proxy, auth) exit with code 3; a curl command that cannot be imported exits with code 2.

Signature auth: Digest, AWS SigV4 and JWT

Besides basic, bearer, api_key and oauth2 (see HTTP requests), a request or _collection.yaml can use three auth types whose credentials are computed for every request: digest, aws_sigv4 and jwt. Their fields are interpolated like any other auth field, so keys and passwords normally come from secret variables. None of them replaces an explicit Authorization header.

TypeSends
{type: digest, username, password}Authorization: Digest ..., answering the server’s 401 challenge
{type: aws_sigv4, region, service, ...}Authorization: AWS4-HMAC-SHA256 ..., X-Amz-Date, X-Amz-Content-Sha256 and, with a session token, X-Amz-Security-Token
{type: jwt, algorithm, ...}Authorization: Bearer <jwt> (or a named header, or a query parameter) with a token signed for this request

Digest

# auth/digest.rman.yaml
version: 1
kind: http
name: Digest
url: '{{base_url}}/protected'
auth:
  type: digest
  username: ana
  password: '{{password}}'

Digest follows RFC 7616:

  1. The first request goes out without credentials.
  2. On a 401 with WWW-Authenticate: Digest, Rustman computes the answer and sends the request once more, with nc=00000001 and a fresh cnonce. A second 401 (a wrong password, for example) is returned as the response; there is no further retry.
  3. The nonce is cached per environment, host and realm for the rest of the process (a rustman run), so later requests to the same host send credentials up front with the next count (nc=00000002, …). A 401 with stale=true (or any 401 to such a request) gets one retry with the new nonce, counting from 00000001 again.

Supported: MD5, MD5-sess, SHA-256, SHA-256-sess, qop=auth, and challenges without qop (RFC 2069). When the server offers several Digest challenges (one per algorithm, in one or several WWW-Authenticate headers), Rustman answers the first supported one, preferring SHA-256 (and SHA-256-sess) over MD5; if none is supported, the first one’s error is reported. A challenge that only offers unsupported qop values fails naming them, for example digest: unsupported qop auth-int; one with userhash=true fails with digest: unsupported userhash.

Because the request may be sent twice, a file or multipart body is buffered in memory, up to 10 MiB. A larger body fails before anything is sent, with digest: body larger than 10 MiB cannot be replayed (exit code 3).

When a challenge was answered, the exchange’s timing breakdown has auth: the duration of the challenge round trip. total covers both round trips. In the JSON report these are auth_ms and total_ms.

AWS SigV4

# auth/s3-get.rman.yaml
version: 1
kind: http
name: S3 object
url: https://bucket.s3.amazonaws.com/a.txt
auth:
  type: aws_sigv4
  region: us-east-1
  service: s3
  access_key: '{{aws_key}}'
  secret_key: '{{aws_secret}}'

Requests are signed with the signer of the AWS SDK for Rust (the aws-sigv4 crate). Signing is the last step before a request is sent, after variables, default headers, collection headers and cookies, so all of them are part of SignedHeaders (except User-Agent, Proxy-Authorization and the other headers proxies may change). Every redirect hop on the request’s origin (same scheme, host and port) is signed again for its own URL. A redirect to another origin is followed unsigned: that hop and every later one, even one that comes back to the original origin, carry no Authorization, X-Amz-Date, X-Amz-Content-Sha256 or X-Amz-Security-Token, so another server never receives a signature, the access key or the session token. For service: s3 the path is signed as sent; other services use SigV4’s double encoding and path normalization. The query string is canonicalized by the same crate; a literal + or * in a query value may be canonicalized differently by other SigV4 implementations (botocore, for example), so percent-encode them (%2B, %2A) when the server must verify the signature.

Credentials come from one of three sources:

FieldsCredentials
access_key, secret_key, optional session_tokenthe given values, usually secret variables
from: envAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and optional AWS_SESSION_TOKEN
from: profile, profile: <name>the static keys of that profile in ~/.aws/credentials (or ~/.aws/config; AWS_SHARED_CREDENTIALS_FILE and AWS_CONFIG_FILE override the paths)

A profile that uses SSO, an assumed role or credential_process fails, naming the key: aws_sigv4: profile 'dev' uses sso_start_url, which is not supported; export temporary credentials or use a secret provider. The secret key and session token, whatever their source, are redacted everywhere as «redacted:aws_secret_key» and «redacted:aws_session_token».

# auth/api-gateway.rman.yaml
version: 1
kind: http
name: API Gateway
url: https://abc123.execute-api.eu-west-1.amazonaws.com/prod/items
auth:
  type: aws_sigv4
  region: eu-west-1
  service: execute-api
  from: env

X-Amz-Content-Sha256 is the SHA-256 of the exact body bytes sent. unsigned_payload: true sends UNSIGNED-PAYLOAD instead and skips hashing the body, which S3 accepts for large uploads. The body itself is still read into memory before it is sent, as every request body is. When AWS rejects a request because of the clock (RequestTimeTooSkewed or Signature expired), the exchange gets the warning check the system clock; request was signed at <X-Amz-Date>.

JWT

# auth/jwt.rman.yaml
version: 1
kind: http
name: JWT
url: '{{base_url}}/me'
auth:
  type: jwt
  algorithm: HS256
  secret: '{{jwt_secret}}'
  claims:
    sub: '{{user_id}}'
    scope: read

A new token is signed for every request, so two requests a few seconds apart carry different tokens. The claims are interpolated (user_id=42 gives "sub": "42"), and iat (now) and exp (iat + ttl) are added unless claims sets them.

FieldMeaning
algorithmHS256, HS384, HS512, RS256 or ES256
secretthe HMAC secret (HS algorithms only), usually a secret variable; a secret that resolves to empty text fails the request with jwt: HS256 secret is empty
private_keya PEM private key (RS256, ES256), usually a secret variable
private_key_filea PEM private key file, relative to the workspace root; it may not leave the workspace
claimsthe token’s claims
headerextra JOSE header fields: kid, typ, cty, jku, jwk, x5u, x5c, x5t, x5t#S256
ttlthe lifetime: 30s, 5m (the default), 1h
in, namein: header (default) sends Authorization: Bearer <jwt>, or the bare token in the header name; in: query sends it as the query parameter name

RS256 needs an RSA key and ES256 an EC (P-256) key in PKCS#8 form (-----BEGIN PRIVATE KEY-----). A key file of the wrong kind fails when the workspace loads, with jwt: RS256 requires an RSA private key.

# auth/jwt-rs256.rman.yaml
version: 1
kind: http
name: JWT RS256
url: '{{base_url}}/me'
auth:
  type: jwt
  algorithm: RS256
  private_key_file: keys/service.pem
  claims:
    iss: rustman
  header:
    kid: key-1
  ttl: '1h'

Generated tokens never reach history, reports or the terminal: they are shown as «redacted:jwt», and history records the header as Authorization: Bearer «redacted:jwt».

Code snippets

rustman export snippet --lang <lang> <request> prints a request as code for another language or tool, with its variables filled in for the active environment. It uses the same resolved request as rustman export curl, and the same redaction.

Languages

rustman export snippet --list prints the supported languages:

IdPrintsRuns with
curlthe rustman export curl commandcurl
httpiean http commandHTTPie 3.2 or later
wgeta wget commandGNU Wget
python-requestsa script using requestsPython 3 with requests
python-httpxa script using httpxPython 3 with httpx
js-fetchan ES module using fetchNode.js 20 or later (or a browser, without files)
node-axiosan ES module using axiosNode.js with axios
goa main.go using net/httpGo
rust-reqwesta main.rs using blocking reqwestRust, with the reqwest line from the snippet’s first comment
powershellInvoke-WebRequest with splatted parametersPowerShell 7
csharptop-level statements using HttpClient.NET 10 (dotnet run snippet.cs)

fetch, python and rust are accepted as aliases of js-fetch, python-requests and rust-reqwest. Any other id exits with code 2 and lists the supported ones:

error: snippet: unknown language 'cobol' (supported: curl, httpie, wget, python-requests, python-httpx, js-fetch, node-axios, go, rust-reqwest, powershell, csharp)

Example

# users/create.rman.yaml
version: 1
kind: http
name: create-user
method: POST
url: '{{base_url}}/users'
auth:
  type: bearer
  token: '{{api_token}}'
body:
  type: json
  content:
    name: Ada
    admin: false

With base_url: https://api.example.com and the secret api_token set for prod:

$ rustman export snippet --lang python-requests users/create --env prod
import requests

response = requests.post(
    "https://api.example.com/users",
    json={"name": "Ada", "admin": False},
    headers={
        "Authorization": "Bearer «redacted:api_token»",
        "Content-Type": "application/json",
    },
)
print(response.status_code)
print(response.text)

Every snippet sends the method, URL (query included), headers and body Rustman would send, plus the Content-Type the body implies. A multipart body names its files relative to the workspace root, so run the snippet from there. Redirects and verify_tls: false are carried over where the language has a switch for them; js-fetch and node-axios cannot turn TLS verification off and print a warning instead. Two multipart limits also print a warning: wget cannot send multipart bodies at all (the snippet says so in a comment), and httpie sends a text part without its own Content-Type.

Rustman sends a non-ASCII header value (X-Label: café) as UTF-8 bytes. Python’s and Node’s clients would write a text value as Latin-1 (or refuse it), and reqwest refuses one, so their snippets pass the bytes: "café".encode() in Python, String.fromCharCode(...new TextEncoder().encode("café")) in JavaScript, "café".as_bytes() in Rust. The .NET client behind powershell and csharp may refuse such a value, so those print a warning: warning: snippet: csharp may refuse the non-ASCII value of header X-Label. A JSON body can be re-encoded by the client (Python’s json= writes é as \u00e9 and adds spaces); the document sent is the same.

Values stay text

Whatever a header, query, form or multipart value holds, the snippet sends it as text and runs nothing:

  • Shell snippets (curl, httpie, wget) single-quote every word that is not plain letters, digits and -_=/,.+, so $(...), backticks, ! and line breaks are not expanded; a word starting with = is quoted too (zsh expands =name). No user value can start an option: httpie always writes -- before the method, so a header or part name starting with - (-oFILE, --session-read-only=…) is a request item; wget always writes -- before the URL; curl gives every value as the argument of its option (-H, --form-string, --data-raw) and a URL starting with - after --url. A shell argument cannot carry a NUL byte, so a request holding one (in its body, for example) gets a comment instead of a command, with a warning: send it with rustman or put the body in a file.
  • httpie reads :, ;, = and @ in a request item as separators, and a header value starting with =@ or :=@ (or a part value starting with @) as “read this file”. The snippet backslash-escapes every such character in a name and the first character of a value, writes an empty header as Name; (Name: would leave it out), and passes the body as --raw=<text>. httpie cannot write a backslash right before one of those characters: such a header or part is left out with a warning. A method that is not made of letters is read by httpie as the URL, so the snippet is a comment and a warning instead.
  • curl writes text parts with --form-string, which never reads a file, and quotes -F values. An empty header becomes -H 'Name;' (curl drops Name:). A header name that is not an HTTP token (-H @file reads headers from a file), a part name holding =, and a part content type other than a plain type/subtype; param=value (curl reads ;headers=@file after it) are left out with a warning.
  • Code snippets write every value as a string literal of the language (C# also escapes U+0085, U+2028 and U+2029, which end a line there).

Known fidelity limits

Snippets send the same request as rustman except in these cases:

  • node-axios adds Content-Type: application/x-www-form-urlencoded to a POST without a body.
  • js-fetch and node-axios send a text part that has a content type as a file part (a Blob), with a file name.
  • go escapes " in a part name differently (\" instead of %22).
  • A backslash in a part name is doubled in python-requests, python-httpx and go.
  • JavaScript reads a JSON body into numbers, so huge integers lose precision and -0 becomes 0.
  • File paths holding \, and URLs with invalid percent-escapes, may be read differently by each tool.

Secrets

Secrets are replaced by «redacted:<name>» unless --show-secrets is passed (a secret provider reference is never fetched: it is always printed as «redacted:<provider>/<path>[#field]»), as are the credentials in Authorization, Cookie and the other credential headers. In code snippets a credential header keeps its scheme, as in "Bearer «redacted:api_token»"; the curl snippet is exactly the rustman export curl command. Warnings go to stderr and never contain secret values.

Signature auth

Digest, AWS SigV4 and JWT auth are computed per request (from a server challenge or the current time), so they cannot be written as a fixed header. A snippet uses the language’s own helper where there is one:

AuthHelper
digest--digest -u in curl, --auth-type digest --auth= in httpie, --user/--password in wget, HTTPDigestAuth in python-requests, httpx.DigestAuth in python-httpx
aws_sigv4--aws-sigv4 'aws:amz:<region>:<service>' -u in curl
jwtnone

Otherwise the snippet starts with a comment naming the auth type, and stderr has a warning:

$ rustman export snippet --lang go aws/list-buckets --env prod
warning: snippet: aws_sigv4 auth cannot be precomputed for go
// aws_sigv4 auth: sign with the AWS SDK signer
package main
...

Placeholder mode

--placeholders keeps variables unresolved, to show how a request is built rather than one instance of it: {{name}} in curl, httpie and wget, and constants declared at the top of code snippets. Secrets are never read in this mode and always print as «redacted:<name>» (when the environment declares them), so --show-secrets cannot be combined with it.

# users/get.rman.yaml
version: 1
kind: http
name: get-user
url: '{{base_url}}/users/{{id}}'
$ rustman export snippet --lang python --placeholders users/get --env prod
import requests

BASE_URL = "https://api.example.com"
ID = "42"

response = requests.get(
    BASE_URL + "/users/" + ID,
)
print(response.status_code)
print(response.text)
$ rustman export snippet --lang httpie --placeholders users/get --env prod
http --ignore-stdin --follow -- GET '{{base_url}}/users/{{id}}'

A constant takes the variable’s value in the selected environment, or {{name}} when it has none.

Request kinds

kind: http, kind: graphql and kind: jsonrpc requests have snippets. A GraphQL request exports as the HTTP POST it sends: {"query", "operationName", "variables"} as JSON, with Accept: application/graphql-response+json, application/json. The document is never interpolated; its variables are. A JSON-RPC call or batch to an http(s) endpoint exports as its POST: the envelope (or the batch array) with explicit ids as written and sequential ids for the rest; a ws(s) endpoint or a subscription exits with code 2. Any other kind exits with code 2:

error: snippet: kind 'mcp' has no snippet export

Library use

The snippet engine lives in rustman-http (rustman_http::snippet), so the CLI, the TUI and generated docs share it: snippet(&resolved, lang, &options) renders one language from a resolved request, and resolve_placeholders resolves a request for placeholder mode. Each language is one minijinja template in crates/rustman-http/src/snippet/templates/ plus its quoting rules.

rustman docs code samples are this engine in placeholder mode, so a page shows byte for byte what rustman export snippet --placeholders prints with no environment selected, for requests that use no secret and no dynamic variable (docs also write secrets declared in any environment as «redacted:<name>» and keep {{$uuid}} as written; see API docs). custom_snippet(&resolved, lang, &options, template) renders a user template ([docs].template_dirs) over the same view; templates see the global docs_context_version (TEMPLATE_CONTEXT_VERSION). A Resolver built with keep_dynamics() writes {{$uuid}} and the other dynamic values back as written instead of evaluating them.

In the TUI, Alt+C or Copy as… in the palette copies the current request as a snippet through OSC 52; see Terminal UI.

Request history

Rustman keeps a local, redacted record of the exchanges it sends, so you can look back at what happened, search it and send a request again. rustman send, rustman run and rustman history replay all record; later front-ends (the TUI and the agent interface) read the same store.

What is recorded

Every request that was resolved and sent is recorded as one exchange, whether it got a response or failed with a network, TLS or timeout error. A request that never left (an unresolved variable, a --bail skip, Ctrl+C before it was sent) is not recorded. An exchange holds:

  • id: a ULID, so ids sort by time;
  • timestamp (RFC 3339, UTC), request (the request file relative to the workspace root, or adhoc for rustman send <METHOD> <URL>) and environment;
  • sent: the method, URL with its query, headers and text body as sent;
  • status, total_ms and error;
  • record: the response (status, headers, body), timings, redirects, assertion results and captures, as in a JSON report; for a GraphQL request also graphql, with the operation, its redacted variables, the result status and a subscription’s events (see GraphQL); for an MCP request also mcp, with the server, transport, protocol version, method, redacted params, the result or error and up to 200 notifications (see MCP client); when the request carried trace context, also trace, with the trace and span ids, the backend’s trace id, the redacted tracestate and baggage, and the link, and the response’s Server-Timing metrics as exchange.server_timings (see Trace propagation); rustman history show prints the trace lines after the assertions;
  • spill: for a body too large to keep in memory (see [http] max_body_bytes in HTTP requests), the file under .rustman/bodies/ that holds it; record then keeps only its start;
  • replay: the request as rustman history replay sends it again (see Replay).

Each exchange is one JSON file, .rustman/history/<id>.json, with "schema": "rustman.history/v1".

Where it is stored

  • Inside a workspace: .rustman/history/, next to the cookie jars and persisted captures. .rustman/ must be git-ignored (rustman init adds it to .gitignore); Rustman refuses to write there otherwise, as it does for secrets.
  • Ad-hoc requests sent outside any workspace: <data_dir>/rustman/history/, where <data_dir> is $XDG_DATA_HOME (or ~/.local/share) on Linux, ~/Library/Application Support on macOS and %APPDATA% on Windows. Set RUSTMAN_DATA_DIR to use another folder ($RUSTMAN_DATA_DIR/history/).

rustman history uses the workspace found from the current folder (or --workspace DIR), and the ad-hoc history outside any workspace.

Turning it off

# rustman.toml
[workspace]
name = "shop"
version = 1

[history]
# Record exchanges (default: true).
enabled = true
# How many exchanges to keep (default: 500).
max_entries = 500

--no-history on rustman send, rustman run and rustman history replay skips recording for that command only.

Retention

After each write, the oldest exchanges beyond max_entries are deleted, then their spilled bodies, along with any spilled body no entry refers to that is more than an hour old. On Windows, a file another program holds open right now is kept silently and deleted by a later write. rustman history clear deletes every exchange and every spilled body in .rustman/bodies/.

Entries are readable by the current user only, like the secrets file: mode 0600 on Unix, and on Windows the current user’s grant without inherited permissions. Writes are safe across parallel runs and processes: each exchange is written to a temporary file, flushed to disk and renamed into place, so readers never see half an entry, and pruning holds an exclusive lock on .rustman/history/.lock. An entry that cannot be read (a file damaged by hand, say) is skipped with a warning: instead of failing the listing.

Redacted at rest

History is written through the same redaction as every other output (see Environments, variables and secrets): secret values become «redacted:<name>», and the values of the Authorization, Proxy-Authorization, Cookie and Set-Cookie headers become «redacted:<Header-Name>», including when a server echoes them back. --show-secrets never changes what is stored.

Listing and searching

rustman history list prints one line per exchange, newest first: id, time, method, URL, status and total time. The status is the HTTP status; an exchange without one (a plugin request kind) shows its recorded outcome, passed or failed, and one that got no response shows error.

FlagKeeps
--status <code|class>that status (404) or class (5xx)
--method <m>that method, ignoring case
--grep <text>exchanges whose URL, request body or response body contains the text, ignoring case (only the stored start of a spilled body is searched)
--since <duration>exchanges from the last 30s, 15m, 1h, 2d or 1w
--limit <n>the newest n matches (n is at least 1)
--json(output) a JSON array of {id, timestamp, request, environment, method, url, status, total_ms, error}

rustman history show <id> prints one exchange in full (--json prints the stored entry). Ids can be shortened to any unique, non-empty prefix. An entry that cannot be read fails with error: cannot read history entry <path>: <reason> (exit code 2).

Replay

rustman history replay <id> sends the stored request again and records it as a new exchange. It takes --body-only, -o FILE, --show-secrets and --no-history like rustman send, and prints the response the same way. The stored request has {{name}} placeholders where secrets were, and replay reads them from the secret store at that moment: a rotated secret is sent with its new value, and a deleted one fails with unresolved variable(s): <name> before anything is sent. A value from a secret provider (a {{secret:...}} reference, or an environment variable backed by one) is fetched again from its provider, as rustman send would. There are no assertions on a replay; a response is a pass (exit code 0). A request signed by a plugin auth scheme is signed again, so replay loads the workspace plugins under the same trust rule as rustman send (--trust-plugins in CI).

Some exchanges cannot be replayed, because what they sent is deliberately not kept:

  • a sensitive header (Authorization, Cookie…) or an auth credential written literally instead of through a secret variable (only a scheme such as Bearer may be written around the secret);
  • a multipart or file body;
  • a GraphQL subscription (its WebSocket or event stream is not a plain exchange);
  • a value derived from a secret: a captured value that contained a secret (see Captures). History stores {{<var>}} in its place, or, if any other stored part still held a secret, nothing but the method.

Replaying one of them fails with this exchange cannot be replayed: ...; send the request from its file instead. An MCP operation keeps no request to replay at all (it is sent over an MCP session, not as a plain exchange): replaying it fails with history entry <id> holds no request to replay.

Example

A workspace with a secret token, and a request that uses it:

# environments/dev.yaml
variables:
  base_url: http://localhost:8080
secrets:
  - api_token
# users/me.rman.yaml
version: 1
kind: http
name: me
url: '{{base_url}}/me'
headers:
  - name: Authorization
    value: 'Bearer {{api_token}}'

Send it, find it in history, and replay it:

$ rustman send me --env dev --body-only
{"id":42}
$ rustman history list
01JD8X3F6W2N7Q4R5S6T7V8W9X  2026-11-17T09:30:00.123Z  GET http://localhost:8080/me  200  3 ms
$ rustman history replay 01JD8X3F6W2N7Q4R5S6T7V8W9X --body-only
{"id":42}
$ rustman history list --status 2xx --since 1h --limit 1
01JD8X4A1B2C3D4E5F6G7H8J9K  2026-11-17T09:31:12.456Z  GET http://localhost:8080/me  200  2 ms

The stored entries show Authorization: «redacted:Authorization», and their replay part holds Bearer {{api_token}}. Once the secret is deleted, replay stops before sending:

$ rustman secret rm api_token --env dev
removed secret 'api_token' from environment 'dev'
$ rustman history replay 01JD8X3F6W2N7Q4R5S6T7V8W9X
error: unresolved variable(s): api_token (secret not set; run 'rustman secret set api_token --env dev')
$ rustman history clear
deleted 2 exchanges from history

Exit codes

history list, show and clear exit 0, or 2 on a bad flag, an unknown id or an unreadable store. history replay exits like rustman send: 0 with a response, 3 when the request could not be completed (including an unresolved secret or an exchange that cannot be replayed), 130 on Ctrl+C. See the CLI reference.

Importing collections

rustman import turns collections exported from other tools into request files, _collection.yaml files and environments in the current workspace. It never writes a secret into a workspace file, never runs a script, and reports exactly what it could not carry over.

This build reads Postman Collection v2.0 and v2.1 exports and Postman environment exports, Insomnia v4 (JSON) and v5 (YAML) exports, Bruno collection folders, HAR 1.2 captures and .http / .rest files. Single curl commands have their own command, rustman import curl, and so do OpenAPI documents, rustman import openapi, which is not detected by rustman import <src>. Other formats can come from a workspace importer plugin: rustman import <format> <src>.

rustman import <src>                    # detect the format from the content
rustman import auto <src>               # the same
rustman import postman <src>            # a Postman Collection v2.0 / v2.1 export
rustman import postman-env <src>        # a Postman environment export
rustman import insomnia <src>           # an Insomnia v4 JSON or v5 YAML export
rustman import bruno <dir>              # a Bruno collection folder (or one .bru file)
rustman import har <src> [filters]      # a HAR 1.2 capture
rustman import http <src>               # a .http / .rest file, or a folder of them

Options (the same for every form):

FlagEffect
--into <dir>The collection folder to write into. It must be inside the workspace. Default: a folder at the workspace root named after the slug of the source collection (Billing API → billing-api/).
--dry-runConvert everything and print the planned files, the secrets that would be moved and the report, without writing any workspace file or keychain entry.
--on-conflict skip|overwrite|renameWhat to do with a file that already exists (default skip). See Re-importing.
--report <file>Also write the report as JSON (rustman.import-report/v1). Parent folders are created. A dry run writes this file and the migration report, nothing else.
--migration-report <file.md>Also write the script migration report as Markdown. Parent folders are created.
--max-size <size>Refuse larger sources (default 100M; bytes, or with K, M or G). For a folder, every file read counts toward the limit.
--fail-on-unsupportedExit with 1 when a feature was unsupported, dropped or unmapped.
--env <name>The environment that receives secrets moved out of requests (default: RUSTMAN_ENV, then default_environment).
--workspace <dir>The workspace (default: search upwards from the current directory).

Running outside a workspace fails with no rustman workspace found (run 'rustman init'); --into ../elsewhere fails with import: --into must be inside the workspace. Both exit with 2.

Format detection

auto (and a bare rustman import <src>) looks at the content, never the file name:

SourceRecognized by
Postman collectioninfo.schema (https://schema.getpostman.com/json/collection/v2.1.0/collection.json, or v2.0.0)
Postman environment_postman_variable_scope: environment
Insomnia v4_type: export and __export_format: 4
Insomnia v5a top-level type: collection.insomnia.rest/5.x line
HARa JSON object with log.entries
Brunoa folder with bruno.json; a single file with a meta { block and a request block
HTTP filea request line such as GET https://... (not JSON); a folder holding .http or .rest files

Anything else fails with exit code 2:

error: import: cannot detect format of data.json (expected postman, insomnia, bruno, har, http)

Postman collections

PostmanRustman
FoldersNested folders (collections), each with a _collection.yaml holding its name and the item order as order:
Itemskind: http request files: method, URL, query, headers, body, auth
Collection and folder authauth in _collection.yaml, inherited by the requests inside
Collection variablesvariables in the root _collection.yaml (secret ones are moved, see below)
Folder variable listsDropped, each reported as folder variable <name> dropped: Postman ignores folder-level variables: the v2.1 schema allows them, but Postman never resolves them (a request in the folder gets the collection’s value), so importing them would change which value is sent
Path variables (/users/:id)/users/{{id}}, with id under the request’s variables. Path variables are a namespace of their own in Postman: when the name is also used elsewhere (a collection variable {{id}}, an auth field), the path variable is renamed (path_id, path_id_2, …) so it never shadows the other
Disabled headers, query parameters, form fields and variablesDropped, and listed in the report
noauth on a requestauth: {type: none} (turns inherited auth off)
inherit on a request or folderNo auth (inherits the parent’s auth)

Body modes:

Postman body modeRustman body
raw, language JSON (or no language and a JSON Content-Type)type: json, with the text kept byte for byte, so unquoted placeholders such as {{$timestamp}} survive
raw, any other languagetype: text
urlencodedtype: form
formdatatype: multipart; file parts keep their path, made relative to the request file when it is inside the workspace. A path outside the workspace keeps only its file name, with a review note.
filetype: file
graphqlA kind: graphql request file with endpoint, document and variables. Variables that are not a flat JSON object are kept as a # graphql-variables: comment, with a review note.

Auth types basic, bearer, apikey (header or query) and oauth2 with the client-credentials or authorization-code grant (with or without PKCE) map to the auth helpers. Any other type (hawk, digest, awsv4, ntlm, OAuth2 implicit or password grants, …) is written as auth: {type: none} and reported as <type> auth unsupported with the item path. Writing none rather than leaving auth out matters: a request without auth inherits the folder or collection auth, and Postman would never have sent that parent credential to this host. A token Postman cached for OAuth2 is never carried over: Rustman fetches its own.

Postman environments

rustman import postman-env staging.postman_environment.json (or auto-detection) writes environments/<slug>.yaml. Variables Postman marks secret, and variables whose name looks like a secret, are listed under secrets; their values go to the secret store, never into the file:

# environments/staging.yaml
variables:
  base_url: https://staging.billing.example.com/v1
secrets:
  - api_key

An existing environment file is merged: new variables and secrets are added, and existing ones follow the conflict policy.

Insomnia exports

rustman import insomnia export.json reads an Insomnia v4 JSON export (Preferences → Data → Export, “Insomnia v4”); export.yaml in the v5 YAML format of recent versions is read the same way.

InsomniaRustman
Workspace / collectionThe collection folder (_collection.yaml with its name and description)
Request groups (folders)Nested folders, in Insomnia’s sort order (metaSortKey / meta.sortKey); folder environment values become variables, folder headers and auth are inherited
Requestskind: http request files: method, URL, query parameters, headers, body, auth
GraphQL requests (application/graphql body)kind: graphql request files
Body application/json / other text, form, multipart, filejson / text, form, multipart, file
Auth basic, bearer, apikey, oauth2 (client credentials, authorization code), noneThe matching auth helper; other types are written as auth: {type: none} (so no parent credential is inherited) and reported as <type> auth unsupported
Pre-request and after-response scripts# imported-script comments, never executed
gRPC and WebSocket requestsLeft out, reported as unsupported
Disabled headers, parameters and form fieldsDropped, and listed in the report

Environments are flattened: each sub-environment becomes environments/<slug>.yaml holding the base environment’s values with the sub-environment’s overrides (a base host overridden by Prod gives environments/prod.yaml with Prod’s host). A base environment without sub-environments becomes an environment of its own. Values that are objects or arrays become one variable per leaf, named as Insomnia templates reference them: {"auth": {"token": "..."}} gives auth.token (so {{ _.auth.token }} becomes {{auth.token}}) and {"hosts": ["a"]} gives hosts[0]. Each leaf is checked for secrets on its own, so auth.token is moved to the secret store. Every value set by an environment marked private (isPrivate: true) is a secret whatever its name, like the values of http-client.private.env.json: it goes to the secret store and is listed under secrets without a value. Base-environment values a private sub-environment does not override stay plain. Sub-environments whose names give the same file name (Prod and prod) are kept apart: the later one is imported as prod-2, and the report says so (this holds for every source’s environments).

{{ _.name }} becomes {{name}}. Template tags other than plain variables ({% response ... %}, {% uuid %}, {% now %}) have no Rustman equivalent: they are kept as written and each is reported once per request as unsupported template tag: <tag>, with the request’s item path.

Bruno collections

rustman import bruno <folder> (or a bare rustman import <folder> with a bruno.json in it) reads a Bruno collection folder. The collection is named after bruno.json’s name.

BrunoRustman
FoldersNested folders; folder.bru gives the name, order (meta.seq), headers, auth, variables and scripts. Symbolic links to folders are not followed (reported as symlinked folder <path> skipped), and folders nested deeper than 32 levels are an error
collection.bruThe collection’s _collection.yaml: headers, auth (auth { mode: ... }), variables, scripts
.bru request fileskind: http request files, ordered by meta.seq, then file name
Method block (get, post, …)Method and URL; body: and auth: select the body and auth blocks
params:query, params:pathQuery parameters; /users/:id becomes /users/{{id}} with id under the request’s variables (renamed path_id when id is used elsewhere, as for Postman)
headersHeaders (entries starting with ~ are disabled: dropped and reported)
body:json, body:text, body:xml, body:form-urlencoded, body:multipart-form (@file(path) parts), body:graphql + body:graphql:varsjson, text, form, multipart, or a kind: graphql file
auth:basic, auth:bearer, auth:apikey, auth:oauth2; auth: none / inheritThe matching auth helper; other modes are written as auth: {type: none} (so no parent credential is inherited) and reported as unsupported
vars:pre-requestRequest variables
vars:post-response reading res.body...json captures (user_id: res.body.data.id → {var: user_id, from: json, path: $.data.id}); other expressions are reported
script:pre-request, script:post-response, tests# imported-script comments, never executed
docsdescription
environments/*.bruenvironments/<name>.yaml; vars:secret [ ... ] names are listed under secrets (Bruno never exports their values: set them with rustman secret set); a name listed there that also has a value in vars is a secret too, and its value goes to the secret store

assert entries map to declarative assertions:

Bruno assertionRustman assertion
res.status: eq 200status: 200
res.body.a.b: eq v / neq vjson: {path: $.a.b, equals: v} / not_equals
res.body.a: gt n / lt njson: {path: $.a, gt: n} / lt
res.body.a: contains vjson: {path: $.a, contains: v}
res.body.a: isDefinedjson: {path: $.a, exists: true}

Operands are read as JSON when they parse (200, "ok", true), and as strings otherwise. Any other assertion (on headers, res.status with an operator other than eq, matches, …) is reported as unsupported with its line.

A .bru file that does not follow the grammar fails the import with exit code 2 and the line: import: shop/users/get.bru: line 10: block `headers` is not closed.

HAR captures

rustman import har capture.har imports each entry of a HAR 1.2 capture (browser developer tools → “Save all as HAR”) as a request file, in a folder per host (api-example-com/). The file is read one entry at a time, and response bodies are never read into memory or written anywhere.

Flag (repeatable)Keeps
--host <host>Requests to this host (api.example.com, or with its port)
--method <method>Requests with this method
--content-type <type>Requests whose request body or response has this MIME type (application/json)
--include-staticImages, fonts, stylesheets and scripts too

Without --include-static, static assets (by response MIME type image/*, font/*, text/css or JavaScript, or by URL extension such as .png, .css, .js, .woff2) are dropped, each listed in the report as static asset dropped: GET https://cdn.example.com/app.css. Entries with the same method, URL (query parameters in any order) and body are imported once; the report counts the duplicates and the entries left out by the filters. The filters are only accepted by rustman import har.

Query parameters come from the URL as written (still percent-encoded); the entry’s queryString list, which browsers fill with the same parameters decoded, is used only when the URL has no query, so parameters are never doubled.

Transport and browser-managed headers are not written: Host, Content-Length, Connection, Transfer-Encoding, Accept-Encoding, Keep-Alive, Upgrade, TE, Trailer, HTTP/2 pseudo-headers (:authority, :path, …) and sec-* headers. Cookie and Authorization values are moved to secrets like any other credential.

HTTP files

rustman import http api.http reads a .http or .rest file (JetBrains HTTP Client and VS Code REST Client); a folder imports every .http and .rest file in it, one folder per file.

@api_version = v1

### List items
GET {{host}}/{{api_version}}/items
Accept: application/json

###
# @name create-item
POST {{host}}/{{api_version}}/items
Content-Type: application/json

{"name": "lamp"}
  • Requests are separated by ### lines; the text after ###, or a # @name / // @name comment, names the request (default: METHOD /path).
  • The request line is METHOD URL [HTTP/version] (a bare URL is a GET); ? and & lines right after it continue the query. Headers follow up to a blank line, and the body after it.
  • Bodies are json (by Content-Type, or a body starting with { or [ when there is none), form (application/x-www-form-urlencoded), file (< ./path) or text.
  • @name = value lines become the collection’s variables.
  • JetBrains response handlers (> {% ... %}) are kept as # imported-script comments and never executed; handler files (> ./script.js) are reported as unsupported.

Environments come from the files next to the .http file (or in the folder):

FileBecomes
http-client.env.jsonenvironments/<name>.yaml variables
http-client.private.env.jsonSecrets of those environments (values go to the secret store)
.vscode/settings.json, rest-client.environmentVariablesenvironments/<name>.yaml variables

$shared values apply to every environment that does not set them. Values that are objects (such as JetBrains auth settings) are reported as unsupported. As everywhere, variables whose name looks like a secret are moved to the secret store.

Variables

{{name}} placeholders stay as they are. Dynamic variables are translated: {{$guid}} and {{$randomUUID}} become {{$uuid}}; {{$timestamp}}, {{$randomInt}} and Rustman’s own dynamic variables stay. Any other ({{$randomCity}}) is kept unchanged and reported as unmapped dynamic variable $randomCity.

Secret references from the source

A source cannot name your secrets. A secret reference ({{secret:...}}) found in an imported document is written escaped, as \{{secret:...}}: literal text that is sent as written and never reads a provider secret. This covers every source (Postman, Insomnia, Bruno, HAR, HTTP files), every field that takes templates (URLs, headers, bodies and GraphQL variables, auth including OAuth2 scopes, variables, environments, assertion values), and references a translation produces (Insomnia {{ _.secret:vault/x }}). Each one is listed in the report as a review note:

review: secret reference {{secret:vault/kv/prod/db#password}} from the source neutralized: it is kept as literal text and never resolved (evil.json > Leak)

If you trust the source and want the reference, remove the backslash by hand. Plain {{name}} placeholders, and references the source already escaped, are left as they are. Files returned by an importer plugin get the same treatment.

Secrets

Before anything is written, the importer looks for secrets in three passes.

1. Named fields. A literal value is a secret in:

  • Authorization, Proxy-Authorization and Cookie headers, headers whose name looks like a secret (X-API-Key) or ends in -auth, -token, -key, -secret or -signature (any case: X-Custom-Auth), and headers whose value starts with an auth scheme (see below);
  • query parameters, form fields and multipart text parts whose name looks like a secret (HAR multipart bodies exported as raw text, as Chromium does, are split into parts first);
  • "key": "Basic dTpw..." (any auth scheme, see below) under any key of a JSON body: the scheme stays and the credential moves;
  • the password (or token) in the userinfo of a URL, of a request URL or of any variable holding one (postgres://admin:p4ss@db/x): https://admin:p4ss@host becomes https://admin:{{url_password}}@host, and a variable db_url gets {{db_url_password}};
  • "key": "value" pairs of JSON, raw and GraphQL-variables bodies (also every string of a "key": [...] array, and numbers of four digits or more such as "pin": 12345678), and key=value pairs of form-encoded raw bodies, whose key looks like a secret ("password": "{{password}}");
  • basic passwords, bearer tokens, API-key values and OAuth2 client secrets (a cached OAuth2 access token is dropped and reported: Rustman fetches its own);
  • collection, folder, request (Postman path variables, Bruno vars:pre-request) and environment variables whose name looks like a secret, whose value starts with an auth scheme, or that the source marks secret (Postman type: secret, Bruno vars:secret, Insomnia private environments, http-client.private.env.json);
  • literal values that scripts give to secret-named variables, headers or keys (pm.environment.set('apiSecret', '...'), req.setHeader("Authorization", "Bearer ..."), const apiKey = '...', secret = '...'), and the literal passed to btoa(...) or atob(...) (a Basic credential, stored as basic_credentials).

A name looks like a secret when it matches token|secret|password|passwd|api[_-]?key|client[_-]?secret (case-insensitive); or names a session, cookie, credential, bearer, JWT, access or private key, a signature, passcode or passphrase; or is exactly auth, key, sid, code or auth_code (OAuth authorization codes); or ends in sig, pass or otp (X-Sig); or has pwd, pass, passwd, pin, otp, sid, verifier, csrf or xsrf as a whole segment, split at punctuation and lowercase-to-uppercase changes (X-Pwd, pinCode, code_verifier; spinner and bypass stay plain). A variable or header value that starts with an auth scheme and a credential (Bearer, Basic, Digest, Token, ApiKey, Bot, SSWS, Negotiate or NTLM, any case) is a secret whatever its name; in a header the scheme stays and only the credentials move (X-Client: Token {{x_client}}).

2. Well-known tokens, everywhere. Every text the import writes is scanned for tokens of these formats, whatever field holds them: URLs (paths included), query parameters, headers, bodies, auth fields, variables, request, folder and collection names, descriptions (Bruno docs included), and string literals in scripts. The formats are GitHub (ghp_, gho_, ghu_, ghs_, ghr_, github_pat_), GitLab (glpat-), Slack (xoxa-, xoxb-, xoxp-, …), Stripe live keys (sk_live_, rk_live_), AWS access key ids (AKIA/ASIA and 16 characters), Google API keys (AIza and 35 characters), JWTs (three base64url segments starting eyJ) and PEM private-key blocks. Tokens are also found when percent-encoded (-----BEGIN%20RSA%20PRIVATE%20KEY-----...). Each is stored under a name for its kind (github_token, jwt, aws_access_key, google_api_key, private_key, …).

3. Repeats. Every value moved by the first two passes is then looked for where it repeats in those same texts (another header, the URL path or query, a body, a name or description, an environment variable): as written (raw, also when the value itself holds {{) and, for secret-like values, encoded (percent-encoded in upper or lower case, JSON-escaped with or without \/, HTML-escaped). A value is secret-like when it has at least 8 characters and either comes from at least two of the classes letters, digits and symbols, or has 16 characters or more (p4ssw0rd!, sk-live-42ab, 8473629184736291, a 32-letter token; not password, 123456, example or application). Placeholders are substituted raw when a request is sent, so a repeat becomes {{name}} only where that sends the same bytes under every environment.

A secret moved from the collection itself (stored in the import’s target environment, which the collection’s own placeholders already use) is collection-scoped; a secret of a source environment file (Postman, Insomnia, Bruno, http-client.env.json environments) is environment-scoped: it resolves only while that environment is active.

In requests, collections and folders:

  • a raw repeat of a collection-scoped secret-like value that fills the whole field, or sits on token boundaries (no letter or digit right before or after it), becomes {{name}} (X-Note: SAME-VAL-42 → X-Note: {{x_api_key}}, /keys/SAME-VAL-42?x=1 → /keys/{{x_api_key}}?x=1). A value of a well-known token shape (GitHub, JWT, AWS, Slack, Stripe, Google, PEM) is matched anywhere, also right after letters (abcghp_... → abc{{github_token}});
  • an encoded repeat of a collection-scoped secret-like value (Pa\"ss in a JSON string, ab%2Fcd in a path, p%40ss in a form body), or a raw one inside a longer word (myPassw0rd!), becomes the literal «redacted:name», since {{name}} would send different bytes (invalid JSON, an extra path segment, an extra form field). The report says request <file > item>: field <field> contained secret <name> in encoded form; it was redacted, edit the field to use {{name}} (or inside other text);
  • any repeat of an environment-scoped secret-like value becomes «redacted:name», since {{name}} would send another value, or none, under another environment. The report says request <file > item>: field <field> repeated secret <name> of environment <env>; it was redacted, edit the field;
  • after these, each field is also read percent-decoded (+ as a space), JSON-unescaped (\uXXXX too) and HTML-unescaped; when one of these readings still shows a secret-like value (a partly or differently encoded repeat such as p%40ss&w0rd=1, my+secret+pass, p\u0040ss), the whole field becomes «redacted:name», with the in encoded form note.

In environment files, a raw secret-like repeat of that same environment’s secret, as the whole value or on token boundaries, becomes {{name}} (cb_url: https://x.test/cb?t={{token}}); an encoded or in-word repeat of it, and any repeat of another environment’s secret, becomes «redacted:name» with a note, as above.

Everywhere, a repeat of a value that is not secret-like is left as written, and the report gets a review note the value of secret <name> also appears in <file > item>:<field>; review it, never showing the value. So a Basic password password leaves grant_type=password and /password/reset alone, and a secret 123456 leaves zip=123456 and api.123456.com alone. In free text (names, descriptions) every replacement is «redacted:name»; names and file names change only for secret-like values.

Values shorter than 6 characters or longer than 16 KiB are not looked for. Environment files only get the first rule, and only with the secrets of that same environment: a plain variable whose whole value is one of its environment’s secrets becomes that secret’s placeholder; nothing else in an environment file changes.

Outside repeats, a value moved from a field that takes templates (URLs, headers, bodies, auth, variables) becomes the {{name}} placeholder; in free text (names, descriptions, report notes and locations) it becomes «redacted:name». In scripts, which are kept as written and never run, every moved value is shown as «redacted:name», as in the report’s unconverted statements. For example Authorization: Bearer eyJhbGciOi... becomes Authorization: Bearer {{authorization_token}}, and a description Use key ghp_... becomes Use key «redacted:github_token». Values that are already placeholders are left alone. The printed summary and the --report file are checked once more for secret-like values before they are written.

Variables keep their scope: a folder variable (Insomnia, Bruno) moved under another name (password_2, because the collection’s password holds another value) is renamed only in that folder’s requests and subfolders, not where the collection’s password applies, and not below a subfolder or request that declares password again. A new secret name never takes the name of any variable declared anywhere in the source (collection, folders, requests, environments) other than the variable being moved, nor any name the source references as {{name}} without declaring it (such a reference is meant to come from your own environment): with a plain collection variable token_2, a folder’s moved token becomes token_3, so no placeholder resolves to another variable.

The target environment is --env, else the active one. Without either, secrets go to a new environment named after the collection (environments/billing-api.yaml), and the report says so. A name already used in that environment is reused only when it holds the same value; otherwise the next free name (token_2) is used, so an import never replaces a stored secret.

Secret values are stored in the OS keychain, or .rustman/secrets.yaml when there is none (see Secret storage). The report lists every moved secret by name, environment and source location, never by value, and there is no option to keep secrets inline: the only way to put a literal secret into a file is to edit it by hand. As a last guard, the writer refuses any file whose secret fields still hold a literal value. Values that look like secrets (24 characters or more, letters and digits, no spaces) but are kept as plain variables are listed as review notes, by name only.

Known limits: outside the named fields above, only well-known token formats and repeats of moved values are found, so some secrets are written as they are. Review these by hand after an import:

  • XML bodies and other raw text that is neither "key": "value" nor key=value (<password>p4ss</password>), and literals inside a GraphQL query document (login(password: "p4ss"); GraphQL variables are scanned);
  • descriptions and docs, beyond well-known tokens and repeats of moved values;
  • bare base64: a secret that appears base64-encoded without an auth scheme (X-B64: UzNjcjN0LVBhc3Mh, a token inside a base64 blob) is not found and is written as it is. A Basic <base64> value is found by its scheme;
  • repeats in encodings other than percent-encoding, JSON escaping and HTML escaping;
  • repeats of values that are not secret-like (password, 123456), which are only reported;
  • string literals in scripts that are not given to a secret-named variable, header or key, btoa or atob, and are not a well-known token: the script is kept as written and only a review note points at it;
  • expected values in assertions suggested from scripts (pm.expect(body.token).to.eql("...")), which are written as checks.

Scripts

Pre-request and test scripts are never executed. Each is kept verbatim (any moved secret value redacted) in an # imported-script comment block at the top of the request file, or of _collection.yaml for collection and folder scripts, and the report lists it as script not executed.

Statements in the mapping table below are also written as declarative entries (Bruno assert blocks are mapped as described in Bruno collections). Statements are found without running anything: the script is split at ;, line breaks and block braces (the callback of pm.test("...", () => ...) or function () { ... } counts as its inner statements), whitespace outside strings is ignored, and 'single' and "double" quotes are the same.

Script statementWritten as
pm.response.to.have.status(201), pm.expect(pm.response.code).to.eql(201) (or .equal)status: 201
pm.response.to.be.okstatus: "2xx"
pm.response.to.have.header("ETag")header: {name: ETag, exists: true}
pm.response.to.have.header("Content-Type", "application/json")header: {name: Content-Type, equals: application/json}
pm.expect(pm.response.responseTime).to.be.below(300)latency: {total_lt: 300}
pm.expect(pm.response.text()).to.include("done")body: {contains: done}
const body = pm.response.json() (or let, var)Tracked: body.a.b then means $.a.b
pm.expect(body.user.id).to.eql(42) (or .equal, .deep.equal)json: {path: "$.user.id", equals: 42}
pm.expect(body.user.id).to.not.eql(0)json: {path: "$.user.id", not_equals: 0}
pm.expect(body.user).to.existjson: {path: "$.user", exists: true}
pm.expect(d.items[0].tags).to.have.lengthOf(2), pm.expect(d.items.length).to.eql(2)json: {path: "$.items[0].tags", length: 2}
pm.expect(body.name).to.be.a("string") (or .an)json: {path: "$.name", type: string}
pm.expect(body.total).to.be.above(0) / .below(9)json: {path: "$.total", gt: 0} / lt: 9
pm.expect(body.roles).to.include("admin")json: {path: "$.roles", contains: admin}
pm.environment.set("v", <source>), pm.globals.set(...)A capture with persist: true
pm.collectionVariables.set("v", <source>), pm.variables.set(...)A capture without persist

A setter’s <source> maps when it is pm.response.json().a.b or a tracked alias path (from: json, path: $.a.b), pm.response.headers.get("ETag") (from: header, name: ETag) or pm.cookies.get("sid") (from: cookie, name: sid). pm.response.json() may also be used directly in place of an alias, and paths may use [0] and ["key"] segments.

Everything else stays comment-only. The summary counts the statements:

scripts: 31/40 statements converted (77%)

The percentage is rounded down. The JSON report has the same counts under migration (found, mapped, unconverted, percent), and per request its file path, counts and unconverted statements (any moved secret value redacted).

Script migration report

--migration-report <file.md> writes a Markdown report with one section per request that has unconverted statements. Each row shows the statement, the request file and a suggestion:

StatementSuggestion
pm.expect(pm.response.json().items.every(i => i.price > 0)).to.be.trueA schema assertion with items.price constrained by exclusiveMinimum: 0, with the inline schema to paste (>=, < and <= give minimum, exclusiveMaximum and maximum)
postman.setNextRequest("checkout")no declarative equivalent; consider a plugin, plus a pointer to order: in _collection.yaml for run order
anything elseno declarative equivalent; consider a plugin

Moved secret values are redacted in the report, as everywhere else.

File names

Files are named after the slug of the item name (lowercase ASCII letters and digits, - between words, at most 64 characters) plus .rman.yaml. Items with the same slug in one folder get -2, -3 suffixes in source order (Get User and get user! become get-user.rman.yaml and get-user-2.rman.yaml). Every generated path, relative to the workspace root and including the collection folder (--into), is at most 180 characters and 20 levels deep, so that it stays under Windows’ 260-character MAX_PATH with up to 80 characters left for the workspace root. A source whose names or nesting go beyond that fails before anything is written (exit code 2) with generated path too long (<n> characters, limit 180): <path>, the path shortened to its first 40 and last 30 characters; shorten the names, flatten the folders or pass a shorter --into. Paths are never silently truncated. Everything is written with the workspace’s deterministic emitter, so importing the same source into two empty workspaces gives byte-identical trees.

Re-importing

When a target file already exists, --on-conflict decides:

PolicyRequest files_collection.yamlEnvironment variables
skip (default)kept, reported skipped (exists)keptkept
overwritereplaced, reported overwrittenreplacedreplaced
renamewritten next to it with the next free suffix, reported renamed to <path>kept; renamed requests are appended to its order: (reported order extended with ...)kept

Imports into one workspace run one at a time: an import holds .rustman/import.lock from reading the workspace to writing the last file, and a second import waits for it, so neither loses the other’s changes to environments/<name>.yaml. A file whose content would not change is never rewritten or duplicated, under every policy: it is listed with the action unchanged, counted in skipped, summarized as unchanged: <n> files already up to date, and never reported as a conflict.

An import is all or nothing: every file is first written next to its target as a temporary .rmtmp file, then the secrets are stored, then the files are moved into place. If a write or the secret store fails, the temporary files and any folder made for them are removed and nothing is stored.

The report

Every import prints a summary:

imported Billing API (postman) into billing-api/
written: 11 requests, 4 collections, 1 environments; skipped: 0; dropped: 4; secrets moved: 9; unsupported: 1; unmapped: 1
3 scripts preserved as comments, not executed
scripts: 5/5 statements converted (100%)
secret: authorization_token -> environment 'local' (billing.json > Invoices / List invoices)
dropped: disabled header X-Debug dropped (billing.json > Users / List)
unsupported: hawk auth unsupported (billing.json > Invoices / Legacy export)
unmapped: unmapped dynamic variable $randomCity (billing.json > Users / Create)
script not executed: test (billing.json > Auth / Login)

--report <file> writes the same data as JSON, following schemas/import-report.schema.json: schema (rustman.import-report/v1), source, destination, dry_run, summary (the counts above), files (each planned file and its action), conflicts, secrets (name, environment, location), notes (kind, message and location: the source file plus the item path or line) and migration (the script statement counts).

Exit codes

CodeMeaning
0The import completed. Unsupported, dropped or unmapped features are reported but are not an error.
1--fail-on-unsupported and some feature was unsupported, dropped or unmapped.
2Unreadable, invalid, oversized (import: source exceeds 100 MiB (use --max-size)) or undetectable source; no workspace; --into outside the workspace.

Exporting

rustman export writes a collection folder or a single request file back out for other tools:

rustman export postman <path> [-o <file>]   # a Postman Collection v2.1 JSON
rustman export http <path> [-o <file>]      # a .http file

<path> is a collection folder (the workspace root too) or a request file inside the workspace. Without -o the result is printed on standard output; with -o it is written to the file (parent folders are created) and wrote <file> goes to standard error.

Secrets are exported as the {{name}} placeholders the request files hold, never as values: rustman export http api writes Authorization: Bearer {{token}} for a request whose bearer token is the secret token. As a further guard, any secret value of the active environment (--env) that appears in the output, for example pasted into a description, is printed as «redacted:<name>».

Features the target cannot hold are listed as warnings on standard error, such as warning: export: api/me.rman.yaml: 1 assertions not exported (no equivalent):

FeaturePostman v2.1.http
Folders, order, names, descriptionsKeptFlattened into ### blocks in run order; descriptions dropped
Collection and folder authKept on the folderWritten into each request that inherits it
Collection and folder headersWarningWritten into each request
VariablesCollection and folder variable lists (Postman ignores folder lists when it runs a request); request variables as URL variables ({{id}} path segments become :id)@name = value lines at the top (one value per name; a different later value is a warning)
Basic, bearer, API key authKeptAuthorization: Basic <user> <password>, Authorization: Bearer <token>, the key header or query parameter
OAuth2 authKeptWarning
Bodiesraw (JSON or text), urlencoded, formdata, file, graphqlAs text, form fields joined with &, multipart with < path file parts, < path for a file body, GraphQL as a JSON POST; a Content-Type is added when missing
# imported-script blocksBack to prerequest and test events (other sources’ scripts are a warning)Warning
Assertions, captures, settings, tagsWarningWarning
{{$uuid}}Written as Postman’s {{$guid}}Kept

Importing an exported Postman collection into an empty workspace gives byte-identical request files when the collection used no feature from the warnings above, so a Postman collection survives import → export → import unchanged.

The export goes through the same neutral IR as imports (rustman_import::export::collect reads the workspace into it, rustman_import::export::export writes the target).

Using the importer as a library

The pipeline lives in the rustman-import crate, so other front-ends and producers share it: a source parser builds the neutral IR (ImportedCollection: folders, requests, environments, notes with source locations), rustman_import::plan translates variables, extracts secrets, suggests assertions and lays out the files without writing anything, and rustman_import::apply stores the secrets and writes the files.

rustman_import::session::run runs a whole import the way a front-end without a command line needs it (detect, plan, and apply under the import lock unless it is a dry run) and returns the redacted summary; the TUI’s Import… palette action uses it (see Terminal UI).

OpenAPI import

rustman import openapi turns an OpenAPI document into a collection of request files: one folder per tag and one kind: http request per operation.

rustman import openapi petstore.yaml
rustman import openapi https://api.example.com/openapi.json --into apis/shop

It prints imported <n> operations into <dir> and one created environment '<name>' line per new environment on stdout, and every warning on stderr. --sync updates a collection imported earlier (see Sync). The behavior is specified in openspec/specs/openapi-import.

Supported documents

  • OpenAPI 3.0.x and 3.1.x, in JSON or YAML. The format is detected from the content, not the file extension: a document whose first character is { or [ is JSON, anything else is YAML.
  • Swagger 2.0 is rejected with exit code 2 and Swagger 2.0 is not supported; convert it to OpenAPI 3 first (e.g. with swagger2openapi). Nothing is written.
  • Any other openapi version, or a document without an openapi field, exits with 2.

OpenAPI 3.0 schemas are rewritten to their 3.1 (JSON Schema 2020-12) form when they are read: nullable: true becomes a "null" type (or an anyOf with {"type": "null"} when the schema has no type), and boolean exclusiveMinimum / exclusiveMaximum become numbers. A 3.0 document and its 3.1 equivalent import to the same result.

Sources

The source is a local path or an http(s) URL. A URL is fetched with the same HTTP engine as rustman send, with TLS verification on, a 30-second timeout and redirects followed. A document (or a referenced file) larger than 20 MiB is refused with exit code 2:

error: https://api.example.com/huge.json is larger than the 20 MiB limit

A URL that cannot be reached (DNS, connection refused, timeout, TLS) exits with 3, like other requests that could not complete.

References

  • Local references (#/components/schemas/Pet) are resolved.

  • References to files beside a local document (common/pet.yaml#/Pet, schemas/shared.json) are read and resolved, including the references inside them. They must stay in the root document’s directory or below: an absolute path, or one that climbs out of it with .. (or through a symlink), is refused with exit code 2 (reference '../shared.json' at ... leaves the document's directory), so an untrusted document cannot read other files.

  • References to other http(s) documents, and relative references in a document read from a URL, are refused with exit code 2 unless --allow-remote-refs is given:

    error: remote reference 'https://schemas.example.com/user.json' at /paths/~1users/get/responses/200/content/application~1json/schema is not resolved; pass --allow-remote-refs to fetch it
    
  • Circular references (a Node whose children are Nodes) are kept as references and never expanded.

Referenced files are copied into the imported model under components/x-rustman-external; at most 64 documents are read per import.

Diagnostics

The document is validated before anything is written. Each diagnostic names a JSON pointer:

warning: /paths/~1users/get: operation has no operationId; its request file is named from the method and path
error: /info/title: required string 'title' is missing

Errors stop the import with exit code 2, and nothing is written. They are: a missing info, info.title or info.version; a paths that is not an object (or is missing in 3.0); a path that does not start with /; an operation or path item that is not an object; a parameter without name or a valid in; and a $ref that points at nothing.

Warnings are printed and the import continues: a missing or duplicate operationId, an operation without responses, a path parameter that is not required or does not match the path template, and an example (or examples.*.value) that does not match its schema (the first violation is quoted).

The generated collection

The collection is a folder in the workspace root named after info.title in kebab-case, or the folder given with --into. That folder must not exist or must be empty; an existing collection is never overwritten. Files are written to a temporary folder first and moved into place, so a failed import leaves nothing behind.

swagger-petstore/
  _collection.yaml        # name, order of the tag folders, auth, source and its hash
  pets/
    _collection.yaml      # name and description of the tag, order of the requests
    list-pets.rman.yaml
    create-pet.rman.yaml
    show-pet-by-id.rman.yaml
  store/
    _collection.yaml
    get-inventory.rman.yaml
  untagged/               # operations without tags
    get-users.rman.yaml
environments/
  production.yaml         # one environment per server
.rustman/openapi/
  swagger-petstore.json   # the import snapshot (git-ignored)
  • Each operation goes to the folder of its first tag, or untagged.
  • A request file is named from the operationId in kebab-case (getPetByID → get-pet-by-id.rman.yaml), otherwise from the method and path (GET /users/{id}/posts → get-users-id-posts.rman.yaml). When two operations in a folder get the same name, the second is suffixed -2 (then -3, …) and a warning is printed.
  • The request’s name is the operationId (or METHOD /path), and its description is the operation’s summary and description.
  • The URL is {{baseUrl}} followed by the path, with every path parameter as a variable: /pets/{petId} becomes {{baseUrl}}/pets/{{petId}}.
  • Query and header parameters become query and headers rows whose value is a {{variable}} named after the parameter. Optional parameters are written disabled (enabled: false), so they are kept in the file but not sent. Accept, Content-Type and Authorization header parameters are ignored, as OpenAPI specifies.
  • Two tags record where the request came from: openapi:operationId=<id> and openapi:path=<template>. They let a later re-import match request files to operations.
version: 1
kind: http
name: showPetById
description: Info for a specific pet
tags:
  - openapi:operationId=showPetById
  - openapi:path=/pets/{petId}
method: GET
url: '{{baseUrl}}/pets/{{petId}}'

Variables such as baseUrl and petId come from environments, --var or captures, as for any request (see Environments).

Example bodies

An operation with a request body gets a body from the first JSON media type (application/json or any +json type), or the first media type when none is JSON. The value is, in order:

  1. the media type’s example;
  2. the value of its first examples entry;
  3. the schema’s own example (examples[0] or example) or default;
  4. a value synthesized from the schema.

The synthesizer follows $refs and builds a value that validates against the schema:

  • objects get their required properties (every property that is not readOnly when nothing is required); allOf members are merged, and oneOf/anyOf take the first branch that is not null;
  • const, then the first non-null enum value, then a nested example/default win over anything synthesized;
  • strings follow their format (date-time → 2024-01-01T00:00:00Z, email → user@example.com, uuid, uri, ipv4, …; otherwise string), padded with x to minLength (at most 4096 characters) and cut to maxLength;
  • integers and numbers start at 0 and move inside minimum/maximum, exclusiveMinimum/exclusiveMaximum and onto multipleOf; booleans are true;
  • arrays get one item (raised to minItems, lowered to maxItems);
  • objects and arrays stop at a nesting depth of 3: deeper ones are empty, so a circular schema (a Node whose children are Nodes) gives {children: [{children: []}]}.

JSON bodies are written as type: json, application/x-www-form-urlencoded as type: form and a string example of a text/* or XML type as type: text. When the media type is not the default of the body type (for example application/vnd.api+json), a Content-Type header is added. Other media types (such as multipart/form-data) get no body and a warning.

Environments

Each entry of servers becomes environments/<name>.yaml, named from its description in kebab-case (server-1, server-2, … without one). It defines baseUrl (the URL with each server variable replaced by its default, without a trailing /) and every server variable, and declares the auth secrets without values. A relative server URL is resolved against the document’s URL; in a local file it is kept as is, with a warning.

An environment file that already exists is never overwritten by an import: a warning says so, and --sync merges it instead.

Auth

components.securitySchemes become auth config. The document-wide security sets the auth of the collection’s _collection.yaml; an operation with its own security gets its own auth (type: none for security: []). The first alternative of a requirement is used.

SchemeAuthSecrets
http, basicbasic<scheme>_username, <scheme>_password
http, bearerbearer<scheme>_token
apiKey in header / queryapi_key in that location<scheme>_key
apiKey in cookieapi_key header Cookie: <name>={{<scheme>_key}}<scheme>_key
oauth2 with clientCredentials (else authorizationCode, sent with PKCE)oauth2 with the flow’s URLs and scopes<scheme>_client_id, <scheme>_client_secret

Credentials are always {{variables}} declared as secrets: no credential value is ever written to a file. Set them with rustman secret set. openIdConnect, mutualTLS, other http schemes (such as digest) and oauth2 with only the implicit or password flow are left unconfigured, with a warning:

warning: /components/securitySchemes/oidc: security scheme 'oidc' (openIdConnect) is not configured; set up its auth by hand

Secret references in the document

The document cannot name your secrets. A secret reference ({{secret:...}}) in a path or parameter name, an example body, a server URL or variable default, or a security scheme is written escaped, as \{{secret:...}}: literal text that is sent as written and never reads a provider secret. Each one gets a warning at its JSON pointer, in rustman import openapi (also with --sync) and in the import_openapi agent tool:

warning: /paths/~1leak/post: secret reference {{secret:vault/kv/prod/db#password}} from the document neutralized: it is kept as literal text and never resolved

Import snapshot

Every import stores the bundled, normalized document at .rustman/openapi/<collection>.json (<collection> is the collection folder’s path in kebab-case) and records where it came from in the collection’s _collection.yaml:

source:
  format: openapi
  location: shop.yaml
  sha256: '<the SHA-256 of the document text>'

location is the path relative to the workspace root, or the URL without any user:password@. The snapshot is the base of the next sync. It lives in .rustman/, which is git-ignored: a teammate who syncs a collection imported elsewhere imports it again into an empty folder instead.

Sync

rustman import openapi <src> --sync brings a collection imported earlier up to date with a new version of the document. It is a three-way merge: the snapshot is the base, the request files are local, the new document is remote. For each operation (matched by the openapi:operationId= tag, or method and openapi:path=):

  • a field (name, description, method, url, body, auth) takes the new value only when you have not changed it; when both changed, yours is kept and the operation is listed as a conflict, kept local;
  • query, headers and tags merge row by row: rows you added always stay, rows you deleted stay deleted, and new rows from the document are added;
  • settings, variables, assertions and captures are never touched;
  • new operations are written (new folders get their _collection.yaml, existing folders get the new requests in order);
  • removed operations are moved to <collection>/_removed/, never deleted. Folders whose name starts with _ are not run.

Environments are merged the same way, variable by variable, and the snapshot and source are replaced. A collection without a snapshot is not synced (exit code 2). --sync on a folder that does not exist or is empty is a plain import.

Every sync prints a summary; --json prints it as JSON (added, removed, changed, conflicts, unchanged, environments, dryRun), and --dry-run prints it without writing any file.

Walkthrough

# shop.yaml
openapi: 3.1.0
info:
  title: Shop
  version: '1'
servers:
  - url: https://api.example.com/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /pets:
    post:
      operationId: createPet
      tags: [pets]
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required: [name, age]
              properties:
                name: {type: string}
                age: {type: integer, minimum: 1}
      responses:
        '201': {description: Created}
  /pets/{petId}:
    delete:
      operationId: deletePet
      tags: [pets]
      parameters:
        - {name: petId, in: path, required: true, schema: {type: string}}
      responses:
        '204': {description: Deleted}
components:
  securitySchemes:
    bearerAuth: {type: http, scheme: bearer}
$ rustman import openapi shop.yaml
imported 2 operations into shop
created environment 'production'

The body is synthesized from the schema, and the token is a secret placeholder:

# shop/pets/create-pet.rman.yaml (generated)
version: 1
kind: http
name: createPet
tags:
  - openapi:operationId=createPet
  - openapi:path=/pets
method: POST
url: '{{baseUrl}}/pets'
body:
  type: json
  content:
    name: string
    age: 1
# environments/production.yaml (generated)
variables:
  baseUrl: https://api.example.com/v1
secrets:
  - bearerAuth_token

You edit the body:

# shop/pets/create-pet.rman.yaml
version: 1
kind: http
name: createPet
tags:
  - openapi:operationId=createPet
  - openapi:path=/pets
method: POST
url: '{{baseUrl}}/pets'
body:
  type: json
  content:
    name: Rex
    age: 3

The next version of the document adds an example, drops deletePet and adds listPets:

# shop-v2.yaml
openapi: 3.1.0
info:
  title: Shop
  version: '2'
servers:
  - url: https://api.example.com/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /pets:
    get:
      operationId: listPets
      tags: [pets]
      responses:
        '200': {description: OK}
    post:
      operationId: createPet
      tags: [pets]
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required: [name, age]
              properties:
                name: {type: string}
                age: {type: integer, minimum: 1}
            example: {name: Fido, age: 2}
      responses:
        '201': {description: Created}
components:
  securitySchemes:
    bearerAuth: {type: http, scheme: bearer}
$ rustman import openapi shop-v2.yaml --sync --dry-run
added: listPets (pets/list-pets.rman.yaml)
conflict: createPet body: kept local
removed: deletePet (moved to _removed/delete-pet.rman.yaml)
environment production: updated
1 added, 0 changed, 1 removed, 1 conflict, 0 unchanged (dry run: nothing was written)
$ rustman import openapi shop-v2.yaml --sync
added: listPets (pets/list-pets.rman.yaml)
conflict: createPet body: kept local
removed: deletePet (moved to _removed/delete-pet.rman.yaml)
environment production: updated
1 added, 0 changed, 1 removed, 1 conflict, 0 unchanged

Your body is kept, deletePet is in shop/_removed/, and the environment points at the new server:

# environments/production.yaml (generated)
variables:
  baseUrl: https://api.example.com/v2
secrets:
  - bearerAuth_token

The commands on this page run in CI: crates/rustman-cli/tests/docs_import_openapi.rs writes each # <file> block, runs each $ rustman ... line and compares its output and every (generated) block with what the import wrote.

GraphQL

Rustman treats GraphQL as more than an HTTP POST: requests are kind: graphql files, and a schema (introspected and cached, or read from a file) drives validation, completion and the explorer. The behavior is specified in openspec/specs/graphql-requests.

Request files

# users/get-user.rman.yaml
version: 1
kind: graphql
name: Get user
endpoint: '{{base_url}}/graphql'
document: |
  query GetUser($id: ID!) {
    user(id: $id) { name email }
  }
operation_name: GetUser
variables:
  id: '{{user_id}}'
headers:
  - name: X-Client
    value: rustman
auth:
  type: bearer
  token: '{{api_token}}'
FieldRequiredDefaultMeaning
version, kind, name, description, tagsAs for every request file (request-files.md); kind is graphql.
endpointyesThe GraphQL endpoint URL.
documentone ofThe operation document, inline.
document_fileone ofA .graphql file, relative to the request file and inside the workspace.
operation_namenoSelects one operation of a document that has several.
variablesnoThe GraphQL variables, any JSON shape.
headersno{name, value} pairs, merged over the collection’s headers.
authnothe collection’sAny auth helper of HTTP requests.
transportnohttphttp, ws (WebSocket subscriptions) or sse (subscriptions over Server-Sent Events).
methodnoPOSTGET sends a query as URL parameters; mutations cannot use it.
apqnofalseAutomatic Persisted Queries.
schema_filenoAn SDL or introspection JSON file used instead of the schema cache (see Schema file).
presetnodetectedgeth (EIP-1767) or subgraph (The Graph): blockchain display and helpers (see Blockchain GraphQL presets).
ws_protocolnoautoauto, graphql-transport-ws or graphql-ws (the legacy subscriptions-transport-ws protocol).
connection_paramsnoThe connection_init payload of WebSocket subscriptions.
max_eventsno10Headless subscriptions stop after this many events (at least 1).
durationno30sHeadless subscriptions stop after this long: 500ms, 30s, 2m, or milliseconds.

Exactly one of document and document_file must be set. A file with neither or both fails to load, naming the file:

api/users.rman.yaml: graphql: exactly one of document or document_file is required

Unknown fields, an empty endpoint, max_events: 0 and values outside the lists above are load errors too. Rustman never rewrites a graphql file: saving it keeps its text as written.

Variables and interpolation

{{name}} placeholders are resolved with the usual precedence in:

  • endpoint;
  • headers, including headers inherited from _collection.yaml;
  • auth fields;
  • every string value inside variables and connection_params, at any depth. Keys, numbers, booleans and null are kept as written.

With variables: { id: "{{userId}}" } and userId=42, the payload’s variables is {"id": "42"}.

The document is never interpolated: a literal {{x}} inside a string argument is sent byte for byte, and a document_file is sent exactly as stored (line endings included). Use GraphQL variables to parameterize an operation. An unresolved placeholder fails the send and lists every missing name, as for HTTP requests.

The request’s variables are GraphQL variables, so they are not a layer of Rustman variables. Secrets used anywhere in the request, variables included, are redacted wherever the request is shown or recorded.

Schemas

A schema enables validation before send, deprecation warnings, completion and the explorer. Rustman picks the first of:

  1. the request’s schema_file;
  2. the schema_file of the request’s [[graphql.endpoints]] entry in rustman.toml;
  3. the cached introspection result for the request’s endpoint.

With none of them, only the document’s syntax is checked. Choosing a schema never sends a request: introspection happens only when you refresh the schema explicitly (rustman graphql introspect, or the refresh action of the TUI GraphQL pane).

Introspection

Refreshing sends the standard introspection query as a POST to the endpoint, through the same HTTP transport as every request (TLS, proxies, auth, cookies, redaction). It asks for descriptions, deprecations (isDeprecated, deprecationReason, including deprecated arguments and input fields), specifiedByURL and isRepeatable. A server that rejects those newer fields (Cannot query field "specifiedByURL" ...) is asked once more with the June 2018 introspection query.

Any other failure (introspection disabled, an error status, a body that is not a GraphQL result) fails with a hint:

graphql: introspection failed: GraphQL introspection is not allowed; set schema_file to validate offline
graphql: introspection failed: HTTP 502: response is not a GraphQL result; set schema_file to validate offline

The result is converted to SDL and parsed. A schema that parses but breaks a validation rule is kept, with warnings: it is what the server executes.

The response is parsed whole, so it is held in memory and may be at most rustman.toml [graphql] max_schema_bytes (64 MiB by default). This limit replaces [http] max_body_bytes and max_download_bytes for introspection: real schemas can come close to the 10 MiB max_body_bytes default, so a schema between the two is kept in memory rather than spilled to disk. A larger response stops downloading as soon as the limit is passed and is refused, without being parsed, spilled to disk, read back or cached (exit code 3):

graphql: introspection failed: the response is larger than the 67108864 byte limit ([graphql] max_schema_bytes); set schema_file to validate offline
# rustman.toml
[workspace]
name = "shop"
version = 1

[graphql]
max_schema_bytes = 134217728   # allow schemas up to 128 MiB

Schema cache

Introspection results are cached in .rustman/graphql/schemas/<hash>.json, under the workspace root (rustman init adds .rustman/ to .gitignore). <hash> is the SHA-256 of the normalized endpoint: scheme, host, port and path, with user info, query and fragment removed. Endpoints that differ only in their query share a cache entry; each environment’s host gets its own.

A cache file holds:

KeyMeaning
format1.
endpointThe normalized endpoint, with any secret in it redacted.
fetched_atWhen it was fetched, RFC 3339 UTC.
sdl_sha256The SHA-256 of the schema as SDL, for cheap comparisons.
type_countNamed types defined by the schema (built-in types excluded).
introspectionThe raw {"__schema": ...} result, lossless.

A cached schema is used until it is refreshed; sending or validating a request never refreshes it. Secret values used by the request are never written to the cache file.

Schema file

When introspection is disabled, point schema_file at a schema checked into the workspace. It may be SDL (.graphql, .graphqls) or an introspection result in JSON (.json, or any file starting with {; a whole response, its data, or the __schema object). When a schema_file applies, the cache is not read at all.

In a request file the path is relative to the request file. In rustman.toml, an endpoint entry applies to every request whose endpoint is written the same way, or resolves to the same normalized URL; its path is relative to the workspace root:

# rustman.toml
[workspace]
name = "shop"
version = 1

[[graphql.endpoints]]
url = "https://api.example.com/graphql"
schema_file = "schemas/api.graphql"

Both paths must stay inside the workspace.

Validation before send

Before a request is sent, its document is checked:

  • With a schema, against every validation rule of the GraphQL specification. Each error is reported with its line:column in the document, using the messages of the reference implementation:

    1:17: Cannot query field "emial" on type "User".
    

    The request’s variables are then checked against the variable definitions of the selected operation. A missing required variable (non-null, no default), a null for a non-null type, or a value of the wrong shape (scalar, enum value, input object field, list item) blocks the send, naming the variable’s path. The messages never show the value itself, which may be a secret:

    variable $id of type ID! is required
    variable $input.role: expected Role, got string
    

    Custom scalars (such as Upload) accept any value: only the server knows their rules.

  • Without a schema, only the syntax is checked; a syntax error still blocks the send:

    1:23: syntax error: expected R_CURLY, got EOF
    

Validation errors block the send unless you pass --no-validate (CLI) or confirm in the TUI.

Fields and enum values the schema marks @deprecated produce a warning with the reason (No longer supported when the schema gives none). Warnings never block the send:

1:17: User.username is deprecated: Use handle

Choosing the operation

A document with one operation (named or anonymous) is sent as is. A document with several needs operation_name; without it the send fails before anything leaves the machine:

graphql: document has 2 operations; set operation_name

operationName is sent only when the request sets operation_name.

Sending over HTTP

With transport: http (the default), queries and mutations go through the same HTTP transport as every request: TLS, proxies, cookies, auth helpers, timings and redaction all apply.

  • POST (the default) sends a JSON body {"query", "operationName", "variables"} with Content-Type: application/json. Members that are not set (no operation_name, no variables) are left out.

  • method: GET sends query, operationName and the JSON-encoded variables as URL parameters, for servers and CDNs that cache GET queries. Mutations and uploads cannot use GET:

    graphql: mutations cannot use GET
    
  • Subscriptions need transport: ws or transport: sse.

Every request sends Accept: application/graphql-response+json, application/json unless the request sets its own Accept header.

Results

A response body is parsed into data, errors (message, locations, path, extensions) and extensions, kept apart, with an overall status:

StatusMeaning
okNo errors.
partialBoth data and errors: the data is shown next to the errors.
errorsErrors and no data.

Error paths are shown joined with dots: ["user", "email"] is user.email, ["users", 0, "name"] is users.0.name. The HTTP status and timings are shown too. A body that is not a GraphQL result (an HTML error page from a proxy, say) is shown raw with:

graphql: response is not a GraphQL result

A result is parsed whole, so its body may be at most rustman.toml [http] max_body_bytes (10 MiB by default, see HTTP), not the max_download_bytes limit of plain HTTP requests. A larger body is refused as soon as the limit is passed, without being parsed, spilled to disk or stored:

HTTP: the response body is larger than the <n> byte limit (max_body_bytes)

The request is errored (exit code 3) and is not sent again (with apq: true, the full document is not sent after an oversized first answer). History records the error but none of the body.

File uploads

A variable value { "$file": "path" } uploads that file, following the GraphQL multipart request specification. The path is relative to the request file and must stay inside the workspace:

# media/upload-avatar.rman.yaml
version: 1
kind: graphql
name: Upload avatar
endpoint: '{{base_url}}/graphql'
document: |
  mutation Upload($file: Upload!) {
    upload(file: $file)
  }
variables:
  file:
    $file: ./avatar.png

The request becomes multipart/form-data with an operations part (the payload, each file replaced by null), a map part ({"0": ["variables.file"]}) and one part per file, named 0, 1, …, whose Content-Type is guessed from the file extension (application/octet-stream when unknown). Markers may appear at any depth, including inside lists. A file that does not exist fails before anything is sent:

graphql: upload file not found: ./avatar.png

The files are read when the request is sent and held in memory while it is sent, as for kind: http multipart bodies; very large uploads are better sent another way for now.

Automatic Persisted Queries

With apq: true, Rustman first sends only the SHA-256 hash of the document (extensions.persistedQuery with version: 1 and sha256Hash), without query. If the server answers PersistedQueryNotFound (by message or by extensions.code), it sends the full document with the hash once more, which registers it. The result shows which happened: APQ hit, or APQ miss (registered) after two requests. When the second answer is PersistedQueryNotFound again or not a GraphQL result, it shows APQ miss (not registered). A server that answers PersistedQueryNotSupported also gets the full document once, shown as APQ miss (not registered). When the first answer is not a GraphQL result (an HTML error page, say), neither is shown: the server did not say whether it knew the hash.

Explorer and completion

With a schema, the engine exposes explorer data for the TUI explorer and the agent interface: the root operation types, every named type with its kind and description, fields with arguments, argument types and defaults, enum values, input fields, interfaces and possible types, the @specifiedBy URL of custom scalars, directives, and the deprecation status of each field, argument, input field and enum value.

Completion works on documents that are still being typed. At the cursor it offers the fields of the enclosing type (with __typename), the arguments of the enclosing field or directive, the values of an enum-typed argument, the variables the operation declares (after $), directive names (after @) and fragment names (after ...), each with its type signature, such as user(id: ID!): User.

In the TUI

The TUI GraphQL editor uses the same data: the document is checked as you type, with problems underlined and the one at the cursor shown on the editor’s last line; Ctrl+Space opens the completion popup; the Schema tab browses types and fields. Ctrl+G refreshes the schema by introspection. Results show in the Data, Errors, Extensions and Events tabs of the response viewer, redacted like history.

Subscriptions

Subscriptions need transport: ws or transport: sse. Each result the server pushes is recorded as a timestamped event, in order.

# live/on-message.rman.yaml
version: 1
kind: graphql
name: On message
endpoint: '{{base_url}}/graphql'
transport: ws
document: |
  subscription OnMessage($room: String!) {
    onMessage(room: $room) { id text }
  }
variables:
  room: lobby
connection_params:
  authToken: '{{api_token}}'
max_events: 5
duration: 10s
assertions:
  - no_errors: true
  - data: {path: '$[0].onMessage.text', exists: true}

WebSocket

With transport: ws, an http:// or https:// endpoint is reached as ws:// or wss:// (a ws(s):// endpoint is used as is). The handshake carries the request’s headers, auth helper and cookies, and uses its TLS settings (ca_bundle, client certificates, verify_tls, --insecure) and proxies (an HTTP proxy always tunnels with CONNECT); the WebSocket stack is shared with JSON-RPC.

Rustman speaks graphql-transport-ws: it sends connection_init with connection_params as its payload, waits for connection_ack, sends subscribe, records each next, answers ping with pong, and sends complete when it stops the subscription. A server that does not acknowledge the connection within 10 seconds (or, headless, within what is left of duration; the handshake is bounded the same way) stops the subscription with:

graphql: connection_ack timeout

ws_protocol picks the subprotocol:

ws_protocolBehavior
auto (default)Offers graphql-transport-ws and graphql-ws. A server that only accepts the legacy graphql-ws (subscriptions-transport-ws) gets that protocol (start, data, stop, connection_terminate), and the result shows legacy subscriptions-transport-ws.
graphql-transport-wsOnly the modern protocol.
graphql-wsOnly the legacy protocol.

An error message from the server ends the subscription; its errors become the last event. A server that closes the connection without complete fails the subscription, with the close code and reason graphql-transport-ws uses for errors (for example 4401 Unauthorized or 4403 Forbidden):

the server closed the connection without complete (4403 Forbidden)

Events are held in memory, so one WebSocket message (and one frame) may not be larger than rustman.toml [http] max_body_bytes (10 MiB by default); a larger one ends the subscription with error and WebSocket: a message is larger than the <n> byte limit (max_body_bytes). The events received before it are kept.

When Rustman stops a subscription, it gives the server 2 seconds to take the complete (or stop) message and the close; a server that does not read them is left behind.

Server-Sent Events

With transport: sse, Rustman follows the GraphQL over SSE distinct connections mode: it POSTs the operation (as for queries) with Accept: text/event-stream, through the same HTTP transport as every request, records each next event and stops on complete. Stopping early closes the connection. A stream that ends without a complete event fails the subscription with SSE: the stream ended without a complete event. Events are held in memory, so one event (with the line being read) may not be larger than rustman.toml [http] max_body_bytes (10 MiB by default, see HTTP); a larger one ends the subscription with error and SSE: an event is larger than the <n> byte limit (max_body_bytes). A response that is not a successful event stream fails with graphql: subscription: SSE: HTTP <status> .... The response must start within the request timeout (headless, within what is left of duration), or the subscription fails with SSE: the stream did not open within <n> ms; stopping before then fails it with SSE: stopped before the stream opened.

When a subscription stops

Headless subscriptions (rustman run, rustman graphql query) stop after max_events events (default 10) or duration (default 30s), whichever comes first; --max-events and --duration replace both for every request of the command. A subscription also stops when the server completes it, closes the connection or sends an error, and on Ctrl+C: it then tells the server it stopped and keeps the events collected so far, which are printed, checked and recorded with stopped (it has 5 seconds for this; the command exits 130). Interactive subscriptions in the TUI run until the server completes them or you stop them (Alt+X); the first 1000 events are kept for the result and its assertions, later ones are counted, and history records the first 100.

The reason is recorded as complete, max_events, duration, stopped, closed or error. A subscription that failed (closed without complete, or an SSE event over the size limit) also records why as failure, which is an error of its result: no_errors fails and rustman graphql query exits 1.

Assertions and captures

GraphQL requests take assertions and captures like HTTP requests (see Assertions and captures), plus checks of the GraphQL result:

AssertionPasses when
no_errors: trueThe result has no errors (no_errors: false: it has some). A failure lists each error’s message and path.
errors_count: <n>There are exactly n errors; errors_count: {gt|gte|lt|lte|equals: <n>} compares instead.
error_message_contains: <text>Some error’s message contains text.
error_code: <code>Some error’s extensions.code is code.
data: {path, <op>: value}A JSONPath check rooted at data: $.user.name reads data.user.name. The operators are those of json.
# auth/login.rman.yaml
version: 1
kind: graphql
name: Login
endpoint: '{{base_url}}/graphql'
document: |
  mutation Login($password: String!) {
    login(user: "ada", password: $password) { token }
  }
variables:
  password: '{{password}}'
assertions:
  - no_errors: true
  - data: {path: $.login.token, type: string}
captures:
  - {var: token, from: json, path: $.data.login.token}

Captures read the whole response body, so a value under data is at $.data...; the captured token is set for the later requests of the run. A failed no_errors reads, for instance:

no_errors: expected no errors, got 1 error: "email is private" at user.email

For a subscription, the checks read the collected events as one result: data is the list of every event’s data ($[0].onMessage, $ with length) and errors holds every event’s errors. Status, header and latency assertions read the handshake (101) or the SSE response.

In rustman run

rustman run executes graphql request files alongside HTTP ones, in collection order: values captured by either kind are available to the next requests. Each graphql request is validated and sent as described above; a validation error, an ambiguous document or a transport failure makes the request errored (exit code 3), and failed assertions make it failed (exit code 1). Reports list GraphQL assertions with their own kinds (no_errors, errors_count, error_message_contains, error_code, data), and a response that is not a GraphQL result adds the warning graphql: response is not a GraphQL result.

History

Every executed GraphQL operation is recorded in history like any request, and its entry’s record.graphql adds:

KeyMeaning
operation_name, operation_typeThe selected operation and whether it is a query, mutation or subscription.
transport, protocolhttp, ws or sse, and for subscriptions the protocol used (graphql-transport-ws, legacy subscriptions-transport-ws or sse).
variablesThe variables sent, uploads as null, with secrets redacted as «redacted:<name>».
resultok, partial or errors; null when the response was not a GraphQL result.
apqAPQ hit, APQ miss (registered) or APQ miss (not registered), with apq: true; null when the first answer is not a GraphQL result.
subscriptionevent_count, the first 100 events (ts, elapsed_ms, payload, redacted), why it ended and, when it failed, the failure (redacted).

Subscriptions cannot be replayed with rustman history replay; queries and mutations over HTTP can.

CLI commands

rustman graphql introspect

rustman graphql introspect <endpoint | request> [--out <file>] [--env <name>] [--var k=v]... [--timeout <duration>] [--insecure]

Fetches the schema of an endpoint URL, or of a graphql request’s endpoint resolved in the active environment (with its headers and auth), and stores it in the schema cache. Outside a workspace a URL can still be introspected, but nothing is cached. --out <file> also writes the schema as SDL.

$ rustman graphql introspect https://api.example.com/graphql --out schema.graphql
introspected https://api.example.com:443/graphql: 42 types, fetched at 2026-11-18T09:30:00.123Z
cached in .rustman/graphql/schemas/5f2b...e1.json
wrote schema.graphql

It exits 0 on success, 3 when the server cannot be reached or refuses introspection (with the set schema_file hint), and 2 for a bad argument.

rustman graphql query

rustman graphql query <request | --endpoint <url> --query <text>> [--env <name>] [--var k=v]...
                      [--no-validate] [--json] [--max-events <n>] [--duration <duration>]
                      [--timeout <duration>] [--insecure] [--no-history]
                      [-u | --update-snapshots] [--ci]

Validates the operation, sends it and prints the result. The request is a graphql request file, its id or its name; --endpoint with --query sends an ad-hoc operation without a workspace (a ws:// or wss:// endpoint subscribes over WebSocket). --no-validate sends even when validation fails. The request’s assertions are checked and the exchange is recorded in history, as in rustman run; snapshots honor --update-snapshots, --ci and the CI variable the same way.

The output starts with the HTTP status, the result status and the time, then data, errors and extensions apart; a subscription prints its protocol, event count and why it ended, the failure when there is one (failed: ...), then each event. Everything is redacted. --json prints one JSON object instead (status, result, data, errors, extensions, apq, or for a subscription protocol, ended, event_count, failure and events).

$ rustman graphql query users/get-user.rman.yaml --env dev
HTTP 200 · partial · 41 ms
data:
{
  "user": {
    "name": "Ada",
    "email": null
  }
}
errors:
  - email is private (path user.email, at 1:22, code FORBIDDEN)
Exit codeMeaning
0No errors (and the request’s assertions passed).
1errors is not empty, the response is not a GraphQL result, or an assertion failed.
2Usage or configuration error (no workspace, unknown request, not a graphql request).
3No response (network, TLS, timeout, unresolved variable, connection_ack timeout, a body over max_body_bytes) or the document failed validation.
130Interrupted by Ctrl+C.

Agent tools

The agent MCP server registers two GraphQL tools when it is built with GraphQL support (the default graphql feature of rustman-mcp; a build without it lists neither):

ToolWhat it does
graphql_introspectThe schema of an endpoint or saved graphql request (path): the root types and every named type, or one type in full with type_name. It reads the schema_file or the schema cache, and introspects the endpoint (caching the result) only when there is neither, or with refresh: true.
graphql_queryValidates and sends a saved graphql request, or an ad-hoc operation (endpoint, query, operation_name, variables, headers), over HTTP, and returns the redacted data, errors and extensions with the assertions.

Both send through the session’s allowlist, production check and rate limit. A query is a read; a mutation needs [agent] allow_mutations = true and the human’s confirmation, as an HTTP POST does; subscriptions (and requests with transport: ws or sse) are refused with code: "blocked", as are an endpoint URL with query, operationName or extensions parameters and file uploads ($file) in ad-hoc variables. An operation that fails validation comes back errored and is not sent. Operations are recorded in history like every request. See Agent interface.

JSON-RPC

Rustman sends JSON-RPC 2.0 calls, batches, notifications and subscriptions over HTTP and WebSocket to any JSON-RPC service: EVM nodes, Bitcoin Core, Solana, Starknet and LSP-style services. It is chain-agnostic: method names are never interpreted and values are never decoded, so "0x10" stays 0x10. The request file format is in request-files.md; the behavior is specified in openspec/specs/jsonrpc-requests.

Envelopes and ids

Each call becomes {"jsonrpc":"2.0","method":…,"params":…,"id":…}, members in that order, sent with Content-Type: application/json. params is left out when the file has none. The minimal file

version: 1
kind: jsonrpc
name: Block number
endpoint: '{{rpc_url}}'
method: eth_blockNumber

sends exactly {"jsonrpc":"2.0","method":"eth_blockNumber","id":1}.

  • Without id, ids are sequential integers from 1 per connection. Over HTTP every request is its own connection, so a batch carries ids 1, 2, …; over a reused WebSocket the numbering continues.
  • An explicit id (string or integer) is sent unchanged and takes no sequence number. Sequential ids skip the explicit ids of the same request, so in a batch of {method: a, id: 1} and {method: b} the second call gets id 2.
  • Two calls of a batch with the same explicit id are a load error, <path>:<line>: duplicate id 1 in batch: their answers could not be told apart.
  • A notification (notification: true) carries no id. Over HTTP the exchange completes when the HTTP response arrives (204 No Content passes); any body is recorded but not parsed.

Responses

ResponseOutcome
resultThe call succeeded.
error objectThe call failed with rpc error <code>: <message>; code, message and data are kept.
both or neither member, or jsonrpc other than "2.0"Exchange error invalid JSON-RPC response: <reason>.
another id (single call over HTTP)Exchange error response id <x> does not match request id <y>.
non-2xx status with a JSON-RPC error bodyThat error object.
non-2xx status with any other body (an HTML gateway page)Exchange error HTTP <status> (exit-code class 3).

A failed call fails the request. An exchange error means no usable answer came back.

An answer may be at most [http] max_body_bytes (default 10 MiB): the HTTP response body, or each WebSocket message. A larger one is refused as soon as the limit is passed, without being parsed or stored: the exchange error HTTP: the response body is larger than the <n> byte limit (max_body_bytes), or WebSocket: a message is larger than the <n> byte limit (max_body_bytes) (exit-code class 3). It is not retried, and history records the error but none of the body, so a recorded response is never larger than the limit.

Batches

A batch of 1 to 100 calls goes out as one JSON array (one HTTP request, or one WebSocket frame). Responses are matched to calls by id, in any order, and each call keeps its own assertions and captures. A call without a response fails with no response for id <x>. A server that answers a batch with a single error object (many public nodes disable batches) fails every call with that error, reported once with the note server rejected the batch. The request passes only when every call that expects an answer passes.

Timeouts and retries

Calls use the kind: http timeouts: settings.timeout_ms (default 30000) for the response and settings.connect_timeout_ms (default 10000) for connecting, per HTTP request and per WebSocket call. A timeout is reported as timeout after <n> ms (<phase>).

JSON-RPC is POST-only, so HTTP semantics cannot tell reads from writes. Retries therefore only apply to files marked idempotent: true:

idempotent: true
settings:
  retry: {attempts: 2, backoff_ms: 500}

attempts (default 0) counts the tries after the first. A try is repeated after a connection error, a timeout, HTTP 429, 502, 503 or 504, or error code -32005 (limit exceeded). The wait starts at backoff_ms (default 500) and doubles each time; a Retry-After header (seconds or an HTTP date, at most 60 seconds) replaces it. Every attempt is recorded with its status, error and wait. Without idempotent: true, nothing is retried.

WebSocket

For ws:// and wss:// endpoints the call goes out as a text frame on a WebSocket opened with the same stack as GraphQL subscriptions: the request’s headers, auth and cookies in the handshake, [http] proxies (HTTP CONNECT, HTTPS, SOCKS5) and TLS settings (ca_bundle, client certificates, verify_tls). The answer is the frame whose id matches; unrelated frames, such as subscription notifications, are skipped. Outside rustman run (rustman rpc call, rpc batch and the TUI), the connection closes when the exchange ends. Within one rustman run, files with the same endpoint, handshake headers, TLS settings and proxy share one connection. Status and header assertions are not available over WebSocket.

Subscriptions

JSON-RPC has no standard subscription shape, so a subscription names three methods:

version: 1
kind: jsonrpc
name: New heads
endpoint: wss://{{node_host}}/ws
params: [newHeads]
subscription:
  subscribe: eth_subscribe
  unsubscribe: eth_unsubscribe
  notification: eth_subscription
  max_events: 3
assertions:
  - json: {path: $.events, length: 3}

Rustman calls subscribe with params, takes its result as the subscription id, and records every notification message whose id (at notification_id_path, default $.params.subscription) equals it as an event. Headless (rustman run, rustman rpc call), the subscription ends after max_events events (default 10) or max_duration_ms (default 30000), whichever comes first; then unsubscribe is called with the id. Events are assertable as a list at $.events, next to the subscribe call’s $.result. The same triple covers Solana (accountSubscribe / accountNotification / accountUnsubscribe, with notification_id_path: $.params.subscription) and Starknet.

A subscription over an http:// or https:// endpoint fails to load with subscriptions require a ws:// or wss:// endpoint.

Assertions and captures

Assertions and captures evaluate against the whole response envelope (not just result), so $.result addresses the result and $.error the error object, exactly as --raw prints them. In a batch, each call’s assertions and captures read that call’s own envelope, and failures name the call (call 2 (eth_blockNumber): …). Status and header assertions read the HTTP response; over WebSocket they are rejected at load time. Values are kept as received: capturing $.result of eth_blockNumber gives 0x12a05f2, not a number.

assertions:
  - json: {path: $.result, type: string}
  - rpc_error: none
captures:
  - {var: head, from: json, path: $.result}

rpc_error checks how the call ended:

AssertionPasses when
rpc_error: {code: -32602}the call failed with error code -32602
rpc_error: {code: -32602, message_contains: invalid}… and its message contains invalid (interpolated)
rpc_error: nonethe call returned a result

Its failures read rpc_error: expected code -32602, got result and rpc_error: expected code -32602, got code -32601. A call that fails with an error object fails the request unless it has an rpc_error: {code: …} assertion; with one, the assertion decides.

Snapshots

A snapshot assertion records how a call answered and compares later runs against it. The snapshot body is the call’s response envelope, the same document other assertions read: jsonrpc, id and either result or the error object. Over HTTP, the status is compared too. For a subscription, the body is the list of events collected instead. In a batch, each call’s snapshot holds that call’s own envelope, matched by id. Each snapshot is a file named after the request file and the snapshot name, so names must be unique across all calls of a batch. A repeated name fails to load with duplicate snapshot name 'default' (give each call's snapshot its own name).

# chain/head-block.rman.yaml
version: 1
kind: jsonrpc
name: Head block
endpoint: '{{rpc_url}}'
batch:
  - method: eth_chainId
    assertions:
      - snapshot: {name: chain}
  - method: eth_getBlockByNumber
    params: ['0x1', false]
    assertions:
      - snapshot: {name: block, ignore: [$.result.timestamp]}

rustman run, rustman rpc call and rustman rpc batch record, compare and update these snapshots like any other: --update-snapshots (-u) rewrites one that differs, and --ci (or CI=true) never writes one. Agents compare in CI mode. rustman snapshot list and prune include them.

History

Every call, batch and subscription is recorded in history as one exchange. Next to the usual exchange (the HTTP request and response, for HTTP endpoints), the record’s jsonrpc part holds the transport, each call’s envelope sent and received with its outcome (result, error, notification, failed), every retry attempt (status, error, wait), a subscription’s id, event count and first 1000 events, and the note server rejected the batch when it applies. Secrets are redacted everywhere, including inside params: a param {{api_key}} is stored as «redacted:api_key». HTTP exchanges can be replayed; WebSocket ones cannot.

OpenRPC catalogs

An endpoint can have an OpenRPC document listing its methods, param names and schemas, and result schemas. Link a file in rustman.toml (JSON, or YAML for .yaml / .yml), keyed by the endpoint as request files write it or as it resolves:

[jsonrpc.catalogs]
"{{rpc_url}}" = "openrpc/node.json"

or fetch it from a node that implements rpc.discover:

$ rustman rpc discover {{rpc_url}} --env dev
42 methods cached in .rustman/cache/openrpc/3f1c….json

The cache file is named by the SHA-256 of the resolved endpoint (scheme, host, port, path and query, so ?network=main and ?network=test get catalogs of their own), so an API key in the URL never appears in a file name, and the document is stored with secrets redacted. A node answering rpc.discover with -32601 makes the command exit 1 with endpoint does not support rpc.discover; provide an OpenRPC file.

With a catalog, every call is checked before anything is sent, and each violation is printed with its param path:

  • unknown method 'eth_blockNumbr' (did you mean eth_blockNumber?)
  • params[0]: expected string, got integer (positional params; named params read params.<name>)
  • params.address: missing required param 'address'
  • any other schema violation, as params[1]: <reason>

A refused send exits 2. settings.validate: false in a request file, or --no-validate, skips the check. Without a catalog, nothing is validated.

rustman rpc call

rustman rpc call <endpoint|request> [method] [params-json] sends one call and prints its result, or its error object, as pretty JSON. The target is an endpoint (http, https, ws, wss, or a {{variable}} holding one) with a method and optional params (a JSON array or object), or a kind: jsonrpc request file, id or name (whose assertions are checked).

$ rustman rpc call http://127.0.0.1:8332 getblockcount --header "Authorization: Basic {{btc_auth}}" --env dev
800000
$ rustman rpc call {{rpc_url}} eth_getBalance '["0x00000000000000000000000000000000000000aa", "latest"]'
0 ETH
$ rustman rpc call wss://node.example/ws eth_subscribe '["newHeads"]' \
    --subscribe eth_subscription --unsubscribe eth_unsubscribe --max-events 3
FlagMeaning
--header, -H "Name: value"Add a header (repeatable, interpolated)
--id <id>Send this id (an integer, or else a string)
--notifySend a notification: no id, nothing printed
--subscribe <notification> --unsubscribe <method>Subscribe with the method, print the subscription id and then each event (one per line)
--max-events <n>, --duration <d>Bound a subscription (defaults: the request’s, else 10 events and 30 s)
--rawPrint the response envelopes (and event messages) as received
--jsonPrint the whole exchange (status, calls, attempts, events, assertions) as one JSON object
--no-validateSkip the OpenRPC check
--param name=valueA typed param of a built-in eth_*, net_* or web3_* method (repeatable), instead of the params JSON; see Typed JSON-RPC methods
--env, --workspace, --var, --timeout, --insecure, --no-historyAs for rustman send

A native amount (eth_getBalance, eth_gasPrice) prints as 1 ETH, its wei, gwei and hex forms on stderr; --raw and --json keep the hex. Outside a workspace, endpoint calls still work (history goes to the platform data folder). Every output comes from the redacted record, so no secret is ever printed.

rustman rpc batch

rustman rpc batch <endpoint> <file> reads calls from a JSON array, a YAML list, or JSON lines (one {"method": …, "params": …} per line); - reads stdin. The calls are sent as one batch (more than 100 are split into consecutive batches of 100) and one line is printed per call, in input order: the result, or {"error": {…}}. --json prints them as one array; --header and --no-validate work as for rpc call.

$ printf '{"method":"eth_chainId"}\n{"method":"eth_blockNumber"}\n' | rustman rpc batch {{rpc_url}} -
"0x1"
"0x12a05f2"

Exit codes

Coderpc call / rpc batchrpc discover
0Every call returned a result (and every assertion passed)The catalog was cached
1A call returned a JSON-RPC error, or an assertion failedThe node answered with an error (-32601: no rpc.discover) or not with an OpenRPC document
2Bad flags or input, or the OpenRPC catalog refused a callBad flags, no workspace
3No usable answer: network, TLS, timeout, HTTP <status>, an invalid responseSame
4A method guard refused a call (nothing was sent)
130Ctrl+CCtrl+C

In rustman run

rustman run sends kind: jsonrpc files like any other request, in collection order, with captures shared across files and one WebSocket connection per endpoint and handshake headers for the whole run. Subscriptions are headless: they stop at max_events / max_duration_ms, which --max-events and --duration replace for every subscription of the run. The JSON report (--reporter json, rustman.report/v1) gives every JSON-RPC request a jsonrpc member next to exchange: the transport (http or ws), whether it was a batch, every call with the envelope sent, the envelope that answered it, its outcome (result, error, notification or failed) and failure, every HTTP attempt, a subscription’s id, events (the first 1000), event count, why it ended and whether it unsubscribed, and a refusal (validation or guard) when nothing was sent. Every value in it is redacted. For a WebSocket exchange exchange is null: the jsonrpc member is the record. A run exits 3 when a request errored and 4 when the errors include a call a method guard refused.

"jsonrpc": {
  "transport": "http",
  "batch": false,
  "calls": [{
    "method": "eth_blockNumber", "id": 1,
    "request": {"jsonrpc": "2.0", "method": "eth_blockNumber", "id": 1},
    "response": {"jsonrpc": "2.0", "id": 1, "result": "0x12a05f2"},
    "outcome": "result"
  }],
  "attempts": [{"status": 200, "error": null, "elapsed_ms": 1.4}],
  "elapsed_ms": 1.45
}

CI runs a fixture collection (a call, a batch, a subscription and an error assertion) against in-process stubs on every OS, and against a local Anvil node (--block-time 1) in the jsonrpc-anvil job: set RUSTMAN_ANVIL_URL=http://127.0.0.1:8545 to run that part locally (cargo test -p rustman-cli --test rpc_run).

In the TUI

A kind: jsonrpc request opens in its own editor (see Terminal UI): the endpoint on the URL row (RPC, or SUB for a subscription), and the tabs Call (the method, completed from the endpoint’s OpenRPC catalog with each method’s param names, and the params as JSON), Batch, Headers, Auth and Assertions (each that part of the file as YAML). The response viewer adds the tabs Result, Error (code, message and data of each failed call) and Events. A subscription runs until you stop it: events are listed live with a counter, and Esc sends unsubscribe and stops it, keeping the events.

Method guards

Capabilities built on this one (such as the EVM toolkit) can register method guards, checked before any jsonrpc request is sent from any face: rustman rpc, rustman run, the TUI and the agent tool. For a subscription, guards are also asked about its subscribe and unsubscribe methods before anything is sent. A guard that refuses a method stops the whole request with its own message, sends nothing, and exits 4; the history and report record show refusal: guard. Guards win over the request file, over --no-validate, and over agent_read_only_methods.

Agent tool

The agent MCP server registers the rpc_call tool. It takes either path (a saved kind: jsonrpc request) or endpoint with method and optional params (a JSON array or object), plus vars and timeout_ms, and returns each call’s result or error object, redacted, with the request’s assertions. Because JSON-RPC methods are not classified as reads or writes, an agent may only call methods matching a glob of [jsonrpc] agent_read_only_methods; the list is empty by default, so nothing is allowed until you add globs:

[jsonrpc]
agent_read_only_methods = ["eth_get*", "eth_blockNumber", "eth_chainId", "@evm-read"]

Entries starting with @ are presets other capabilities register (for example @evm-read); an unknown one stops the agent server at start with unknown method preset '@solana-read' (registered: …) and exit code 2. Each call is checked in this order, and nothing is sent unless all pass: the method guards (their own message), the safety policy (the endpoint’s host must be in [agent] allowed_hosts), subscriptions (refused: subscriptions are not available to agents), then the allowlist (method not marked read-only for agents). A refusal is a tool error with code: "blocked" and that message; an unknown preset is code: "invalid_input". Allowed calls go through the session’s governed sender: every POST and redirect hop is checked against the agent allowlist and the production rule, and paced by [safety].rate and [safety].concurrency, which rpc_call shares with the other requests of the session. A call to a ws:// or wss:// endpoint is admitted and paced by the same limiter before it is sent. The HTTP method rule of [agent] doesn’t apply: every JSON-RPC call is a POST, and agent_read_only_methods takes its place. Calls are recorded in history like any other.

gRPC

Rustman calls gRPC services from kind: grpc request files, with no generated code: message types come from the server (reflection), from local .proto files compiled in-process, or from a binary descriptor set. No protoc is needed.

This page covers the request file, where schemas come from, the descriptor cache, the method browser with its message templates, how calls are sent (message encoding, call types and the message timeline, stream bounds, deadlines, metadata, TLS and gRPC-Web, and status details), assertions and captures, kind: grpc in rustman run and history, and the rustman grpc commands. The behavior is specified in openspec/specs/grpc-requests.

Request files

version: 1
kind: grpc
name: Get product
target: "{{grpc_host}}"             # host:port, grpc://host:port or grpcs://host:port
method: shop.v1.Catalog/GetProduct  # package.Service/Method
message:
  id: "p-1"
metadata:
  - name: authorization
    value: "Bearer {{token}}"
deadline_ms: 5000
FieldRequiredMeaning
targetyeshost:port, grpc://host:port (plaintext HTTP/2) or grpcs://host:port (TLS). A bare host:port uses TLS on port 443 only. The host is a DNS name, an IPv4 address or a bracketed IPv6 address ([::1]:50051). {{variables}} work.
methodyesThe fully qualified method, package.Service/Method.
messageone ofThe request message (unary and server streaming), as YAML or JSON in the proto3 JSON mapping.
messagesone ofA list of request messages, sent in order (client and bidi streaming). Exactly one of message or messages is allowed.
metadatanoAn ordered list of {name, value} pairs sent as request headers. Names ending in -bin take base64 values. enabled: false keeps a row without sending it.
deadline_msnoThe call deadline, sent as grpc-timeout.
tlsnoenabled, insecure, ca_bundle, client_cert, client_key, client_pkcs12, client_pkcs12_password: the same options as for HTTP requests. enabled overrides the choice made from the target.
transportnogrpc (default) or grpc-web.
schemanoprotos and import_paths, or descriptor_set (see below). Without it, reflection is used.
streamnomax_messages (default 100) and duration_ms (default 30000): the bounds of a headless stream.
variables, assertions, captures, description, tagsnoAs for other kinds.

Load errors name the line, for example grpc: exactly one of message or messages is allowed, grpc: method must be fully qualified as package.Service/Method or grpc: target must be host:port or a grpc:// or grpcs:// URL.

Interpolation and redaction

{{variables}} are resolved in the target, metadata names and values, TLS settings, schema paths and the string values of messages (keys stay as written). Every missing variable is reported at once.

Secrets keep their placeholder wherever the call is recorded: metadata authorization: "Bearer {{token}}" reaches the server with the real token, and history stores Bearer «redacted:token». Literal credentials in authorization metadata are redacted the same way as the HTTP Authorization header.

Redaction matches secret values as text. Binary (-bin) metadata and bytes message fields are recorded in base64, so a secret the server returns inside binary data is not recognized there; keep secrets out of binary fields or treat those records as sensitive.

Schema sources

Server reflection

With no schema, Rustman asks the server through grpc.reflection.v1.ServerReflection, and falls back to grpc.reflection.v1alpha when v1 answers UNIMPLEMENTED. It lists the services, fetches the file declaring each one, and follows imports transitively. Well-known types (google/protobuf/*.proto) a server does not serve come from Rustman’s bundled copies. A listed service whose descriptors the server cannot return (such as a health service registered apart from reflection) is left out. Reflection, connecting included, must finish within the run’s timeout (--timeout, else [defaults] timeout_ms, else 30 s), or it fails with grpc: reflection at <target> failed: no answer within <ms> ms (exit code 3). A schema of more than 4096 files or 64 MiB of descriptors is refused as too large.

When neither version is implemented, the call fails with exit code 2:

grpc: server reflection unavailable at grpc://localhost:50051; set schema.protos or schema.descriptor_set

Local .proto files

schema:
  protos: [protos/shop/v1/catalog.proto]
  import_paths: [protos]

The files are compiled in-process with protox. Imports are looked up in import_paths (each proto’s own folder when there are none); google/protobuf/*.proto imports always resolve. Compile errors read <file>:<line>:<col>: <message>, with the file named as imported:

catalog.proto:7:18: expected ';' or '[', but found '}'

A missing token is reported right after the token before it.

Descriptor sets

schema:
  descriptor_set: shop.binpb

A binary FileDescriptorSet, as written by protoc --descriptor_set_out --include_imports or buf build -o. A descriptor set larger than 64 MiB is refused.

Paths

Schema paths are relative to the request file’s folder and may not leave the workspace: ../ escapes (written or produced by a variable) fail with file path escapes workspace: <path>. Imports are read only from inside their import path: an import reached through a symlink pointing out of it fails with import '<name>' resolves outside its import path.

Descriptor cache

Descriptors obtained by reflection are cached in .rustman/grpc/descriptors/<sha256(target)>.bin, with a .json sidecar recording the target (secrets redacted) and when it was fetched. The key is the canonical target (grpc://host:port or grpcs://host:port), hashed so no host name or secret appears in file names.

A cached schema is reused until it is refreshed. When the cache answers, Rustman shows a notice that the data may be stale:

schema from the descriptor cache (fetched 2026-11-19T10:00:00Z); it may be stale, refresh with `rustman grpc list --refresh`

A refresh asks the server again and rewrites the cache. When the server cannot be reached, the cached schema stands in, with the same notice, so services, methods and templates can be browsed offline. .rustman/ is local state; keep it out of Git.

Method browser and templates

Services are listed by name with their methods and call types: unary, server streaming, client streaming or bidi. A description of a method shows its call type, request and response types and a request template:

shop.v1.Catalog/ListProducts
  call type: server streaming
  request:   shop.v1.ListProductsRequest
  response:  shop.v1.Product
  request template:
    {
      "pageSize": 0,
      "category": "CATEGORY_UNSPECIFIED"
    }

Templates use the proto3 JSON mapping (lowerCamelCase names) with every field at its default:

  • nested messages are expanded three levels deep; deeper ones are {}
  • repeated fields hold one element, maps one entry ({"": 0})
  • enums take their first value name
  • only the first field of a oneof is included
  • 64-bit integers are strings ("0"), floating-point numbers 0.0, bytes ""
  • well-known types take their canonical JSON form: Timestamp "1970-01-01T00:00:00Z", Duration "0s", wrappers their inner default, Struct {}, Value null

Calls

Message encoding

Messages are written in YAML or JSON and encoded with the proto3 JSON mapping: field names in lowerCamelCase or as written in the .proto (pageSize or page_size), enums by name or number, 64-bit integers as strings or numbers, and well-known types in their canonical JSON forms (Timestamp "2026-11-17T10:00:00Z", Duration "1.5s", …).

Everything that can fail without the network is checked before anything is sent: the method must exist in the schema, every field must exist in its message type (nested, repeated and map messages included), unary and server-streaming methods take exactly one message, and metadata must be valid. An unknown field names the field and its type, with exit code 2:

grpc: unknown field 'idd' in shop.v1.GetProductRequest

Responses are shown in the canonical proto3 JSON form: lowerCamelCase names, default values left out, 64-bit integers as strings.

Call types and the exchange

Every call type is supported. A unary call sends one message and gets one response; server streaming collects every response in order; client streaming sends each entry of messages in order, then half-closes, and gets one response; bidi streaming sends messages in order while receiving concurrently, then half-closes.

The exchange of a call holds:

  • status: code, name and message, shown as OK (0) or NOT_FOUND (5): product missing not found, plus decoded details (below)
  • headers and trailers: the response metadata, recorded separately; binary (-bin) values in base64
  • messages: every received message as JSON; a unary or client-streaming response is the first one
  • timeline (streaming calls only): one entry per message with direction (sent or received), at_ms since the call started, size_bytes (encoded size) and message
  • timings: connect_ms, tls_ms, first_byte_ms (response headers) and total_ms

JSONPath assertions see the response message of a unary or client-streaming call at $, and the received messages of a server-streaming or bidi call at $.messages.

Headless stream bounds

Under rustman run, receiving stops after stream.max_messages messages (default 100) or stream.duration_ms (default 30000), whichever comes first. The call is then cancelled (the server sees the cancellation), the exchange is marked stopped and ends with CANCELLED (1): stopped by rustman after 100 messages (stream.max_messages), and assertions evaluate over the messages collected so far. Interactive streams run until they are stopped or their deadline expires.

Deadlines

Every call carries a deadline: deadline_ms, else rustman.toml [defaults] timeout_ms (which --timeout of rustman run and rustman grpc call replaces), else 30000 ms. It is sent as grpc-timeout (in milliseconds, or whole seconds when that would need more than eight digits) and also enforced on the client for the whole call, streams included. An expired deadline ends the call with DEADLINE_EXCEEDED (4), which counts as a request error (exit code 3).

Metadata

metadata entries are sent in order as request headers; names are lowercased. Names ending in -bin take base64 (padded or not) and are sent as binary metadata: {name: trace-bin, value: "AQID"} reaches the server as the bytes 01 02 03. Invalid base64, invalid names and values that are not printable ASCII fail before sending with grpc: invalid metadata '<name>': <reason>; the value is never shown.

Transport security

grpcs:// targets, and targets with tls.enabled: true (the default for a bare host:port on port 443), use TLS with HTTP/2 negotiated by ALPN. Verification is on, and tls takes the same options as HTTP requests, through the same TLS builder: ca_bundle (added to the platform roots, plus the workspace [http] ca_bundle), client_cert/client_key or client_pkcs12 for mutual TLS, and insecure: true to skip verification. grpc:// targets and tls.enabled: false use plaintext HTTP/2 (h2c).

A certificate that cannot be verified fails the call with exit code 3, naming the target:

grpc: TLS error at grpcs://localhost:8443: invalid peer certificate: UnknownIssuer

An unreachable server fails with grpc: cannot connect to <target>: <reason>, also exit code 3.

gRPC-Web

transport: grpc-web sends the call with the gRPC-Web protocol (application/grpc-web+proto) through Rustman’s HTTP client, over HTTP/1.1 or HTTP/2, so HTTP settings such as proxies and TLS apply. The call is a POST to http(s)://<host:port>/<package.Service>/<Method>; the trailers arrive at the end of the body. Binary metadata is sent in base64. A response frame longer than [http] max_body_bytes (10 MiB by default) is refused as soon as its length arrives, ending the call with RESOURCE_EXHAUSTED (8); trailer lines may end with \r\n or \n. No compression is negotiated, so a compressed response frame ends the call with UNIMPLEMENTED (12). Only unary and server-streaming calls fit the protocol; client streaming and bidi fail before sending:

grpc: grpc-web supports only unary and server-streaming calls

Status details

When a call fails with a grpc-status-details-bin trailer, it is decoded as google.rpc.Status using a descriptor set of the standard google/rpc protos bundled with Rustman, and each detail is rendered by type:

INVALID_ARGUMENT (3): invalid product id
  field violation: id: must start with p-
Detail typeRendered as
BadRequestfield violation: <field>: <description>, one line per violation
ErrorInfoerror info: reason <reason>, domain <domain>, then key=value metadata
RetryInforetry after <delay>
QuotaFailurequota violation: <subject>: <description>
PreconditionFailureprecondition violation: <type> <subject>: <description>
ResourceInforesource: <type> <name> (owner <owner>): <description>
Helphelp: <description> <url>
LocalizedMessagelocalized message (<locale>): <message>
DebugInfodebug info: <detail> [<stack entries>]
RequestInforequest info: <request id> <serving data>

A detail of any other type is shown as its type URL plus the encoded value in base64, such as type.example.com/acme.Mystery: AQID.

Assertions and captures

gRPC requests take the assertions list, with two gRPC checks:

assertions:
  - grpc_status: OK                          # a code name (any case) or number 0-16
  - metadata: {name: x-served-by, equals: catalog}
  - json: {path: $.id, equals: p-1}
  - latency: {total_lt: 500}
captures:
  - {var: product_id, from: json, path: $.id}
  - {var: served_by, from: metadata, name: x-served-by}
  • grpc_status passes when the call ended with that code. A request with no assertions at all expects grpc_status: OK, except a stream the client stopped at its headless bounds, which ends CANCELLED by the client’s own choice and passes. A failure reads grpc_status: expected OK, got NOT_FOUND (5).
  • metadata takes the operators of header (equals, contains, matches, exists) and looks at the response headers, then the trailers; names match case-insensitively.
  • json assertions read the response message of a unary or client-streaming call at $, and the received messages of a server-streaming or bidi call at $.messages: - json: {path: "$.messages", length: 3} passes when 3 messages arrived (after a headless stream bound, over the messages collected).
  • latency reads first_byte_ms (ttfb_lt) and total_ms (total_lt).
  • Captures take from: json (same document as json assertions) and from: metadata (name: the first value among headers, then trailers).

status, header, body and schema assertions are evaluated as for HTTP against a response with no HTTP status (0); prefer the gRPC checks.

In rustman run

rustman run executes kind: grpc files in collection order with the other kinds, sharing variables and captures: an HTTP login can capture a token that a later gRPC request sends as metadata. Without assertions a call passes on OK (or when stopped at its stream bounds) and fails on any other status (exit code 1). An expired deadline (DEADLINE_EXCEEDED (4)) and a call that ends without a status (unreachable server, TLS error, no schema, unknown field) make the request errored (exit code 3). Server-streaming and bidi calls stop at their headless bounds.

Each call is recorded in history with the request as GRPC <target>/<package.Service/Method>, its metadata with secrets replaced by their placeholders (Bearer «redacted:token»), and the messages sent. The record and the JSON report hold a grpc object with the exchange (protocol: grpc, call_type, transport, status, headers, trailers, messages, timeline, timings), redacted like every other output; a call that ended without a status records error: {kind, message} instead, with kind config (the request cannot be sent as written) or request. gRPC calls are not replayed by rustman history replay.

In the TUI

The TUI opens kind: grpc requests in the gRPC editor: a method browser over the target’s schema (with the descriptor cache for offline browsing and Ctrl+G to refresh it), a message editor seeded from the picked method’s template, the metadata and assertions as YAML, and a response viewer with the messages, the status with its decoded details, headers and trailers, and the message timeline filtered by direction (d) and text (f). During a bidi call, Ctrl+R sends the Message tab on the open stream and Alt+X half-closes it. Interactive streams are not bounded by stream; they run until the server ends them, the deadline expires, or you cancel them with Esc.

Agent tools

The agent MCP server registers three gRPC tools when it is built with gRPC support (the default grpc feature of rustman-mcp; a build without it lists none of them):

ToolArgumentsWhat it does
grpc_listtarget or path, refresh, varsThe services and methods of a target or saved kind: grpc request, with their call types
grpc_describetarget or path, symbol, refresh, varsOne service, method (with a request template) or message
grpc_callpath, or target with method, message, metadata and deadline_ms; varsOne unary or server-streaming call, through the runner: assertions, captures and history apply

Every tool checks the target against the session’s allowlist before any traffic, reflection included: a target is checked as the http or https origin it is reached over (grpc://127.0.0.1:50051 as http://127.0.0.1:50051, grpcs:// as https://, a bare host:port by its TLS setting). List those origins in [agent].allowed_hosts, or let the active environment’s grpc:// and grpcs:// values count, as its http(s) values do. A target outside the allowlist is refused with code: "blocked" and host not allowed, and the refusal is in the audit log. Production hosts are refused as for every agent request. Each reach is admitted and paced by the session’s [safety].rate and [safety].concurrency, shared with the other requests of the session.

grpc_call follows the read-only default of agents. gRPC has no read verbs (every call is an HTTP/2 POST), so the proto decides: a method marked free of side effects is a read, and agents may call it freely:

rpc GetProduct(GetProductRequest) returns (Product) {
  option idempotency_level = NO_SIDE_EFFECTS;
}

Any other method is a mutation. It is refused with code: "blocked" and mutations not allowed for agents unless [agent] allow_mutations = true, and then the human must confirm it (MCP elicitation; [agent] require_confirmation = false accepts it unattended), as for an HTTP POST. grpc_list shows read_only: true on the methods agents may call without that. Nothing is sent before these checks pass.

grpc_call refuses client-streaming and bidi methods before sending anything (code: "blocked", only unary and server-streaming methods are available to agents (shop.v1.Catalog/Chat is bidi)). Server streams stop at the request’s headless bounds (100 messages or 30 s by default). Results carry the status (with decoded details), the response headers and trailers, the received messages and the assertions, redacted with the session’s secrets and capped by [agent].max_output_bytes like every agent result: a server echoing a secret shows «redacted:token».

CLI commands

A target is host:port, grpc://host:port, grpcs://host:port or a {{variable}} holding one (resolved in the active environment). Commands that take <target|request> also accept a kind: grpc request file, id or name, whose target, TLS options and schema apply. --var k=v, --env, --workspace and --insecure work as for other commands.

rustman grpc list

rustman grpc list <target|request> lists every service with its methods, call types and message types; --json prints one JSON object per service. Inside a workspace, reflection results are cached; --refresh asks the server again. A cached answer prints the stale-data notice on stderr.

$ rustman grpc list grpc://localhost:50051
service shop.v1.Catalog
  GetProduct (unary): shop.v1.GetProductRequest -> shop.v1.Product
  ListProducts (server streaming): shop.v1.ListProductsRequest -> shop.v1.Product
  UploadProducts (client streaming): shop.v1.Product -> shop.v1.UploadSummary
  Chat (bidi): shop.v1.ChatMessage -> shop.v1.ChatMessage

rustman grpc describe

rustman grpc describe <target|request> <symbol> describes a service, a method (package.Service/Method: its call type, request and response types and a request template) or a message (its fields and template); --json prints the description as JSON.

rustman grpc call

rustman grpc call <request> sends a kind: grpc request; rustman grpc call --target <t> --method <m> --data <json> sends an ad-hoc one (--data defaults to {}; a JSON array sends each entry, for client and bidi streaming). --metadata "name: value" (repeatable) and --deadline-ms complete an ad-hoc call. Calls go through the runner: variables, captures, assertions, history and redaction apply as in rustman run.

The response messages are printed on stdout as indented JSON, and the status (with its decoded details) on stderr. With --json, each received message is one JSON line, followed by a final status line:

$ rustman grpc call --target grpc://localhost:50051 --method shop.v1.Catalog/ListProducts --data '{}' --json
{"id":"p-1","name":"Product p-1"}
{"id":"p-2","name":"Product p-2"}
{"id":"p-3","name":"Product p-3"}
{"status":{"code":0,"name":"OK","message":"","details":[]},"headers":[...],"trailers":[...]}

rustman grpc health

rustman grpc health <target> [--service <name>] calls grpc.health.v1.Health/Check (the whole server without --service) and prints the serving status: SERVING, NOT_SERVING, SERVICE_UNKNOWN or UNKNOWN. --json prints {"status": "<status>"}; --timeout bounds the check (default: [defaults] timeout_ms).

Exit codes

Command0123
rustman grpc callthe call passed (OK without assertions)another status, or a failed assertionthe call cannot be sent as written: no schema (server reflection unavailable), unknown method or field, invalid metadatano status came back (connect, TLS) or the deadline expired
rustman grpc healthSERVINGNOT_SERVING, SERVICE_UNKNOWN, UNKNOWNinvalid targetthe check failed, UNIMPLEMENTED included
rustman grpc list / describelistedno schema, unknown symbolunreachable server with nothing cached

Ctrl+C stops a call and exits with 130.

WebSocket and Server-Sent Events

Rustman opens WebSocket sessions and listens to Server-Sent Events (SSE) streams from saved request files: chat and trading feeds, notifications, dashboards and LLM token streams. Each session records a message timeline, ends on its own under rustman run, and takes assertions and captures over the messages it received. The file format is in request-files.md; the behavior is specified in openspec/specs/realtime-sessions. GraphQL subscriptions are covered by GraphQL and JSON-RPC subscriptions by JSON-RPC.

WebSocket sessions

A kind: ws session opens with the RFC 6455 handshake through the same stack as HTTP requests: the file’s headers, auth helpers and the cookie jar go into the upgrade request, [http] proxies are tunnelled (HTTP CONNECT, HTTPS, SOCKS5), and wss:// uses TLS with verification on and the file’s tls settings (ca_bundle, client certificates, verify: false for insecure). A certificate that does not verify fails with a TLS error naming the host. subprotocols are offered in order in Sec-WebSocket-Protocol; the handshake response status, headers and the subprotocol the server chose are recorded. No WebSocket extension is offered: permessage-deflate is not negotiated.

A server that answers the upgrade with another status than 101 fails the session with ws: handshake failed: <status> <reason>, such as ws: handshake failed: 401 Unauthorized (exit code 3 under rustman run); its headers and body (up to 64 KiB) are recorded.

Once open, the session runs its steps in order:

version: 1
kind: ws
name: Orders
url: wss://{{host}}/orders
steps:
  - send: {json: {id: 1, op: subscribe, channel: orders}}
  - wait_for: {json: {path: $.id, equals: 1}, timeout_ms: 2000}
  - send: {ping: aGk=}
  - sleep: 500
  - close: {code: 1000, reason: done}
  • send sends a text frame, a JSON value (serialized compactly as a text frame), a binary frame from base64 or from {file: <path>} (a file larger than limits.max_message_bytes is refused before it is read), or a ping (at most 125 bytes of data). Sending on a closed socket fails with ws: not connected.
  • wait_for waits for a message that arrives after the step starts and matches its JSONPath check (equals, matches or exists, with the same evaluator as json assertions) or its regular expression. A message that is not JSON never matches a JSONPath check. After timeout_ms (default 5000) the session fails with ws: wait_for timed out after <n> ms (<matcher>), such as ws: wait_for timed out after 300 ms (regex pong).
  • sleep waits, recording what arrives.
  • close sends a close frame (code default 1000; a reason of at most 123 bytes, as a control frame allows), waits up to 2000 ms for the server’s close, then drops the connection.

Messages that arrive while no wait_for is active are still recorded. Server pings are answered automatically; the pong to one of our pings is recorded with its round-trip time (rtt_ms). A close from the server ends the session and is recorded with its code and reason, such as closed by server: 1008 policy.

SSE sessions

A kind: sse session sends its request (GET by default, or any method with a body, such as the POST of an LLM API) through the HTTP engine, with the same auth helpers, signing, cookies, TLS and proxies as kind: http, Accept: text/event-stream unless the file sets Accept, and Accept-Encoding: identity so the stream arrives as it is written. The response must be a success with Content-Type: text/event-stream; otherwise the session fails with sse: unexpected content type <type> (for example sse: unexpected content type application/json) or sse: unexpected status <status> <reason>.

The stream is parsed per the WHATWG HTML specification, by the same parser GraphQL over SSE uses:

  • lines end with CRLF, LF or CR, and a leading byte order mark is skipped;
  • lines starting with : are comments;
  • event sets the event type (default message), data lines are joined with \n, id sets the event’s id (kept for the following events; an id holding NUL is ignored), and retry (digits only) sets the reconnection delay;
  • an event or id value longer than 4 KiB is ignored, as if the line were absent: both are copied into every event they apply to, so they stay small;
  • a blank line dispatches the event, when it has data, and only then does its id become the last event id: an event the connection cut before its blank line never moves Last-Event-ID.

The stream event: update\ndata: line1\ndata: line2\nid: 7\n\n records one event of type update, id 7 and data line1\nline2.

Reconnect and resume

When the stream ends or the connection drops, the session reconnects after the last retry value (default 3000 ms; a larger value than 60000 ms is capped at 60000 ms, with an error note in the timeline), sending Last-Event-ID with the last event id received, up to reconnect.max_attempts times (default 5; 0 disables reconnecting). last_event_id in the file sets the header of the first connection. A reconnection answered with 204 No Content stops reconnecting and ends the session normally. Each reconnection is a system entry of the timeline, such as reconnected (attempt 1, Last-Event-ID: 42).

The timeline

Every frame, event and connection change is a timeline entry:

FieldMeaning
dirsent, received, or system (connect, reconnect, close, errors).
t_msMilliseconds since the session started.
sizeThe payload size in bytes.
typetext, json, binary, ping, pong, close, a system note (connect, reconnect, error) or the SSE event type.
payloadThe text; binary data in base64.
idThe SSE event id.
rtt_msThe round-trip time of a pong answering one of our pings.

The timeline keeps at most limits.max_timeline entries (default 10000) and at most 256 MiB of payloads, types and ids, so memory stays bounded however large the messages are: the oldest entries are dropped and counted in dropped_entries (the newest entry is always kept). The TUI’s live view keeps the same bounds.

Entries reach the terminal (rustman ws connect, rustman sse listen) and the TUI’s live view through a bounded feed. At most 1024 entries, holding at most 64 MiB, wait for the display; a single larger entry is still shown when nothing else waits. A display slower than the messages never slows the session down. Entries that do not fit are not shown, and a note says how many were skipped, in place: on stderr, warning: output fell behind: <n> timeline entries not shown (the session's timeline and history keep them), and in the TUI a system entry, <n> entries not shown: the display fell behind. Skipped entries are still recorded in the timeline, so assertions, history and reports see every one of them.

Bounds and limits

Under rustman run a session runs its steps, then listens until limits.max_messages received messages (default 50) or limits.duration_ms since it started (default 30000), whichever comes first, and closes with code 1000. The end is recorded as max_messages reached (50) or duration reached (30000 ms). A server that streams forever is therefore always bounded. Ctrl+C closes the session.

A WebSocket message larger than limits.max_message_bytes (default 16 MiB) closes the session with code 1009 (the rest of what the server sends is read and discarded until it closes the connection, for at most 2000 ms, so the close frame reaches it), and an SSE event larger than it aborts the stream; the timeline records message too large: <n> bytes and the session fails. This limit is the only one for realtime sessions: [http] max_body_bytes does not apply to them.

The bound names limits.max_messages and limits.duration_ms differ from the top-level max_events and max_duration_ms of GraphQL and JSON-RPC subscriptions.

Assertions and captures

Realtime requests take the assertions and captures of assertions.md, evaluated after the session ends, over a document whose messages member lists every message received, in order: its payload parsed as JSON, or its text when it is not JSON. Control frames (ping, pong, close) and system entries are not messages.

AssertionMeaning
json: {path: '$.messages[0].type', equals: snapshot}A JSONPath check over the messages.
body: {contains: trade}A text check over the messages document.
messages: {count_gte: 3}How many messages were received (count_gte, count_lte or count_eq), dropped entries included.
close_code: 1000The close code either side sent. A failure reads close_code: expected 1000, got 1011.
latency: {ttfb_lt: 500}ttfb_lt bounds the time to the first message; total_lt the whole session.
status, headerThe handshake response (WebSocket) or the stream’s response head (SSE).
version: 1
kind: sse
name: Prices
url: https://{{host}}/prices
limits: {max_messages: 5}
assertions:
  - messages: {count_eq: 5}
  - json: {path: '$.messages[0].symbol', exists: true}
captures:
  - {var: first_symbol, from: json, path: '$.messages[0].symbol'}

A session that fails (a refused handshake, a wait_for timeout, an oversized message) errors the request instead, and its assertions are not evaluated.

History and reports

Each session is one history entry and one report request, with the opening request under sent and a realtime record:

{
  "protocol": "ws",
  "handshake": {"status": 101, "headers": [], "subprotocol": "v1.feed"},
  "timeline": [
    {"dir": "system", "t_ms": 3, "size": 0, "type": "connect", "payload": "connected (subprotocol v1.feed)"},
    {"dir": "sent", "t_ms": 4, "size": 26, "type": "json", "payload": "{\"op\":\"subscribe\",\"n\":1}"}
  ],
  "dropped_entries": 0,
  "received": 0,
  "end": {"reason": "closed by client: 1000", "close_code": 1000},
  "elapsed_ms": 12.5
}

Payloads larger than 64 KiB are kept as a preview with truncated: true; size keeps the full size. Types and ids (SSE event names and ids) are cut to 1 KiB the same way, also marking the entry truncated: true. Each payload (and a refused upgrade’s body) is redacted whole before it is cut, so a secret that crosses the 64 KiB mark never leaves a part of itself in the preview. Everything is redacted like any other record: secrets in the URL, headers, payloads, types (SSE event names), ids and close reasons appear as «redacted:<name>», and so do the credentials the opening request carried on the wire (auth helpers, cookies from the jar) or the response set, so a URL with ?token={{api_token}} is stored as ?token=«redacted:api_token», and sensitive handshake headers (such as Set-Cookie) are hidden. Sessions cannot be replayed with rustman history replay. The realtime member is part of the report schema.

rustman ws connect and rustman sse listen

rustman ws connect <url|request> opens a WebSocket session and prints each message the server sends; rustman sse listen <url|request> prints each event of a stream. The target is a URL (or a {{variable}} holding one), or a saved kind: ws / kind: sse request by file, id or name, which runs with its steps, assertions and captures:

rustman ws connect wss://echo.example.com --json --max-messages 2 < frames.txt
rustman ws connect {{feed_url}} --header "Authorization: Bearer {{token}}" --subprotocol v2.feed
rustman sse listen https://api.example.com/events --json --max-messages 3 | jq .data
rustman sse listen streams/completions.rman.yaml --env prod
  • When stdin is not a terminal, ws connect sends each line of it as a text frame (without its line ending, and without interpolation), while the session runs. At most 64 lines wait to be sent: a faster stdin (a large file) is read only as the session sends.
  • Messages are printed as they arrive, each followed by a newline: the payload as received (binary data in base64), so a payload that holds newlines (multi-line SSE data, pretty-printed JSON) spans several lines. With --json, each message is one JSON object on one line (newlines in the payload are escaped), ready for jq: {"t_ms": 12, "dir": "received", "type": "tick", "size": 7, "id": "1", "data": "{\"n\":1}"}. type is the frame type (text, json, binary) or the SSE event type, and id is the SSE event id (null without one). Sent frames, pings, pongs and system notes are not printed; they are in the session’s history record.
  • Sessions are bounded as under rustman run: --max-messages <n> and --duration <duration> replace the request’s limits.max_messages and limits.duration_ms (defaults 50 messages and 30 s), and the session then closes with code 1000. Ctrl+C closes it at once.
  • --header "Name: value" (repeatable) adds handshake or request headers to a URL; --subprotocol <name> (repeatable) offers WebSocket subprotocols in order. A saved request already defines both, so these flags are refused with one. --env, --workspace, --var, --insecure, --no-history and --trace (send trace context on the handshake or stream request) work as for rustman send.
  • Everything printed comes from the session’s redacted feed: a secret the server echoes appears as «redacted:<name>». The session is recorded in history like any request (outside a workspace, nothing is recorded).

Exit codes: 0 when the session ended normally (its steps done, a bound reached, or closed by the server), 1 when an assertion of the request failed, 2 for a usage error (such as a request of another kind), 3 when the session failed (ws: handshake failed: 401 Unauthorized, a transport error, a wait_for timeout, an oversized message), and 130 on Ctrl+C.

In the TUI

kind: ws and kind: sse requests open in the realtime editor of the terminal UI: Ctrl+R connects and the Timeline tab lists the entries as they arrive, with filters by direction, type and text and the selected payload pretty-printed; the Compose tab sends text, JSON or binary frames while the session is open, and Esc closes it. Interactive sessions have no headless bounds: they stay open until you close them or the server does.

Agent tool

The agent MCP server registers the realtime_listen tool. It takes either path (a saved kind: ws or kind: sse request) or url (ws:// / wss:// for a WebSocket, http:// / https:// for an SSE stream; a URL that starts with a {{variable}} opens an SSE stream unless frames are given) with optional frames (a string is a text frame, any other value is sent as JSON), plus max_messages, duration_ms and vars. It returns the received messages (t_ms, type, id, data), how the session ended and the request’s assertions, all redacted.

  • A session stops after at most 100 messages or 60 s, whatever max_messages, duration_ms or the file’s limits ask for.
  • The tool follows no live feed: it reads the session’s timeline once the session ends, so it has the same bounds as the timeline.
  • The URL must pass the agent allowlist ([agent] allowed_hosts, or the hosts of the active environment); a ws:// URL is checked as its http:// origin and wss:// as https://, and the environment’s ws(s):// values count as those origins. Otherwise the call is refused with blocked: host not allowed and nothing is opened.
  • Sending frames is a mutation, whether they come from frames or from the send steps of a saved request: with [agent] allow_mutations = false (the default) the call is refused with blocked: sending frames requires allow_mutations, and otherwise the human confirms it as for any mutating request. An SSE POST stream is a mutation too.
  • Sessions are recorded in history like any request.

Messaging: Kafka, MQTT and AMQP

Rustman produces and consumes broker messages from request files of kind kafka, mqtt and amqp. Each file is one operation: produce (publish) or consume (subscribe). The behavior is specified in openspec/specs/messaging-requests. All clients are pure Rust over rustls; the build needs no librdkafka, OpenSSL or CMake.

This page covers the request file format, the Kafka, MQTT and AMQP clients, AsyncAPI import, payload validation, running messaging requests in collections (assertions, captures, start: before_next, history), the safety rules for agents, the CLI commands and the TUI pane.

Request files

version: 1
kind: kafka
name: Create order
operation: produce
brokers: ['{{kafka_host}}:9092']
topic: orders
partition: 0
messages:
  - key: order-1
    value: {id: 1, total: 9.5}
    headers:
      - {name: source, value: rustman}

Common fields:

FieldMeaning
operationproduce or consume. A missing or other value fails to load with messaging: operation must be produce or consume.
brokersKafka bootstrap brokers: a list of host:port, or one comma-separated string. Required for kind: kafka.
brokerThe MQTT or AMQP broker URL. Required for kind: mqtt and kind: amqp.
topicThe Kafka topic, or the MQTT topic (a filter with + and # for subscribe).
exchange, routing_key, binding_key, queueThe AMQP destination.
messagesProduce only: the messages to send, in order (see below). At least one is required.
limitsmax_messages (default 10) and duration_ms (default 30000) bound a headless consume; max_message_bytes (default 1048576, 1 MiB) is the most of a value kept per message. Zero is refused.
startimmediately (default) or before_next: within a run, the consume subscribes, the next step runs, then the consume ends.
tlsverify, ca_bundle, client_cert, client_key, client_pkcs12 and client_pkcs12_password, as for kind: ws.
authMQTT and AMQP credentials: username and password. Kafka uses security instead.
schema_registryA Confluent-compatible Schema Registry (see below).
asyncapi{document, message}: validate payloads against an AsyncAPI message’s payload schema (see Payload validation).
variables, assertions, capturesAs for other kinds.

A field that does not apply to the kind or operation fails to load, for example kafka: 'partition' does not apply to consume requests. {{variables}} and {{secret:...}} references resolve in every string field, including keys, values and headers.

Message payloads

Each entry of messages has a value, an optional key and optional headers (ordered name/value pairs). A key or value is:

  • a string, sent as UTF-8 text;
  • any other YAML/JSON value, sent as compact JSON ({id: 1, total: 9.5} is sent as {"id":1,"total":9.5});
  • {base64: AAE=}, sent as the decoded bytes;
  • {file: fixtures/blob.bin}, the bytes of a file relative to the request file. A path that leaves the workspace fails with file path escapes workspace.

A missing or null value sends no value (a Kafka tombstone).

Kafka

Produce

operation: produce
brokers: localhost:9092
topic: orders
partition: 0      # optional
acks: all         # all (default), leader or none

Each message goes to partition when set, else to the partition the Java client’s default partitioner picks for its key (murmur2), so keyed messages land where standard producers put them. Keyless messages go round robin. The exchange records the partition and offset of every message. An unknown topic fails with kafka: unknown topic '<name>', an unknown partition with kafka: topic '<name>' has no partition <n>.

Limitations of the client (rskafka):

  • Produce always waits for every in-sync replica. acks: leader and acks: none are accepted and sent as acks: all, with a warning.
  • A header name holds one value; a repeated name keeps the last value, with a warning. Headers are sent in name order.
  • Messages are sent uncompressed. Consumed batches compressed with gzip or snappy are read; lz4 and zstd batches are not supported.
  • No idempotent producer, transactions or OAUTHBEARER.

Consume

operation: consume
brokers: localhost:9092
topic: orders
partitions: [0, 1]                          # default: all
offset: earliest                            # earliest, latest (default), 42 or {timestamp: ...}
limits: {max_messages: 5, duration_ms: 10000}

A consume reads each partition from its start offset without joining a consumer group and without committing offsets, so it never changes what other consumers see. An absolute offset is kept within the partition’s current range. With {timestamp: "2026-11-17T09:00:00Z"} (RFC 3339), only messages with timestamps at or after that time are returned.

Each message is recorded with its partition, offset, timestamp, key, headers and value. Values are shown as JSON when they parse as JSON, as text when they are UTF-8, else as {"base64": "..."}. A value larger than limits.max_message_bytes is cut to that size and marked truncated, with its full size. Under rustman run a consume stops at max_messages or duration_ms, whichever comes first.

Memory is bounded against a hostile broker: a response frame larger than the 4 MiB fetch size or limits.max_message_bytes (whichever is larger) plus 1 MiB fails the consume (with the default limit, 5 MiB), and the fetched records waiting to be recorded take at most 64 MiB (each partition reader also holds the one response it is reading). To read records larger than that, raise limits.max_message_bytes.

Security

security:
  protocol: SASL_SSL        # PLAINTEXT (default), SSL, SASL_PLAINTEXT, SASL_SSL
  mechanism: SCRAM-SHA-512  # PLAIN, SCRAM-SHA-256, SCRAM-SHA-512
  username: app
  password: '{{kafka_pw}}'
tls:
  ca_bundle: certs/ca.pem

SSL and SASL_SSL (or any tls block) connect with rustls through the same TLS settings as HTTP requests: verification on, the OS trust store plus ca_bundle, and client certificates for mutual TLS. SASL_* protocols require mechanism, username and password. Keep the password in an environment secret or a {{secret:...}} reference: it is redacted everywhere, so the exchange record shows «redacted:kafka_pw». A rejected login fails with kafka: authentication failed (<mechanism>). A broker that cannot be reached fails after the connect timeout (10 s).

Schema Registry

schema_registry:
  url: 'http://{{registry_host}}:8081'
  subject: orders-value       # produce: encode values with this subject
  schema_version: latest      # or a version number
  auth: {type: basic, username: sr, password: '{{sr_pw}}'}

Consumed keys and values in the Confluent wire format (magic byte 0 and a 4-byte schema id) are decoded by fetching the schema by id and shown as JSON, with schema_id noted. Avro, Protobuf (the registry’s .proto text, compiled in-process; imports other than the Google well-known types are not resolved) and JSON Schema payloads are supported. Schemas are fetched once per run. When a schema cannot be fetched or does not match, the raw bytes are shown and the exchange carries a warning such as schema registry: schema id 42: the registry answered HTTP 404; showing the raw bytes; the consume does not fail.

With subject, produce encodes each JSON value with that subject’s schema (schema_version, default latest) and sends it in the wire format.

Registry requests follow redirects as HTTP requests do, except in agent runs (see Safety): there a redirect is not followed and its schema fetch fails with the registry answered HTTP 302 (a warning on consume).

MQTT

version: 1
kind: mqtt
name: Room temperature
operation: produce
broker: 'mqtts://{{mqtt_host}}'
topic: sensors/room1/temp
protocol_version: 5     # 5 (default) or "3.1.1"
qos: 2                  # 0, 1 (default) or 2
retain: false
properties:             # MQTT 5 only
  content_type: application/json
  response_topic: replies/room1
  message_expiry: 60    # seconds
  correlation_id: c-1
auth: {username: app, password: '{{mqtt_pw}}'}
messages:
  - value: {celsius: 21.5}
    headers: [{name: unit, value: C}]   # MQTT 5 user properties

The broker URL picks the transport: mqtt:// (TCP, port 1883), mqtts:// (TLS, port 8883), ws:// and wss:// (WebSocket with the mqtt subprotocol; the path is part of the URL). TLS uses the same settings as HTTP requests, so tls.ca_bundle and tls.client_cert/client_key (or client_pkcs12) work for mutual TLS. MQTT messages have no key; message headers are sent as MQTT 5 user properties, so headers and properties need protocol version 5.

A publish waits for each message’s acknowledgement and records it: PUBACK for QoS 1, PUBREC/PUBREL/PUBCOMP for QoS 2 (nothing for QoS 0). A refused publish fails with mqtt: publish to '<topic>' refused (<reason>).

operation: consume
broker: mqtt://localhost
topic: 'sensors/+/temp'   # + and # wildcards
qos: 1
client_id: probe-1        # default: rustman-<8 random hex digits>
clean_session: false      # default true; false needs a fixed client_id
limits: {max_messages: 5, duration_ms: 10000}

A subscribe connects with a clean session (3.1.1) or clean start (5) and a generated client id, so it leaves no state on the broker. Each message is recorded with its exact topic, QoS, retain flag, user properties (as headers), MQTT 5 properties and payload. With clean_session: false the broker hands over messages it queued for that client id, which removes them from the broker (agents need allow_destructive for it, see Safety); the exchange warns: mqtt: clean_session is false: queued messages for client id 'probe-1' will be consumed from the broker. A rejected login fails with mqtt: authentication failed (username/password).

The client uses rumqttc’s MQTT 3.1.1 and 5 packet codecs over Rustman’s own TCP, rustls and WebSocket connection.

AMQP

version: 1
kind: amqp
name: Order created
operation: produce
broker: 'amqps://{{rabbit_host}}/%2f'
exchange: orders          # "" for the default exchange
routing_key: order.created
mandatory: true           # fail when no queue is bound
properties:
  content_type: application/json
  correlation_id: c-1
  reply_to: replies
  delivery_mode: 2        # 1 transient, 2 persistent
  expiration: 60000       # per-message TTL in ms
auth: {username: app, password: '{{rabbit_pw}}'}
messages:
  - value: {id: 1}
    headers: [{name: source, value: rustman}]   # the AMQP headers table

Publishes use publisher confirms and record confirm per message. A negative confirm fails with amqp: message not confirmed; a mandatory message that no queue receives fails with amqp: unroutable (a request failure, exit code 3 in a run). auth overrides credentials in the URL. amqps:// uses the shared TLS settings.

operation: consume
broker: amqp://localhost
exchange: orders
binding_key: 'order.*'    # default '#'

By default a consume declares a server-named, exclusive, auto-delete queue, binds it to exchange with binding_key, reads it, and deletes it when the consume ends, so existing queues are untouched. Each message is recorded with its exchange, routing key, redelivered flag, headers, properties and payload.

Reading an existing queue removes its messages, so queue needs an opt-in, or the file fails to load with amqp: consuming from an existing queue removes messages; set destructive: true or use requeue:

operation: consume
broker: amqp://localhost
queue: payments
requeue: true        # inspect without removing
# or: destructive: true, with ack: auto (default) or manual

Every consume sets the prefetch to limits.max_messages (at most 100 when each delivery is acknowledged as it is recorded; with requeue: true it is limits.max_messages, since every delivery stays unacknowledged), so the broker never delivers more messages than are recorded and the client holds at most that many. limits.max_message_bytes trims what is recorded; the AMQP client still receives each message body whole (it cannot refuse a delivery by its announced size), so the memory in flight is at most the prefetch times the broker’s largest message: consume only from brokers you trust. The client asks for a frame size of at most 128 KiB (a frame_max in the broker URL can lower it, and frame_max=0 means the cap), and keeps the smaller of that and the broker’s, so a broker announcing a huge or unlimited frame_max cannot make it allocate large buffers. With requeue: true deliveries stay unacknowledged and are all handed back to the queue when the consume ends. With destructive: true each message is acknowledged (and so removed) right after it is recorded, whether ack is auto or manual; messages beyond max_messages stay in the queue.

AsyncAPI import

rustman import asyncapi asyncapi.yaml            # or an http(s) URL
rustman import asyncapi asyncapi.yaml --into events

AsyncAPI 2.6 and 3.0 documents (JSON or YAML) are read with the same reference resolver as OpenAPI import: local $refs and files next to the document; remote references only with --allow-remote-refs. Other versions fail with asyncapi: unsupported version 2.0 (supported: 2.6, 3.0) and exit code 2.

  • Each server with a Kafka, MQTT or AMQP protocol becomes environments/<server>.yaml with a brokers (Kafka) or broker (MQTT, AMQP) variable; server variables take their defaults. Servers of other protocols are skipped with a warning.
  • Each operation becomes <collection>/<channel>/<operation>.rman.yaml (kebab-case names): produce for publish (2.6) and send (3.0), consume for subscribe and receive. A produce gets one message per documented message, with the first example payload, else one synthesized from the payload schema (and a Kafka key from the kafka binding’s key schema).
  • The document is treated as untrusted: a {{ in an example or schema default string, a channel address, an exchange or a queue is written as \{{, so an imported request never resolves a variable or a {{secret:...}} reference the document planted (object keys are never interpolated).
  • Channel parameters (orders/{id}) become {{id}} variables, or + in an MQTT subscription. MQTT qos/retain and AMQP exchange and queue bindings are used; other bindings are ignored with a warning. An AMQP consume without an exchange binding reads its queue with requeue: true.
  • The bundled document is written as <collection>/asyncapi.json, and requests whose message has a payload schema reference it with asyncapi, so payloads are validated.

The collection folder defaults to the document title in kebab-case; files that already exist are kept and reported.

Payload validation

asyncapi:
  document: ../asyncapi.json   # relative to the request file, inside the workspace
  message: OrderCreated        # the message's name or its key

Before a produce, every value is validated against the message’s payload schema (references into the document’s components resolve). If one does not match, nothing is sent and the error lists up to 10 violations with their instance paths, such as asyncapi: message 1 does not match 'OrderCreated', nothing was sent: /: missing required property 'id'. After a consume, each message records its schema_violations, and the implicit asyncapi_schema assertion fails when any message breaks the schema. Values cut at limits.max_message_bytes are not checked.

Runs, assertions and history

rustman run runs messaging requests in collection order with the other kinds, sharing variables and captures. A produce passes when every message was sent and acknowledged; a consume passes when it ends at its bounds, even with no message. A failure to connect, authenticate or send makes the request errored (exit code 3), and a failed assertion makes it failed (exit code 1).

Headless bounds

Under rustman run a consume stops after limits.max_messages messages (default 10) or limits.duration_ms (default 30000), whichever comes first, then disconnects cleanly. A consume of a quiet topic with limits: {duration_ms: 2000} ends after 2 s with zero messages. rustman kafka|mqtt|amqp consume takes the same bounds, which --max-messages and --duration replace; the TUI consumes until you stop it.

Assertions and captures

Assertions and captures read the exchange as a JSON document: $.messages[*] for a consume (each with partition, offset, timestamp, topic, routing_key, key, headers, value and size, as the broker gives them) and $.produced[*] for a produce (with partition and offset, or the broker’s ack). Values that are JSON are matched as JSON. messages: {count_gte | count_lte | count_eq} counts the consumed messages, and header assertions read the headers of every consumed message.

version: 1
kind: kafka
name: Order events
operation: consume
brokers: '{{kafka_brokers}}'
topic: orders
start: before_next
limits: {max_messages: 1, duration_ms: 10000}
assertions:
  - messages: {count_eq: 1}
  - json: {path: '$.messages[0].value.type', equals: OrderCreated}
  - header: {name: source, equals: shop}
captures:
  - var: order_id
    from: json
    path: $.messages[0].value.id

A consume validated against an AsyncAPI message also gets the implicit asyncapi_schema assertion (see Payload validation).

Produce then consume: start: before_next

A consume with start: before_next subscribes first, then the next request of its folder runs while it collects, and its assertions are evaluated once both are done. The subscription is ready when Kafka offsets are resolved, the MQTT SUBACK arrived, or the AMQP queue is bound and consuming, so an event the next request causes cannot be missed. With the consume above saved as orders/1-events.rman.yaml, this request runs while it listens:

version: 1
kind: http
name: Create order
method: POST
url: '{{base_url}}/orders'
body:
  type: json
  content: {item: book}
assertions:
  - status: 201

Set limits.max_messages to the number of events you expect, so the consume ends as soon as they arrived instead of at duration_ms. Without a next request in the folder, before_next runs the consume on its own.

History

Each produce or consume is one history entry with protocol kafka, mqtt or amqp under record.messaging: the brokers, the destination, each message’s metadata, and its key and value. An unbounded consume (the TUI) keeps only its newest 10000 messages and 64 MiB (of messages as JSON) in the exchange, so memory and the history entry stay bounded; the oldest beyond that are dropped and counted in dropped. Keys and values larger than 64 KiB are kept as a 64 KiB text preview with truncated: true and their full size (a 200 KiB value is stored as a 64 KiB preview and size: 204800). Secrets are replaced by «redacted:name» before anything is stored or printed, including credentials written as literals (security.password, auth.password and the password of a broker URL, shown as «redacted:password»; a URL that does not parse, such as amqp://guest:pa/ss@rabbit/ with an unencoded /, has its userinfo read up to the last @, so such a password is redacted too) and secrets that appear in payloads or headers. Messaging entries are not replayed by rustman history replay.

Safety

Producing (Kafka produce, MQTT publish, AMQP publish) is a mutation, and consuming from a named AMQP queue without requeue, or through a persistent MQTT session (clean_session: false), is destructive; every other consume is a read. A human running rustman run, the CLI commands or the TUI is not gated, as for HTTP requests.

Agents run messaging request files through send_request and run_collection of rustman mcp serve. Before anything connects:

  • a produce needs [agent] allow_mutations = true, else it is refused with blocked: produce requires allow_mutations; a named-queue consume needs [agent] allow_destructive = true (blocked: consuming from an existing queue requires allow_destructive), and so does an MQTT consume with clean_session: false (blocked: consuming through a persistent session (clean_session: false) requires allow_destructive);
  • every broker must pass the agent allowlist, checked as an origin: a Kafka host:port as http://host:port (port 9092 when none is given), mqtt://, tcp:// and amqp:// as http://, mqtts://, ssl:// and amqps:// as https://, and ws:///wss:// as their HTTP origin, with the protocol’s default port when the URL has none (1883, 8883, 5672, 5671, 80, 443). The host and port checked are the ones the client connects to: one parse serves both, hosts are lowercased and lose a trailing dot, and a broker containing a backslash, a control character or whitespace, or whose host is neither an IP address nor a DNS name, is refused as invalid input (as is a Kafka broker with credentials or a path). A host whose last label is numeric (127.1, 0177.0.0.1, 0x7f.1, 2130706433, 1.2.3.0x) must be a dotted-decimal IPv4 address without leading zeros, since URL parsers and resolvers read the other forms differently. An invalid-broker error never repeats the broker: it shows <scheme>://«invalid broker». Audit entries name the checked origins, never the broker’s credentials. Broker URL values of the active environment count for the allowlist; Kafka brokers, which are not URLs, need [agent] allowed_hosts, such as ["http://localhost:9092"];
  • a Kafka request’s schema_registry.url must pass the allowlist too, as a read, and registry redirects are not followed, since only that URL was checked;
  • only the Kafka bootstrap brokers are checked: the client then connects to the brokers the cluster advertises in its metadata, so allow only bootstrap brokers you trust;
  • a produce or a destructive consume is confirmed by the human, as for an HTTP POST.

list_requests shows messaging brokers without their userinfo, and get_request returns the file with its literal broker credentials (security.password, auth.password, broker and Schema Registry URL passwords, as written and percent-decoded, and the registry’s auth) replaced by «redacted:password»; as for HTTP literals, values shorter than 6 characters are not redacted, so keep credentials in secrets.

A refusal is the tool’s blocked error and gets an audit log entry. Agent consumes stop after at most 100 messages or 60 s. In a run, a refused operation is an error, and the run exits 4 instead of 3.

rustman kafka|mqtt|amqp produce and consume

Each command runs one operation: a request file (its path, id or name), or one described with flags. Without a workspace only flags work.

rustman kafka consume --brokers localhost:9092 --topic orders --offset earliest --max-messages 5 --json
rustman kafka produce --brokers localhost:9092 --topic orders --key order-1 --value '{"id":1}'
printf '21.5\n22.0\n' | rustman mqtt produce --broker mqtt://localhost --topic t/1
rustman mqtt consume --broker mqtt://localhost --topic 'sensors/+/temp'
rustman amqp produce --broker amqp://localhost --exchange orders --routing-key order.created --mandatory --value hi
rustman amqp consume --broker amqp://localhost --exchange orders --binding-key 'order.*' --json
rustman kafka consume events/orders.rman.yaml --duration 10s
  • Produce sends one message per --value; without --value, each line of a piped stdin is one message (a line’s text is sent as is, so a JSON line stays JSON). --key (Kafka) and --header "name: value" apply to every message. It prints where each message landed: produced partition 0 offset 41, or the acknowledgement (produced (PUBACK)).
  • Consume prints each message as it arrives: where it came from (p0@41, the MQTT topic, the AMQP routing key) and its value. With --json it prints one JSON object per message with partition, offset, timestamp, key, headers and value (Kafka), or topic, qos and retain (MQTT), or exchange, routing_key and properties (AMQP).
  • Flags: --brokers, --topic, --partition (repeatable for consume) and --offset (earliest, latest, a number or an RFC 3339 timestamp) for Kafka; --broker, --topic, --qos and --retain for MQTT; --broker, --exchange, --routing-key, --mandatory, --binding-key, --queue, --destructive and --requeue for AMQP. A request file defines its operation, so these flags cannot be combined with one. --var, --env, --workspace, --no-history and --json work for both.

The exit code is 0 when the operation passed, 1 when an assertion of the request failed, 3 when it failed (unreachable broker, unknown topic, unroutable message, failed login), 4 when the safety policy refused it, and 130 on Ctrl+C. Printed messages, errors and warnings are redacted like history.

TUI

Messaging requests open in the messaging pane. The URL row shows the operation (PRODUCE or CONSUME) and the broker address, and the tabs are:

  • Messages: the live consumer list. Each row shows where the message came from, its key and its value; the selected message’s value is shown below, pretty-printed when it is JSON, noted as decoded from Schema Registry id 7 when the Schema Registry decoded it, as text, or as a hex dump when it is binary. j/k move the selection, g/G jump to the first or newest message, and p (or Space) pauses the list, which then shows how many messages arrived since. The pane keeps at most 10000 messages: when the buffer is full the consumer stops, so it fetches nothing more, and what it collected is kept. It also keeps at most 64 MiB of messages: beyond that the oldest are dropped, and the status line says how many (3 oldest dropped (over 64 MiB)).
  • Compose: the messages a produce sends, as YAML.
  • Broker: the destination and connection settings (topic, partitions and offset, exchange, keys and queue, QoS, security, auth, TLS, Schema Registry, limits) as YAML.
  • Assertions: the request’s assertions, as YAML.

Ctrl+R runs the operation. A consume runs until Esc stops it (the exchange is then shown and recorded) or its buffer is full. Messages reach the pane redacted.

Testing against real brokers

Unit and integration tests use in-process fakes: a fake Schema Registry and an MQTT broker (3.1.1 and 5 over TCP, mutual TLS and WebSocket) on loopback. The runner, CLI and TUI tests use that MQTT broker; their Kafka variants (crates/rustman-messaging/tests/runner.rs and crates/rustman-cli/tests/messaging.rs) run in the CI messaging-kafka job. The MQTT and AMQP tests in tests/mosquitto.rs and tests/rabbitmq.rs run only in the CI messaging-mqtt-amqp job against Mosquitto (with a mutual-TLS listener) and RabbitMQ, and return early elsewhere (RUSTMAN_MQTT_BROKER, RUSTMAN_MQTTS_BROKER with RUSTMAN_MQTT_TLS_DIR, RUSTMAN_AMQP_BROKER). The Kafka broker tests in crates/rustman-messaging/tests/kafka_broker.rs run only in the CI messaging-kafka job, which starts Redpanda (PLAINTEXT and SCRAM-SHA-512) and checks that no consumer group exists after consuming. To run them locally:

docker run -d --name redpanda -p 9092:9092 redpandadata/redpanda:v24.2.27 redpanda start \
  --mode dev-container --smp 1 \
  --kafka-addr PLAINTEXT://0.0.0.0:9092 --advertise-kafka-addr PLAINTEXT://127.0.0.1:9092
RUSTMAN_KAFKA_BROKERS=127.0.0.1:9092 cargo test -p rustman-messaging --test kafka_broker
docker run -d --name rabbitmq -p 5672:5672 rabbitmq:4.1.4-alpine
RUSTMAN_AMQP_BROKER=amqp://guest:guest@127.0.0.1:5672/%2f cargo test -p rustman-messaging --test rabbitmq

Assertions and captures

Assertions are declarative checks on a response: its status, headers, JSON fields, schema, body text and timing. Captures extract values from a response into variables that later requests use, such as a login token. Together they turn a collection into a repeatable test, without a scripting language.

The examples on this page are checked by an integration test (crates/rustman-http/tests/docs_assertions.rs): the files below make up one workspace, every request in it is sent to an in-process test server that answers as described, and every assertion and required capture must pass. The failure messages quoted on this page are the exact texts Rustman prints, checked by unit tests in crates/rustman-core/src/assertions/tests.rs.

How assertions are evaluated

assertions is an ordered list in a request file. Each item has one key naming its type: status, header, json, schema, body or latency, or one of the GraphQL checks (no_errors, errors_count, error_message_contains, error_code, data) described in GraphQL, or rpc_error for JSON-RPC calls, described in JSON-RPC, or one of the MCP checks (is_error, content_text_contains, structured, output_schema, tool_exists) described in MCP client, or grpc_status and metadata for gRPC calls, described in gRPC, or one of the realtime checks (messages, close_code) described in WebSocket and SSE, or evm for evm-call files, described in EVM toolkit, or subgraph (max_lag_blocks) for GraphQL requests with the subgraph preset, described in Blockchain GraphQL presets.

  • Every assertion is evaluated, even after one fails, so a report shows all of them.
  • Each one ends as pass, fail (with the expected and actual values) or error (it could not be evaluated, for example a JSONPath on a body that is not JSON).
  • A request passes only when all its assertions pass. A request with no assertions passes on any completed response, whatever its status (a 500 included); the reporter still shows the status.
# users/get-user.rman.yaml
version: 1
kind: http
name: Get user
url: '{{base_url}}/users/42'
assertions:
  - status: 200
  - header:
      name: x-request-id
      exists: true
  - header:
      name: Content-Type
      contains: json
  - json:
      path: $.user_missing
      exists: false
  - json:
      path: $.id
      equals: 42
  - json:
      path: $.name
      matches: '^[A-Z][a-z]+$'
  - json:
      path: $.roles
      length: 2
  - json:
      path: $.roles
      contains: admin
  - json:
      path: $.roles[*]
      equals: [admin, dev]
  - json:
      path: $.address.city
      type: string
  - json:
      path: $.id
      gte: 1
  - body:
      contains: '"email"'
  - body:
      not_contains: password
  - latency:
      total_lt: 5000

Status

FormPasses when
status: 200the status is 200
status: [200, 201]the status is one of the list
status: "2xx"the status is in that class (1xx to 5xx)

A mismatch reads status: expected 200, got 404, status: expected one of [200, 204], got 201 or status: expected 2xx, got 500.

Headers

header: {name, <op>} with exactly one operator:

OperatorPasses when a value of the header…
equals: <text>is exactly the text
contains: <text>contains the text
matches: <regex>matches the regular expression
exists: true / exists: falseis present / is absent

Header names match case-insensitively. When a header repeats (several Vary or Set-Cookie lines), the assertion passes if any value satisfies it. Failures read header x-trace: expected to exist, got nothing or header vary: expected "Cookie", got "Accept", "Origin". Values of Authorization, Proxy-Authorization, Cookie and Set-Cookie are shown as «redacted:<Header>».

JSON fields

json: {path, <op>: value} selects nodes of a JSON body with an RFC 9535 JSONPath and compares them with exactly one operator:

OperatorPasses when the selection…
equals: <value>equals the value (numbers compare by value, so 1 equals 1.0)
not_equals: <value>does not equal the value
contains: <value>is a string containing the text, an array with an equal element, or an object with that key
matches: <regex>is a string (or a number or boolean, in its JSON form) matching the regular expression
gt, gte, lt, lte: <number>is a number >, >=, <, <= the bound
exists: true / exists: falsematches at least one node / matches nothing
length: <n>is an array, object or string (in characters) of that length
type: <name>is a string, number, integer, boolean, array, object or null
  • A path matching one node compares against that node. A path matching several nodes ($.roles[*], $..id, a filter) compares against the list of nodes, so equals: [admin, dev] and length: 2 apply to the list.
  • A path that matches nothing fails, it does not error: json $.nope: expected to exist, got nothing, or json $.nope: expected 1, got nothing for other operators. Only exists: false passes.
  • A body that is not JSON yields error: response body is not JSON. An invalid JSONPath, an invalid regular expression or an unknown type name is also an error.
  • Failures quote compact JSON: json $.user.id: expected 41, got 42, json $.items: expected length 3, got 2, json $.price: expected > 10, got 9.5, json $.name: expected type number, got string.

JSON Schema

schema: {file: <path>} validates the JSON body against a schema file, and schema: {inline: {...}} against a schema written in the request file. The file path is relative to the request file’s folder and must stay inside the workspace; schema files are JSON.

The default dialect is JSON Schema draft 2020-12. A schema whose $schema names draft-07 (http://json-schema.org/draft-07/schema#) is validated as draft-07. Remote $refs are not fetched.

File schemas/user.json:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": {"type": "integer"},
    "email": {"type": "string"},
    "roles": {"type": "array", "items": {"type": "string"}}
  }
}
# users/user-schema.rman.yaml
version: 1
kind: http
name: User matches its schema
url: '{{base_url}}/users/42'
assertions:
  - schema:
      file: ../schemas/user.json
  - schema:
      inline:
        $schema: http://json-schema.org/draft-07/schema#
        type: object
        properties:
          address:
            type: object
            required: [city]

On failure the message lists up to 10 violations, each with its instance path (a JSON Pointer, / for the root) and message, and then how many more there are:

schema: expected a valid document, got 2 violations: /: "id" is a required property; /email: 5 is not of type "string"

A schema that is itself invalid, an unreadable file or a body that is not JSON is an error.

Body text

body: {<op>: <text>} checks the decoded body text with one of contains, not_contains, matches (a regular expression) or equals. A binary body (not valid UTF-8) yields error: body is binary. Failures quote at most 200 characters of the body: body: expected not to contain "order", got "created order-123456".

Regular expressions everywhere (headers, JSON, body, captures) use the Rust regex syntax: matching takes linear time, and look-around and back-references are not supported. A pattern matches anywhere in the text unless anchored with ^ and $.

Latency

latency: {total_lt: <ms>} and latency: {ttfb_lt: <ms>} (both may be given) compare the exchange timings: the total time and the time to first byte (see timings). A slow response fails with latency total: expected < 200 ms, got 350 ms.

Variables in expected values

Expected values may use {{variable}}, resolved like the request itself: overrides, captures from earlier requests, request and collection variables, persisted captures, the environment and rustman.toml (see precedence). An unresolved name is an error that lists every missing name: error: json $.id: unresolved variable(s): user_id.

A variable always resolves to text. When an expected value is exactly a placeholder string, such as equals: '{{user_id}}', a number or boolean in the response compares through its text form, so a captured 42 equals the JSON number 42. A literal string does not: equals: 'true' does not match the boolean true.

A secret used in an expected value is redacted from every message, like everywhere else.

Captures

captures is a list evaluated after the assertions. Each capture sets one variable for every later request of the same run:

fromFieldsCaptures
jsonpaththe selected node: a string as is, any other value as compact JSON (42, {"a":1}); several nodes as a JSON array
headernamethe header’s first value (case-insensitive name)
statusnonethe status code, such as 201
body_regexpattern, optional groupa group of the first match in the body text: group 1 by default, or the whole match when the pattern has no groups
cookienamethe value of that cookie set by this response (Set-Cookie)
metadatanamegRPC only: the first value of that metadata entry among the response headers, then the trailers (see gRPC)
evm_output, evm_event, evm_receiptoutput; event and field; fieldEVM only: a decoded output, an event field or a receipt field, quantities as decimal strings and addresses checksummed (see EVM toolkit)

Every capture also takes required and persist (both default false).

  • A capture that matches nothing leaves the variable unset and records a warning, such as capture 'id': no match for $.id. With required: true it fails the request with that message instead.
  • A capture of a later request replaces the value of an earlier one with the same name. Captured values outrank request, collection and environment variables, and only --var overrides them.
# orders/create-order.rman.yaml
version: 1
kind: http
name: Create order
method: POST
url: '{{base_url}}/orders'
body:
  type: text
  content: one coffee
assertions:
  - status: [201, 202]
  - body:
      matches: order-[0-9]{6}
captures:
  - var: order_url
    from: header
    name: Location
    required: true
  - var: order_id
    from: body_regex
    pattern: order-([0-9]+)
  - var: created_status
    from: status
  - var: cart
    from: cookie
    name: cart

Token chaining

A login request captures a token, and every later request sends it:

# auth/1-login.rman.yaml
version: 1
kind: http
name: Log in
method: POST
url: '{{base_url}}/token'
assertions:
  - status: 200
captures:
  - var: token
    from: json
    path: $.access_token
    required: true
  - var: user_id
    from: json
    path: $.user.id
    persist: true
# auth/2-me.rman.yaml
version: 1
kind: http
name: Who am I
url: '{{base_url}}/me'
auth:
  type: bearer
  token: '{{token}}'
assertions:
  - status: 200
  - json:
      path: $.id
      equals: '{{user_id}}'

Where captured values live

Captures live only for the current run by default.

  • persist: true also writes the value to the active environment’s runtime state file, .rustman/state/<env>.yaml (.rustman/state/@none.yaml without an active environment). A later, separate rustman run resolves {{user_id}} from it, below request and collection variables but above the environment. The state file is per-user, git-ignored state, written atomically and readable by the current user only. Files under environments/ are never modified. A value that contains a secret seen in the run (a server echoing it back) is not written; the run warns capture 'user_id': not persisted: the value contains a secret and the value is still available to later requests of the same run.
  • A captured variable listed under the active environment’s secrets is a secret: its value is stored in the secret store (the OS keychain, or .rustman/secrets.yaml), never in a state file, whether or not persist is set, and it is redacted from reports, history, logs and errors like any other secret. With the environment below, the login above refreshes the stored token on every run.
  • A captured value that contains a secret seen earlier in the run (a server echoing a token back, say), or any piece of one at least 4 characters long, becomes a secret itself for the rest of the run: every later request that uses it redacts it as «redacted:<var>» in reports, history, logs and errors, and its capture result shows "secret": true. It is not stored anywhere, so an exchange that used it cannot be replayed from history.
# environments/local.yaml
variables:
  base_url: http://localhost:8080
secrets:
  - token

To forget persisted captures, delete .rustman/state/<env>.yaml; to forget a captured secret, run rustman secret rm <name> --env <env>.

Snapshot testing

A snapshot records a known-good response once and fails later runs when the response changes, with a readable diff. Normalization keeps timestamps, ids and other noise out of the comparison, and secrets are redacted before anything is stored. Snapshot files are plain YAML next to the request, so a response change shows up in code review.

The examples on this page are checked by an integration test (crates/rustman-core/tests/docs_snapshots.rs): every request file loads, every snapshot file is read back and written again byte for byte, and each response shown is normalized into exactly the snapshot shown after it.

The snapshot assertion

Add snapshot to a request file’s assertions list. The shorthand compares the status and the body with the default rules:

# users/get-user.rman.yaml
version: 1
kind: http
name: Get user
url: '{{base_url}}/users/42'
assertions:
  - status: 200
  - snapshot

The full form takes any of name, compare, ignore, headers, replace, sort and presets, all optional:

# users/list-users.rman.yaml
version: 1
kind: http
name: List users
url: '{{base_url}}/users'
assertions:
  - snapshot:
      name: listing
      compare: [status, headers, body]
      ignore: ['$.request_id']
      headers:
        include: [content-type, x-api-version]
      replace:
        - pattern: 'ORD-\d+'
          with: 'ORD-«n»'
      sort:
        - path: $.users
          by: id
      presets: [timestamps, uuids, etags]
  • A request file may hold several snapshot assertions; each needs its own name (the default name is default). Two with the same name fail to load with <path>:<line>: duplicate snapshot name 'default'.
  • Names may use letters, digits, - and _, since they become part of a file name.
  • Snapshots work for every request kind that produces a response: http, graphql, jsonrpc and mcp. For jsonrpc, each call’s snapshot holds that call’s response envelope (result or error); in a batch, names are unique across all the calls (see JSON-RPC snapshots).
  • With --iterations above 1, every iteration compares against the same snapshot.

Where snapshots are stored

Each snapshot is a file in a __snapshots__/ folder next to the request file, named <request-file-stem>.<name>.snap.yaml. users/get-user.rman.yaml with a default snapshot is stored in users/__snapshots__/get-user.default.snap.yaml.

Snapshot files belong in Git: rustman init never adds __snapshots__/ to .gitignore.

The snapshot file

# users/__snapshots__/get-user.default.snap.yaml
version: 1
request: users/get-user.rman.yaml
name: default
kind: http
compare:
  - status
  - body
status: 200
body:
  json:
    id: 42
    name: Ada
    roles:
      - admin
    updated: «timestamp»
  • version is 1. request is the request file’s path from the workspace root, always with /. name, kind and compare say which assertion wrote it.
  • status, headers and body are present when compared.
  • The body is one of:
    • json: the JSON body as a YAML structure, every object’s keys sorted;
    • text: any other text, as a literal block;
    • binary: {sha256, size} for bodies that are not valid UTF-8 or whose content type is not textual (images, archives…), and for bodies larger than 1 MiB after normalization (with a warning suggesting ignore rules);
    • events: the event list of a subscription (see Subscriptions).
  • Files use 2-space indentation and end with a newline. Two runs producing the same normalized response produce byte-identical files, whatever the order of the keys in the response.

What is compared

compare lists the parts of the response that are stored and compared: status, headers and body. The default is [status, body].

When headers are compared, only the headers listed in headers.include are stored (default: content-type), with lower-case names, sorted. Repeated headers are joined with , . A header that changes on every response, such as Date, therefore never fails a snapshot unless it is included. Included headers listed in headers.redact are stored as «redacted», which checks that the header is present without storing its value.

# catalog/get-item.rman.yaml
version: 1
kind: http
name: Get item
url: '{{base_url}}/items/7'
assertions:
  - snapshot:
      compare: [status, headers, body]
      headers:
        include: [content-type, x-request-id]
        redact: [x-request-id]
// response: 200
// Content-Type: application/json
// Date: Tue, 17 Nov 2026 10:00:00 GMT
// X-Request-Id: 7d2f9c
{"id": 7, "title": "Lamp"}
# catalog/__snapshots__/get-item.default.snap.yaml
version: 1
request: catalog/get-item.rman.yaml
name: default
kind: http
compare:
  - status
  - headers
  - body
status: 200
headers:
  content-type: application/json
  x-request-id: «redacted»
body:
  json:
    id: 7
    title: Lamp

If content-type later changes from application/json to text/html, the snapshot fails with:

changed headers.content-type: "application/json" → "text/html"

Normalization

Before a response is stored or compared, it is normalized in a fixed order:

  1. secret redaction;
  2. ignore;
  3. presets;
  4. replace;
  5. sort;
  6. the canonical form (object keys sorted).

The same normalized form is used for storing and for comparing, and normalizing a response twice gives identical output.

Secret redaction

Secret values and the sensitive headers (Authorization, Proxy-Authorization, Cookie, Set-Cookie) are replaced with «redacted:<name>» first, with the same redaction every other output uses (see Environments). This includes secrets a server echoes back inside a body, in the encoded forms listed under Redaction. A snapshot file never contains a resolved secret value, even with --update-snapshots; if a replace rule would put one back, the snapshot is not written and the assertion reports an error.

Snapshot files are meant to be committed, so know the limits of that redaction before you commit one:

  • A secret the server transforms before echoing it (base64-encodes it, hashes it, changes its case, splits it) is not recognized and is stored as the server sent it. Add an ignore or replace rule for such a field.
  • Only the secrets the requests of the command reference are known (see Redaction). An environment secret no request of the command uses is not read from the store, so a server that returns it anyway gets it stored in plain text, and the check before writing cannot catch it either.

Review a new snapshot file before committing it, as you would any other file.

# auth/whoami.rman.yaml
version: 1
kind: http
name: Who am I
url: '{{base_url}}/whoami'
headers:
  - name: X-Token
    value: '{{token}}'
assertions:
  - snapshot

With the secret token set to abc123, and a server echoing it:

// response: 200
// Content-Type: application/json
{"user": "ada", "token": "abc123"}
# auth/__snapshots__/whoami.default.snap.yaml
version: 1
request: auth/whoami.rman.yaml
name: default
kind: http
compare:
  - status
  - body
status: 200
body:
  json:
    token: «redacted:token»
    user: ada

Ignored paths

ignore is a list of JSONPath expressions. Every value they match is stored as «ignored», so it can change freely while the field itself must still be there. A path that matches nothing is not an error. For an event list, the paths are applied to each event.

# orders/create-order.rman.yaml
version: 1
kind: http
name: Create order
method: POST
url: '{{base_url}}/orders'
assertions:
  - snapshot:
      ignore: ['$.id', '$.items[*].created_at']
// response: 201
// Content-Type: application/json
{"id": 981, "items": [{"sku": "A1", "created_at": "yesterday"}]}
# orders/__snapshots__/create-order.default.snap.yaml
version: 1
request: orders/create-order.rman.yaml
name: default
kind: http
compare:
  - status
  - body
status: 201
body:
  json:
    id: «ignored»
    items:
      - created_at: «ignored»
        sku: A1

Presets

presets replace common kinds of changing values with a typed placeholder:

PresetMatchesPlaceholder
timestampsRFC 3339 and ISO 8601 date-times such as 2026-11-17T10:00:00Z or 2026-11-17 10:00«timestamp»
datescalendar dates such as 2026-11-17, and HTTP dates such as Tue, 17 Nov 2026 10:00:00 GMT«date»
uuidsUUIDs in any case«uuid»
etagsa whole value that is an entity tag, "33a64df5" or W/"33a64df5"«etag»
epoch_ms13-digit integers (or strings of 13 digits) in fields named *_at, *time* or timestamp«epoch_ms»
jwtJSON Web Tokens (eyJ...)«jwt»

The default is [timestamps, uuids]. presets: [] turns every preset off, and a list replaces the defaults (list timestamps again to keep it). Presets apply to every string of a JSON body, to the whole of a text body, and to stored header values. They run in the order of the table whatever order they are listed in, so a timestamp is never half-replaced as a date.

# sessions/start.rman.yaml
version: 1
kind: http
name: Start session
method: POST
url: '{{base_url}}/sessions'
assertions:
  - snapshot:
      presets: [timestamps, dates, uuids, epoch_ms, jwt]
// response: 200
// Content-Type: application/json
{"id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301", "started": "2026-11-17T10:00:00Z", "day": "2026-11-17", "expires_at": 1763373600000, "token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIn0.c2ln"}
# sessions/__snapshots__/start.default.snap.yaml
version: 1
request: sessions/start.rman.yaml
name: default
kind: http
compare:
  - status
  - body
status: 200
body:
  json:
    day: «date»
    expires_at: «epoch_ms»
    id: «uuid»
    started: «timestamp»
    token: «jwt»

With presets: [], "updated":"2026-11-17T10:00:00Z" is stored verbatim.

Regex replacements

replace is a list of {pattern, with} rules, applied in order after ignore and the presets: to every string value of a JSON body, or to the whole text of any other body. with may use $1 or ${name} for capture groups. An invalid regular expression fails when the file loads, with <path>:<line>: invalid regex '(': <reason>.

# orders/get-order.rman.yaml
version: 1
kind: http
name: Get order
url: '{{base_url}}/orders/latest'
assertions:
  - snapshot:
      replace:
        - pattern: 'ORD-\d+'
          with: 'ORD-«n»'
// response: 200
// Content-Type: text/plain
Order ORD-123 shipped.
# orders/__snapshots__/get-order.default.snap.yaml
version: 1
request: orders/get-order.rman.yaml
name: default
kind: http
compare:
  - status
  - body
status: 200
body:
  text: Order ORD-«n» shipped.

ORD-987 normalizes to the same value, so the snapshot keeps matching.

Array ordering

Array order is significant by default. sort is a list of {path, by} rules: the array at the JSONPath path is sorted by the value at by, a key path relative to each item (id, owner.id), or by the whole item when by is omitted. Numbers sort numerically and strings by their characters.

# users/list-team.rman.yaml
version: 1
kind: http
name: List team
url: '{{base_url}}/team'
assertions:
  - snapshot:
      sort:
        - path: $.users
          by: id
        - path: $.tags
// response: 200
// Content-Type: application/json
{"users": [{"id": 10, "name": "Lin"}, {"id": 2, "name": "Ada"}], "tags": ["ops", "dev"]}
# users/__snapshots__/list-team.default.snap.yaml
version: 1
request: users/list-team.rman.yaml
name: default
kind: http
compare:
  - status
  - body
status: 200
body:
  json:
    tags:
      - dev
      - ops
    users:
      - id: 2
        name: Ada
      - id: 10
        name: Lin

Diffs

When a response no longer matches, the failure shows what changed:

  • JSON bodies: one line per change, with its JSONPath, its kind (added, removed or changed) and the old and new values. At most 50 changes are shown, followed by … and 30 more changes (for 80). Arrays compare by index, after any sort rule.

    changed $.user.role: "admin" → "viewer"
    added $.user.email: "ada@example.com"
    removed $.legacy: true
    
  • Status and headers: the same lines, with status and headers.<name> as the path.

  • Text bodies: a unified line diff with 3 lines of context, from the stored snapshot (---) to the received response (+++).

  • Binary bodies: the old and new size and hash:

    binary body changed: 10240 B sha256:ab12… → 10301 B sha256:9f0c…
    
  • A body that changed form (JSON to text, for example): body type changed: json → text.

Subscriptions and event lists

For exchanges with a bounded event list (GraphQL subscriptions, JSON-RPC subscriptions), the snapshot body is the list of events, each normalized on its own. When a run collects a different number of events than the snapshot holds, the failure starts with event count changed: 3 → 2, followed by the diff of the events.

# live/__snapshots__/on-price.default.snap.yaml
version: 1
request: live/on-price.rman.yaml
name: default
kind: graphql
compare:
  - status
  - body
body:
  events:
    - data:
        price: 10
    - data:
        price: 11

Recording, updating and CI

  • First run: when a snapshot file does not exist, it is written and the assertion is reported recorded (it counts as passed).
  • Later runs compare against the stored file: matched or failed.
  • Update mode (--update-snapshots) overwrites differing snapshots and reports them updated. Matching snapshots are never rewritten, so their bytes and modification times stay the same.
  • CI mode (--ci, or the environment variable CI set to true or 1) never writes snapshot files. A missing snapshot fails with snapshot missing: <path> (run without --ci to record).
  • --ci (or CI=true) together with --update-snapshots is a usage error: rustman run exits with code 2 and error: --update-snapshots cannot be used in CI mode, before anything is sent.
  • rustman send and rustman graphql query take the same --update-snapshots (-u) and --ci flags and honor CI the same way; they note each recorded or updated snapshot on stderr, as in snapshot default recorded: users/__snapshots__/get-user.default.snap.yaml.
  • Agents (rustman mcp serve) always compare in CI mode and never write snapshot files.
rustman run users/                      # records new snapshots, compares the others
rustman run users/ --update-snapshots   # accepts intended changes (-u for short)
rustman run . --ci                      # in a pipeline: never writes, a missing snapshot fails

A failed or missing snapshot fails its request like any other assertion (exit code 1). Recorded and updated snapshots count as passed, so an update run exits 0 when nothing else failed.

Snapshot files are written through a temporary file that is renamed into place, under a per-file lock, so a run and an approval in the TUI never leave half a file. A write only replaces the file it compared against: when another run or an approval changed the snapshot in the meantime, the write is skipped with <path>: the snapshot file changed on disk since it was compared; it was not written (run again). A temporary file (.<name>.snap.yaml.<pid>-<n>.tmp) left by an interrupted write is removed by the next write of that snapshot, and is safe to delete. Snapshot files checked out with Windows line endings still match.

Reviewing in the TUI

Sending a request with a snapshot from the TUI records, compares and stores snapshots the same way as rustman run (in CI mode when CI is true or 1). When a snapshot failed, is missing or was just recorded, the response viewer gets a Snapshot tab after Assertions with each snapshot’s state, its file and the diff (a recorded or missing snapshot shows the received snapshot instead):

snapshot default failed · users/__snapshots__/get-user.default.snap.yaml
changed $.name: "Bob" → "Ana"
added $.role: "admin"

a approve · r reject · Alt+A review all
  • a approves the next open snapshot: the received snapshot is written over the stored file (atomically, under its lock) and the tab shows approved.
  • r rejects it: the file is left unchanged, the assertion stays failed and the tab shows rejected.
  • After sending several requests, Alt+A opens a review queue that steps through every failing snapshot still open in any tab: a approves and r rejects the current one and moves to the next, n/p (or the arrow keys) step without deciding, and Esc closes it. The queue closes by itself after the last decision.
  • In CI mode approving is disabled: the tab says Approval is disabled in CI mode. and a only shows a warning.

Ctrl+Shift+<letter> is not used because most terminals cannot tell it from Ctrl+<letter>. Everything the tab and the queue show is redacted, like the snapshot files themselves.

In reports

Every reporter shows the snapshot outcomes: matched, recorded, updated, failed or missing. The pretty report lists the files a run recorded or updated under their request, the diff under a failed one, and a summary line with the counts:

PASS  users/get-user  GET 200  12 ms
      snapshot default recorded: users/__snapshots__/get-user.default.snap.yaml
FAIL  users/list-users  GET 200  9 ms
      snapshot mismatch: users/__snapshots__/list-users.listing.snap.yaml
      changed $.users[0].role: "admin" → "viewer"

2 requests: 1 passed, 1 failed, 0 errored, 0 skipped (21 ms)
1 snapshot recorded, 1 snapshot failed
  • JSON (rustman.report/v1, additive fields): each snapshot assertion ("kind": "snapshot") has a snapshot object with name, state, path (the snapshot file, relative to the workspace, with /) and, when it failed or was updated, the structured diff (changes with path, kind, old and new; more; and text, binary, event_count or body_type when they apply). summary.snapshots counts the states; both are absent from runs without snapshots. See the report schema.
  • JUnit: a failed snapshot’s <failure> message holds the diff text; recorded and updated snapshots are listed in the test case’s <system-out>, and the counts are the suite property snapshots.
  • TAP: the diff is a reason in the failed test point’s YAML block; recorded and updated snapshots and the counts are # comments.

Every diff is redacted like the rest of the report.

Listing and pruning

rustman snapshot list [path] lists every snapshot file under a folder or request file (default: the whole workspace) with its state, without sending anything:

ok                 users/__snapshots__/get-user.default.snap.yaml  users/get-user.rman.yaml default
unreferenced name  users/__snapshots__/get-user.v1.snap.yaml  users/get-user.rman.yaml v1
orphaned           users/__snapshots__/old.default.snap.yaml  users/old.rman.yaml default
  • ok: the request file declares a snapshot with that name (or is a kind this version cannot read, which is never pruned).
  • orphaned: the request file no longer exists.
  • unreferenced name: the request file no longer declares that snapshot name.

--json prints an array of {path, request, name, state} objects, with the states ok, orphaned and unreferenced_name.

rustman snapshot prune [path] finds the orphaned and unreferenced snapshot files and lists them as obsolete <path> (<state>). Deleting tracked files is opt-in:

  • --yes (-y) deletes them and lists each as deleted <path> (<state>); a __snapshots__/ folder left empty is removed too.
  • On a terminal without --yes, it asks delete 2 snapshot files? [y/N].
  • Without a terminal and without --yes, it only lists them and prints pass --yes to delete them on stderr.
  • --dry-run only lists them, even with --yes.

A file that another writer (a run with -u, or an approval in the TUI) changed after it was listed is kept, not deleted.

Both commands exit 0, or 2 when the workspace or a file cannot be read or deleted.

Data-driven runs

rustman run --data <file> runs the selected requests once per row of a CSV or JSON file, like newman run -d. Each row’s columns are variables during its iteration, so one folder of requests can cover many users, tenants or test cases.

rustman run api/users --env ci --data users.csv
rustman run api/users --env ci --data users.csv --data-label email --reporter junit:out/junit.xml

With users.csv:

email,role
ana@example.com,admin
bo@example.com,user
cy@example.com,user

and a folder of 2 requests using {{email}}, the run sends 6 requests: both requests for row 1, then both for row 2, then both for row 3. Every request in iteration 2 resolves {{email}} to bo@example.com.

Data files

The file’s extension picks the format: .csv or .json (in any case). Both are read by the shared data-row reader (rustman_core::data_rows), which load testing’s --data uses too.

  • CSV follows RFC 4180. The first row is the header and names the columns. A UTF-8 BOM is stripped, fields may be quoted ("Doe, Jane", with "" for a quote), line endings may be \n or \r\n, and every value is a string (007 stays 007). Every row must have as many fields as the header. An empty cell defines its variable as empty text, so it overrides a value from the environment or the collection; leave the column out of the file to fall back to those.
  • JSON must be an array of objects. Scalars become strings (1 becomes 1, true becomes true, null becomes empty text); numbers keep their text exactly as written (1.10 stays 1.10, 1e2 stays 1e2, big integers keep every digit). Nested values become compact JSON text, their numbers kept as written too: {"id": 1, "tags": ["a"]} gives {{id}} = 1 and {{tags}} = ["a"]. A key missing from a row is not defined in that iteration.

Rows are numbered from 1 without the header, as in iteration labels. A bad file is a usage error (exit code 2), reported before any request is sent:

ProblemMessage
No data rows (or an empty file)--data users.csv: no rows
A quoted field that is never closed--data users.csv: invalid CSV: unterminated quoted field in row 1
Text after the closing quote of a quoted field ("a"b)--data users.csv: invalid CSV: text after the closing quote of a quoted field in row 2
A row with the wrong number of fields--data users.csv: row 4 has 3 fields, expected 2
JSON that is not an array of objects--data cases.json: expected an array of objects
A repeated or empty header name--data users.csv: duplicate column 'email'
Another extension--data users.txt: unsupported data file (use .csv or .json)

A collection’s default data file

A _collection.yaml may name the data file its folder runs with, relative to the _collection.yaml and inside the workspace:

# api/tenants/_collection.yaml
data: tenants.csv
secret_columns: [admin_pin]

rustman run api/tenants (or a request inside it) then runs once per row of api/tenants/tenants.csv. The nearest folder at or above each run path that sets data applies; two run paths naming different files is a usage error. --data <file> replaces the default and --no-data runs the folder once without row variables. A data path that leaves the workspace fails with api/tenants/_collection.yaml: data: file path escapes workspace: ../x.csv.

Iterations and variables

The row sits in the variable precedence directly below in-run captures: --var overrides > captures of the iteration > data row > request variables > collection variables > persisted captures > environment > rustman.toml.

  • A row value beats the request’s and the collection’s variables, which act as defaults the data file varies, and the environment, so a row can change {{base_url}} per tenant.
  • A capture made during the iteration beats the row, so a login request can replace a row’s placeholder token.
  • Iterations are independent: captures made without persist: true are cleared at the start of each iteration, so a request using {{order_id}} before it is captured again fails with unresolved variable(s): order_id in every iteration. Persisted captures stay available.

With --data, the number of iterations is the number of rows. --data with --iterations is a usage error: --data and --iterations cannot be combined (iterations = row count). With a collection’s default data file, pass --no-data to use --iterations instead.

Bail

--bail stops the whole run after the first failed or errored request in any iteration: every request not started yet, in this iteration and the next ones, is reported as skipped (bail). --bail=iteration skips only the rest of the failing iteration and goes on with the next row:

iteration 2/3 · row 2
FAIL  rows/1-check  GET 500  2 ms
      status: expected 200, got 500
SKIP  rows/2-after  skipped (bail)

iteration 3/3 · row 3
PASS  rows/1-check  GET 200  1 ms
PASS  rows/2-after  GET 200  2 ms

Iteration labels

Each iteration has a label: the value of the --data-label <column> column, else row <index> (also when the row’s value is empty). The column must exist and must not be secret (a secret label column is a usage error, exit code 2).

  • pretty groups the requests under one iteration <index>/<total> · <label> line per iteration.
  • junit test case names end with [<label>]: get-profile [ana@example.com].
  • tap descriptions end with [<label>].
  • json keeps the integer iteration every request has (1-based; with --data, the row number) and adds a data_row object:
"iteration": 2,
"data_row": { "index": 2, "total": 3, "label": "bo@example.com" }

A JSON report from a run without --data has no data_row, --iterations above 1 included, and is unchanged from v0.1. Under --iterations, pretty, JUnit and TAP still label each iteration by its index ([2] in JUnit and TAP names).

Compatibility: data_row is an optional field added to rustman.report/v1 in v0.2; iteration keeps its v0.1 type and meaning, so v1 consumers keep working.

Secret columns

These columns are secret:

  • columns named in --secret-columns <a,b>;
  • columns listed in secret_columns of a _collection.yaml above any request of the run;
  • columns whose name contains password, token, secret or api_key (ignoring case, with - read as _): password, access_token, API-KEY.

Their values are redacted as «redacted:<column>» in every output, the same way as environment secrets (see redaction): reports, history, logs, error messages and the pretty output. A request body password={{password}} is recorded as password=«redacted:password», and a server echoing the value back is redacted too. Values are known to the redactor before the first request is sent.

Reports

rustman run and rustman explore run describe what they did in one canonical, versioned report: a JSON document under the schema rustman.report/v1. Every other format is rendered from that document, for every audience: machines (JSON), CI test tabs (JUnit XML), code-scanning dashboards (SARIF 2.1.0) and people (Markdown and a self-contained HTML page). No format ever shows a secret.

The canonical report

A report has a top-level schema (rustman.report/v1) and a kind:

KindWritten byContent
runrustman run --reporter json, rustman sendEvery request with its file, redacted exchange, timings, assertion results and captures; see the CLI reference
explorationrustman explore run (always, as .rustman/explorations/<id>/report.json)The seed, safety settings, probe totals by outcome, the coverage matrix, the findings with evidence and reproduction, and the resources left behind; see Exploration. rustman evm probe writes one with subject: evm-rpc: its coverage matrix is methods × providers, and an evm section holds each provider’s support, archive state, latency, subscriptions, rate limit, drift, blocks and trace; see Probing EVM providers
contractrustman contract diff --report jsonWhat a contract command checked, as one list of items, with a mode (diff, pact-verify or conformance); see Contract reports
benchrustman bench --report json=<file>The load profile, the target, latency and error statistics per request file and overall, a per-second time series, the threshold results and error samples; see Bench reports

rustman report schema prints the JSON Schema (draft 2020-12) that every kind validates against. The same file is published at schemas/report.schema.json. Its kind: run part is the contract the first reporters published, kept as is; its kind: exploration, kind: contract, kind: bench and kind: stress parts are generated from the Rust types with schemars, and a test fails if the published file drifts from them.

A reader built before a kind existed refuses it instead of misreading it: rustman report render exits 2 with unknown report kind '<kind>'.

rustman report schema > report.schema.json

Versioning

Additive changes (a new optional field, a new kind) keep rustman.report/v1; reports written by older versions stay valid. A breaking change bumps the major version. rustman report render and report diff read every supported version (rustman.report/v1 and v1.<minor>) and refuse any other major version with exit code 2:

$ rustman report render old.json --format html
error: old.json: unsupported report schema 'rustman.report/v9' (this version reads rustman.report/v1)

Rendering

rustman report render <REPORT> --format <json|junit|markdown|html|sarif> [-o <FILE>] [--fail-on <severity>]

renders any canonical report, of either kind, to stdout or to -o <FILE>. run and explore run render while they finish, with --report <format>[=<path>] (repeatable): every rendering comes from the same report data.

rustman explore run --spec api.yaml --target http://localhost:8080 \
  --report html=out/r.html --report sarif=out/r.sarif --report junit=out/junit.xml
rustman run api --env ci --report markdown=out/run.md --report junit=out/junit.xml
rustman report render .rustman/explorations/exp-20261118-3fa9c1/report.json --format markdown -o out/r.md

A --report without a path writes to stdout; at most one report (or --reporter) may. Files are replaced atomically and their folders are created. When a --report writes to stdout, explore run prints its summary on stderr and run does not print the pretty report, so stdout holds one document.

SARIF locations are relative to the current directory when the OpenAPI document is under it, and rendering reads the document (when it is still there) to point each result at the operation’s line.

Formats

JSON

The canonical report itself, pretty-printed. report render --format json gives back the report it read.

JUnit XML

For a run, one <testcase> per request (classname is the request file) with <failure> for a failed request, <error> for an errored one and <skipped> for a skipped one.

For an exploration, one <testsuite> per tag (the operation’s first tag; untagged without one, undocumented for methods the document does not list) and one <testcase> per operation. Findings at or above --fail-on (default: the exploration’s own --fail-on, high) become a <failure> whose type is the rule id; an operation whose probes were all blocked, skipped or not run is <skipped>; findings below the threshold are listed in <system-out>.

<testsuite name="users" tests="5" skipped="1" errors="0" failures="1">
    <testcase name="POST /users" classname="users" assertions="15">
        <failure message="f002 [high] server-error-on-invalid-input: invalid input got status 500 instead of 4xx" type="server-error-on-invalid-input">f002 [high] server-error-on-invalid-input: invalid input got status 500 instead of 4xx</failure>
        <system-out>f005 [medium] error-leakage: Java stack trace: at com.example.UserService.create(UserService.java:42)</system-out>
    </testcase>
    <testcase name="DELETE /users/{id}" classname="users" assertions="2">
        <skipped message="2 probes blocked: DELETE needs --allow-destructive"/>
    </testcase>
</testsuite>

SARIF 2.1.0

Each rule a finding broke is a reportingDescriptor (its description, its remediation as help, and a security-severity score for GitHub). Each finding is a result:

Finding severitySARIF levelsecurity-severity
criticalerror9.5
higherror8.0
mediumwarning5.5
lownote3.0
infonote0.0

The location is the OpenAPI document and the JSON pointer of the operation (the path item for an undocumented method), with the operation’s line when the document can be read:

{
  "ruleId": "response-schema-violation",
  "level": "warning",
  "message": { "text": "GET /users/{id}: at '': \"email\" is a required property" },
  "locations": [
    {
      "physicalLocation": {
        "artifactLocation": { "uri": "api.yaml" },
        "region": { "startLine": 52 }
      },
      "logicalLocations": [
        { "name": "GET /users/{id}", "fullyQualifiedName": "/paths/~1users~1{id}/get", "kind": "object" }
      ]
    }
  ],
  "partialFingerprints": { "rustmanFinding/v1": "response-schema-violation|GET /users/{id}" }
}

partialFingerprints keeps a finding the same alert across runs. A run report renders as SARIF too: each failed request is an assertion-failed result and each errored one a request-errored result, located in its request file.

Markdown

A summary (target, document, seed, safety settings, probe totals and findings by severity), the findings table sorted by severity, each finding with its description, remediation, redacted evidence and curl reproduction, the coverage summary and matrix, and the resources left behind. A run renders as a summary, the requests table and the reasons of each failure. It suits pull-request comments and job summaries:

| ID | Severity | Rule | Operation | Occurrences | Message |
|---|---|---|---|---:|---|
| f001 | critical | `auth-not-enforced` | `GET /admin/users` | 2 | a request without valid credentials got status 200 |
| f002 | high | `server-error-on-invalid-input` | `POST /users` | 1 | invalid input got status 500 instead of 4xx |

What comes from the target or the document is escaped: messages (which can quote a response) have every Markdown and HTML character backslash-escaped, so a response cannot inject markup or raw HTML into a viewer, and URLs and operations sit in code spans that their content cannot close. Evidence bodies sit in fences longer than any run of ~ in them.

HTML

One self-contained file: its stylesheet and script are inlined, and it references nothing on the network (no http:// or https:// script, style, font or image). Findings are expandable <details> with the evidence and reproduction, which works with JavaScript disabled; the severity and operation filters are the only part that needs it, and they stay hidden without it. The page follows the system’s light or dark theme.

Contract reports

A kind: contract report has a mode: diff for rustman contract diff, pact-verify for rustman contract pact verify and conformance for rustman contract verify. It has its sources (for a diff, old and new, where a --base document is named <ref>:<path>; for a Pact verification, each pact file; for conformance, the spec and the exchanges source), the rule catalog_version (diffs only), a summary (the count per status in the mode’s order, how many items an allowlist accepted, how many fail the command, and passed), the items and the warnings (expired and unused allowlist entries, failed provider-state teardowns). Each item has the rule id and its description, a status, the allowlist allowed justification when one accepted it, failing, the subject, a message, and locations: the primary one first, each with a JSON pointer.

ModeStatuses, in orderOne item perSubjectPrimary location
diffbreaking, non-breaking, unknowndifference (rule id from the catalog)the operationthe new document, at the changed element
pact-verifypassed, failed, blockedinteraction (rule pact-interaction)the interaction’s description and consumerthe Pact file, at /interactions/<n>
conformanceviolation, undocumented, conformsexchange (rules conformance-violation, undocumented-exchange, conforms)the matched operation, or the exchange’s method and paththe document, at the operation

A conformance report also has a coverage: how many documented operations the exchanges observed out of the total, and every operation with its number of exchanges and of exchanges with violations.

  • Markdown and HTML: the sources and catalog version, a summary line with the counts per status (2 breaking, 1 non-breaking, 0 unknown, 1 allowed), then one table per status in that order, breaking first and failing items first within a table, each row with the rule id, operation, message and pointer; then the allowlist justifications, the coverage of a conformance check (1/2 operations observed after the summary, and a table of operations) and the warnings.
  • JUnit XML: one <testsuite> named after the mode (contract diff, contract pact-verify, contract conformance) and one <testcase> per item; an item that fails the command is a <failure> whose type is the rule id.
  • SARIF: one reportingDescriptor per rule id and one result per item, located in the primary document (artifactLocation) at the JSON pointer of the changed element (logicalLocations[].fullyQualifiedName). An item that fails the command is at level error, an unaccepted unknown one at warning, the others at note; an allowlisted item carries its justification as an external suppression.

report diff does not compare contract reports (exit 2).

Bench reports

A kind: bench report (rustman bench) has the target, the environment, the profile (the executor and its flags), aborted when the run stopped early (threshold or interrupted; absent otherwise), the totals (the latency kind service or corrected, duration, iterations completed and interrupted, scheduled and dropped iterations, requests per second and the generator’s p99 lag), the overall statistics and those of each request file in files (requests, errors by class, error_rate, latency min/avg/p50/p90/p95/p99/max in milliseconds, assertion checks passed and failed, average phases, bytes_sent and bytes_received), the per-second series (requests, errors, rps, p50/p95/p99 and active VUs), the thresholds (each expression, passed, the actual value and whether it is an abort one), up to 20 error_samples per error class (class, file, redacted message and time since the start) and the warnings.

  • Markdown and HTML: the target, executor and duration, a summary line (passed or failed, iterations, requests and rate), the thresholds as ✓ p95<300ms (212ms) or ✗ p95<300ms (412ms), a latency table per file plus an overall row, the error samples and the warnings. The HTML page adds two inline SVG charts, latency over time (p50, p95, p99) and requests per second; it needs no script and works offline.
  • JUnit XML: one <testsuite> named bench with one <testcase> per threshold, a breached one being a <failure> of type threshold, plus an <error> test case when the run was aborted.
  • SARIF: one error result per breached threshold (rule bench-threshold), without a location.

report diff does not compare bench reports (exit 2).

Stress reports

A kind: stress report (rustman stress) has its id, the target, the environment, the mode, the profile (the mode’s settings, fuzz_ratio, malformed and wire families and the health request), the seed, the slos, the overall and per-file statistics of valid traffic, the fuzzed statistics apart, the per-second series, the steps (offered and achieved rate, p50/p95/p99, error rate and classes, verdict and failure mode), breakpoint (max_sustainable_rps, breaking_rps, failure_mode, first_failing_endpoint, why the search stopped and max_rps), rate_limited_at, killed, recovery (status, the time to recover, the baseline, the last answer and the timeline of health requests), the spike, soak and wire results, and the findings in the exploration format, each with its family and, for a crash-like finding, its minimized input (redacted) or load_dependent. A finding’s evidence is the exchange as it happened: request_body is the body sent (not the minimized one), status and body the response’s status and the start of its body; without a response, status is 0 and body says what happened instead.

  • Markdown and HTML: the run, the breakpoint, the recovery, the step table, latency per file and the findings with their minimized inputs. The HTML page adds inline SVG charts of latency and errors against offered load, with the breakpoint marked, and the recovery timeline; it works offline.
  • JUnit XML: one <testsuite> named stress with one <testcase> per finding, a <failure> (of the rule’s type) at or above high.
  • SARIF: one result per finding, located in its request file.

report diff compares two stress reports like explorations: findings match by rule and operation (the request file), so a no-recovery only in the later report is new and exits 1. A reader from before kind: stress refuses such a report with unknown report kind 'stress' (exit 2) without crashing.

Comparing reports

rustman report diff <OLD> <NEW> [--fail-on <severity>] [--format markdown|json]

compares two reports of the same kind:

  • Findings match by rule id and operation, and are listed as new (only in the new report), fixed (only in the old one) or unchanged.
  • For explorations, the coverage of operations and of documented statuses, old and new, with the change in percentage points.
  • For runs, every assertion whose outcome changed (pass, fail, error, or absent when only one run has it), per request.

It exits 1 when a new finding is at or above --fail-on (default high), and 0 otherwise; two reports of different kinds, or an unknown schema version, exit 2.

$ rustman report diff main.json branch.json
# Report diff (exploration)

1 new, 1 fixed, 2 unchanged findings.

## New

| Severity | Rule | Operation | ID |
|---|---|---|---|
| critical | `broken-object-level-authorization` | `GET /orders/{id}` | f009 |
...

Redaction

No format contains the value of a secret, of a header named Authorization, Proxy-Authorization, Cookie, Set-Cookie or X-Api-Key, or of an auth scheme’s credential: they appear as «redacted:<name>», as in Authorization: Bearer «redacted:bearerAuth_token». Redaction happens when the report is built, from exchanges the engine already redacted, so re-rendering a report can never recover a value. Curl reproductions keep secrets as {{name}} references.

CI recipes

GitHub code scanning

Upload the SARIF rendering so findings show up as code-scanning alerts on the OpenAPI document:

jobs:
  explore:
    runs-on: ubuntu-latest
    permissions:
      security-events: write
    steps:
      - uses: actions/checkout@v4
      - name: Explore the staging API
        run: |
          rustman explore run --spec api.yaml --target "$STAGING_URL" --env staging \
            --report sarif=out/explore.sarif --report junit=out/explore.xml --report markdown=out/explore.md
        continue-on-error: true
      - name: Upload SARIF
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: out/explore.sarif
          category: rustman-explore
      - name: Job summary
        run: cat out/explore.md >> "$GITHUB_STEP_SUMMARY"

Run the exploration from the repository root so the SARIF location is the document’s path in the repository.

Test results

Any CI that reads JUnit XML (GitHub test reporters, GitLab artifacts:reports:junit, Jenkins, Azure Pipelines) shows one test case per request of a run, or per operation of an exploration:

test:
  script:
    - rustman run api --env ci --reporter pretty --report junit=out/junit.xml
  artifacts:
    when: always
    reports:
      junit: out/junit.xml

Failing only on regressions

Keep the report of the main branch and fail a pull request only on the findings it introduces:

rustman explore run --spec api.yaml --target "$PREVIEW_URL" --report json=out/branch.json || true
rustman report diff baseline/main.json out/branch.json --fail-on high --format markdown

For developers

rustman-report holds the canonical Report (run or exploration), the only input of every renderer:

  • exploration and run are the report data types; rustman-explore builds an ExplorationReport, and RunReport::new converts a run’s records.
  • Report::parse reads any supported version; report_schema composes the published JSON Schema.
  • render::render renders one RenderFormat, and ReportTarget is one --report value. JUnit uses quick-junit, SARIF is a small typed serde model, and Markdown and HTML are minijinja templates with the stylesheet and script built in via include_str!.
  • diff::diff compares two reports.

Regenerate the published schema after changing the exploration types with RUSTMAN_UPDATE_SCHEMA=1 cargo test -p rustman-report --test render, and review format snapshots with cargo insta review.

OpenAPI exploration

Given an OpenAPI 3.0 or 3.1 document and a target, Rustman investigates the backend on its own: it discovers which operations produce the values other operations need, plans probes for conformance, robustness and security, sends them under the safety policy, and reports what it finds.

An exploration runs four phases in order: discover (the resource graph), plan (the probes), execute (sending them) and report. rustman explore plan stops after planning and sends nothing; rustman explore run goes all the way. This page covers both, dependency discovery, the probe families, the finding rules and their severities, reproducing findings, interrupting and resuming, and the [explore] table. The report formats (JSON, JUnit, SARIF, Markdown, HTML), rustman report render and report diff are described in Reports.

Planning: rustman explore plan

rustman explore plan discovers the resource graph and plans every probe, and sends nothing to the target. It prints each planned probe with its family, operation, method, expected outcome, and whether it is allowed, blocked by the safety policy (and why) or skipped (and why):

$ rustman explore plan --spec api.yaml --target https://staging.example.com --seed 1234 \
    --probes conformance,auth,lifecycle --operations '*User*'
plan: 6 probes (2 allowed, 4 blocked, 0 skipped), seed 1234

ID     FAMILY       OPERATION           METHOD  EXPECTED                                   STATUS
p0001  conformance  GET /users          GET     documented status and schema               allowed
p0002  conformance  POST /users         POST    documented status and schema               blocked: mutations not allowed
p0003  conformance  GET /users/{id}     GET     documented status and schema               allowed
p0004  conformance  PUT /users/{id}     PUT     documented status and schema               blocked: mutations not allowed
p0005  conformance  DELETE /users/{id}  DELETE  documented status and schema               blocked: destructive not allowed
p0006  lifecycle    GET /users/{id}     GET     update reflected, 404 or 410 after delete  blocked: mutations not allowed
FlagMeaning
--spec <file|url>The OpenAPI document (read like rustman import openapi reads it; --allow-remote-refs too)
--target <url>The base URL probes are sent to; its origin is the only one allowed
--probes <list>Comma-separated families (default: all but bola)
--operations <glob>Only operations whose operationId, path or METHOD /path matches (* and ?; repeatable)
--seed <u64>The seed of the fuzz cases; random when left out, and always printed
--fuzz-cases <n>At most this many fuzz cases per operation (default 50)
--allow-mutations, --allow-destructive, --allow-host, --productionThe safety flags
--identity-b <env>The environment of a second identity, for bola probes
--env, --workspaceThe active environment and the workspace (a workspace is optional for plan)
--graphAlso print the resource graph
--jsonPrint the plan as JSON: seed, probes (each with its steps) and scans, plus graph with --graph

The plan is a pure function of the document, the graph, the seed and the settings: the same seed gives the identical plan. Probes refused by the safety policy are listed as blocked: <reason>, never dropped. A plan against a production target is refused with exit code 4 unless --production repeats its host, as for any governed sender.

Probe requests are templates: a path parameter whose value is in the active environment is sent as {{name}}, and values captured from earlier steps the same way. Plans never contain variable values, so secrets can’t leak into them.

Running: rustman explore run

rustman explore run takes every flag of explore plan (but --graph and --json), plus the budgets and the failure threshold:

FlagMeaning
--rate <n>Requests per second at the start (default: [safety].rate, 10); halved on 429
--concurrency <n>Probes in flight at once (default: [safety].concurrency, 4)
--max-probes <n>Probe budget: at most this many requests (default 2000)
--max-duration <duration>Time budget: 90s, 15m, or milliseconds (default 15m)
--fail-on <severity>Exit 1 when a finding is at or above it: critical, high (default), medium, low or info
--vizShow the exploration live in the viz companion: probes, findings and coverage as they come. Without one it continues without visuals, with the same exit code. Also on explore resume.
$ rustman explore run --spec api.yaml --target https://staging.example.com --env staging --allow-mutations
discover: 9 operations, 7 producer edges, 1 unresolved parameters
plan: 112 probes (104 allowed, 6 blocked, 2 skipped), seed 8327461120938471
exploration exp-20261118-3fa9c1 started (41 ms to discover and plan)
execute: 37/112 probes, 4 findings, 1.0s
execute: 112/112 probes, 9 findings, 3.2s
exploration exp-20261118-3fa9c1 completed (seed 8327461120938471)
probes: 112 (71 passed, 31 finding, 6 blocked, 2 skipped, 0 not run, 2 failed)
findings: 1 critical, 2 high, 4 medium, 1 low, 1 info
  f001  critical  auth-not-enforced  GET /admin/users  (1x)
  f002  high      server-error-on-invalid-input  POST /users  (12x)
  ...
coverage: operations 8/9 (88.9%), statuses 11/17 (64.7%)
left behind: 3 resources
  https://staging.example.com/users/41
  https://staging.example.com/users/42
  https://staging.example.com/users/43
report: .rustman/explorations/exp-20261118-3fa9c1/report.json

Phases and progress go to stderr (at most one progress line a second); the summary goes to stdout, or to stderr when a --report writes to stdout. --report <format>[=<path>] (repeatable) also renders the finished report as json, junit, markdown, html or sarif, as in --report html=out/r.html --report sarif=out/r.sarif; see Reports.

Probes run under the safety policy: read-only by default, --allow-mutations for POST, PUT and PATCH, --allow-destructive for DELETE, the target’s origin only (plus --allow-host and [safety].allowed_hosts), and the production guard: against a production target the run is refused with exit code 4 unless --production <host> repeats the target host, and --allow-destructive is never allowed there. Probes the policy refuses are reported as blocked: <reason>, and probes left when a budget runs out as not run: budget.

The exploration directory

Each exploration gets an id, exp-<YYYYMMDD>-<6 hex digits>, and a directory in the workspace (or, outside one, in the current directory):

.rustman/explorations/exp-20261118-3fa9c1/
  state.json      the phase, progress, settings, document hash and resource graph
  plan.json       the planned probes
  journal.ndjson  one line per finished probe and per cleanup, synced as written
  report.json     the report, once every probe has run

.rustman/ is ignored by Git (rustman init adds it to .gitignore). Every value in these files is redacted as it is written.

Cleanup and resources left behind

A step that creates a resource (a POST answering 2xx) is identified by the id in its response: the field the resource graph gives for the path parameter of <path>/{param} (/users/{id} for POST /users). Each one is recorded in the journal with its URL. A lifecycle chain’s own DELETE removes it from the list.

When the probes are done, or after an interrupt, the resources still there are deleted newest first with their documented DELETE operation, if --allow-destructive was given. These deletes go through the safety policy and the rate limit like probes, but the probe and time budgets neither count nor stop them, so the cleanup still runs when a budget ran out. Otherwise (and when a delete fails) they are listed in the report under left_behind and in the summary as left behind.

Status

rustman explore status [<id>] shows an exploration, the most recent one by default, while it runs or after it ended:

$ rustman explore status exp-20261118-3fa9c1
exploration exp-20261118-3fa9c1 (running)
phase: execute
probes: 37/112 done
findings: 1 critical, 1 high, 2 medium, 0 low, 0 info
elapsed: 1.4s
target: https://staging.example.com
started: 2026-11-18T10:02:11.482Z

The state is running, interrupted or completed. --json prints the same fields as JSON (id, state, phase, done, total, findings, elapsed_ms, target, started_at, updated_at and, once written, report).

Interrupting and resuming

On Ctrl+C, explore run stops dispatching probes, waits up to 10 seconds for the probes in flight, runs the cleanup (as above), saves its state and exits with code 130. A second Ctrl+C quits at once. A probe still in flight after the 10 seconds is reported as not run: interrupted and runs again on resume; the resources it had already created are journaled, so the cleanup deletes them (or lists them as left behind).

rustman explore resume <id> continues it: it re-reads the document and refuses (exit code 2) if its SHA-256 changed since the exploration started, then runs only the probes the journal does not hold, with the same plan, seed, safety flags and budgets (minus what earlier runs used), and writes the report over all of them. A lifecycle chain is one probe, so a chain cut short runs again from its start. The environment is the one the exploration started with.

Findings and the report

Findings on the same rule and operation are reported once, with the number of occurrences, the probes they came from, and the first occurrence’s message and redacted evidence (the request, the response status and headers, and the first 4 KiB of the body). They are numbered f001, f002, … from the most severe.

report.json is a rustman.report/v1 document with "kind": "exploration". Besides id, started_at, finished_at, environment, target, spec, document_sha256 and the seed, it holds:

FieldContent
settingsThe probe selection, the safety flags and the budgets
summary.probesProbe totals by outcome: passed, finding, blocked, skipped, not_run, failed (a request error or a chain that stopped early), and total
summary.findingsDistinct findings by severity
coverageoperations exercised and documented statuses observed (covered, total, percent), and the matrix: each operation’s documented statuses marked observed, not-observed or blocked (nothing was sent for the operation because its probes were blocked); an evm probe cell also has a class (supported, unsupported, restricted, error or skipped (budget))
findingsThe findings, as above, each with its remediation and reproduction
probesEvery probe with its outcome and, unless it passed, the reason (blocked: ..., skipped: no producer, not run: budget, not run: interrupted, or why it failed)
left_behindCreated resources that were not deleted
cleanupEach delete of a created resource and the status it got
operationsThe documented operations in document order, with their operation_id and tags (JUnit groups by the first tag)
dependenciesThe data dependencies discovery found: each producer operation whose response provides a parameter of a consumer operation, and the JSON pointer it is read from (the API graph draws them). Absent when there are none.

Reproducing findings

Every finding carries a reproduction: its evidence request as a curl command, with secrets left as {{name}} references, and a request file that sends it to {{baseUrl}} and asserts what a correct API answers. rustman explore export <id> --findings <ids|all> --into <dir> writes those request files, one per finding (f001-auth-not-enforced-get-admin-users.rman.yaml):

version: 1
kind: http
name: 'auth-not-enforced: GET /admin/users'
method: GET
url: '{{baseUrl}}/admin/users'
auth:
  type: none
assertions:
  - status:
      - 401
      - 403

Run them as a regression suite with the environment of an imported collection, or --var baseUrl=<url>: rustman run regressions/ --env staging. They fail while the bug is there and pass once it is fixed. The assertion per rule:

RuleAssertion
auth-not-enforced, unexpected-auth-statusstatus: [401, 403]
broken-object-level-authorizationstatus: [401, 403, 404]
server-error-on-invalid-input, invalid-input-acceptedstatus: 4xx
undocumented-method-allowedstatus: [404, 405]
resource-survives-deletestatus: [404, 410]
server-error, undocumented-statusthe documented status codes
response-schema-violationthe status, and the body against the documented schema
update-not-reflectedeach updated field equals its new value
error-leakagethe body no longer contains the leaked excerpt
missing-hstsStrict-Transport-Security is present
missing-content-type-optionsX-Content-Type-Options equals nosniff
permissive-corsAccess-Control-Allow-Credentials is absent

A finding from a chain (lifecycle, BOLA) exports its last request with the ids it captured, so it only reproduces while those resources exist.

Exit codes

explore run and explore resume exit with:

CodeMeaning
0No finding at or above --fail-on
1At least one finding at or above --fail-on (default high)
2Invalid input or configuration: a bad flag, an unreadable or invalid document, an unknown exploration, a changed document on resume
4Refused by the safety policy (the production guard) before anything was sent
130Interrupted by Ctrl+C

Dependency discovery

Many operations need a real id: GET /users/{id} is only meaningful with the id of a user that exists. Discovery finds, for each path parameter, the operations that produce its value, best first:

  1. Overrides from [explore.producers] in rustman.toml.
  2. OpenAPI links: a success response’s links naming the operation (by operationId or operationRef) with a $response.body#/<pointer> value for the parameter.
  3. The heuristic: an operation under a prefix of the consumer’s path whose success response has a field named like the parameter, or id when the parameter is id or <resource>Id (orderId for /orders). POSTs come first, then the longest prefix. A list response (an array of objects) produces its first item’s field.

--graph prints one line per edge, consumer: parameter <- producer pointer (source), then the parameters nothing produces:

GET /users/{id}: id <- POST /users /id (heuristic)
GET /users/{id}: id <- GET /users /0/id (heuristic)
GET /orders/{orderId}: orderId <- POST /orders /id (heuristic)
GET /reports/{reportId}: reportId <- no producer

A probe that needs a real value runs its producer first, as a setup step, and passes the captured value on. The first producer the safety policy allows is used, so a read-only plan reads ids from a list operation when there is one. Probes that need a parameter with no producer and no value in the active environment are planned as skipped: no producer.

When the heuristic gets it wrong, pin the producer per parameter name, as an operationId or METHOD /path, optionally with a JSON pointer into its response body after #:

[explore.producers]
orderId = "createOrder#/id"
slug = "POST /teams#/handle"

Probe families

FamilyWhat it sendsExpected
conformanceOne valid request per operationA documented status, and a body that matches its schema
authFor operations that require credentials: no credentials, then a well-formed invalid one401 or 403
negative-inputRequests that omit required fields or parameters, use wrong types, or break bounds, length, pattern, enum or item counts (each variant is checked to be invalid against its schema; at most 20 per operation)4xx
method-not-allowedOne undocumented method per documented path (from GET/HEAD/OPTIONS when read-only)405 or 404
lifecyclecreate, read, update, read, delete, read along the graph, passing the created id; steps the policy refuses after the create are left outThe update is reflected; 404 or 410 after the delete
bolaOff by default. Identity A reads a resource, then identity B (--identity-b) reads it by id; skipped without a second identityB is refused
fuzzSeeded cases per operation with a JSON body or query parameters, alternating schema-shaped values and values on the bounds (minimum/maximum, shortest/longest)No 5xx; a documented status and schema
undocumented-statusNothing of its own: checks every responseA documented status
error-leakageNothing of its own: scans every response body (first 64 KiB)No stack traces, SQL errors, debug pages or internal paths
security-headersNothing of its own: checks every responseX-Content-Type-Options: nosniff; HSTS over HTTPS; no * CORS with credentials

Fuzz values come from proptest strategies built from each schema (types, formats, bounds, pattern, enum, required properties) and a ChaCha generator seeded from --seed and the operation, so a seed reproduces every case.

Finding rules

Every finding has a stable rule id and a default severity:

RuleSeverityRaised when
auth-not-enforcedcriticalA request without valid credentials got 2xx
broken-object-level-authorizationcriticalIdentity B read identity A’s resource
server-error-on-invalid-inputhighInvalid input got 5xx
server-errorhighA valid request got an undocumented 5xx
response-schema-violationmediumA body breaks the schema of its status and media type (the first violation, with its instance and schema pointers)
invalid-input-acceptedmediumInvalid input got 2xx
undocumented-method-allowedmediumAn undocumented method got 2xx
error-leakagemediumA body reveals internals (with the matched excerpt)
update-not-reflectedmediumA read after an update shows other values
resource-survives-deletemediumA read after a delete did not get 404 or 410
unexpected-auth-statuslowA request without valid credentials was refused with neither 401 nor 403
missing-hstslowAn HTTPS response has no Strict-Transport-Security
missing-content-type-optionslowA response has no X-Content-Type-Options: nosniff
permissive-corslowAccess-Control-Allow-Origin: * with Access-Control-Allow-Credentials: true
undocumented-statusinfoA status is not documented for its operation

Findings carry the redacted evidence exchange: the request (URL, headers, body), the response status and headers, and the first 4 KiB of the body. Secret values and sensitive headers are replaced as everywhere else (see Environments). Every secret of both identities (--env and --identity-b) is redacted from all evidence, including responses to requests that did not send it, such as a no-credentials auth probe. A credential kept in a plain environment variable instead of a secret (a bearerAuth_token under variables:) is redacted the same way, the request headers of the evidence include those the auth adds (Authorization: Bearer «redacted:bearerAuth_token»), and the curl reproduction keeps every credential as its {{name}} reference, whatever its source. X-Api-Key and the header of an apiKey scheme are treated like Authorization. A finding is filed under the operation of the step whose response it is about: what a setup step (such as the GET /users that finds an id for GET /users/{id}) answered counts for that step’s operation.

Rules can be turned off per workspace:

[explore]
disabled_rules = ["missing-content-type-options"]

For developers

Exploration lives in rustman-explore (rustman_explore::explore), a library the CLI only wires up, and that other automated senders (the mock server, stress tests) build on:

  • graph::Graph::build(&model, &producers) discovers the graph.
  • plan::plan(&model, &graph, &PlanOptions) returns the Plan, a Vec<Probe> of steps.
  • exec::Executor runs one probe at a time through a rustman_http::GovernedSender, the only sender it can hold, and returns its Outcome: what was sent, the findings (with their reproduction) and the resources created or deleted.
  • runner::execute runs the probes a journal does not hold, concurrency at a time, journals each outcome (journal::Journal), stops on a CancellationToken after draining, and cleans up.
  • session::Session is the exploration directory and state.json; drive::drive runs the execute and report phases on it, and report::build turns a plan and a journal into the ExplorationReport.
  • detect holds the detectors, rules::RULES the registry, repro the reproductions and export the regression files.

The bad-api server in rustman-test-support (rustman_test_support::bad_api) is a deliberately broken API with its document, used by the exploration tests; BadApi::start_fixed() serves it with every bug fixed.

Safety policy

Rustman can send requests on its own: OpenAPI exploration sends probes, and later the agent interface, load tests, monitors and plugins send requests nobody typed. Every such request goes through one safety policy first. It decides, for each request and for every redirect hop, whether the request may leave the machine. The policy is safe by default: read-only, the target’s origin only, and never destructive against production.

Requests you send yourself with rustman send and rustman run are not governed by this policy.

The policy, the rate limit and the budgets are defined in rustman-core (rustman_core::safety); the sender that enforces them over HTTP is rustman_http::GovernedSender (see For developers). The [safety] example below is checked by a test (crates/rustman-core/tests/docs_safety.rs). The command-line flags named on this page belong to the commands that use the policy: rustman explore plan, explore run and explore resume.

Methods

MethodAllowed with
GET, HEAD, OPTIONSalways
POST, PUT, PATCH--allow-mutations
DELETE--allow-destructive (which implies --allow-mutations)
any other method--allow-destructive

Methods are case-sensitive, as in HTTP. A method Rustman can’t classify, such as TRACE, PURGE or a lowercase get, is treated as destructive, because what it does can’t be assumed.

A request that isn’t sent is recorded, never silently dropped, with one of these reasons:

ReasonMeaning
blocked: mutations not allowedPOST, PUT or PATCH without --allow-mutations
blocked: destructive not allowedDELETE (or an unclassified method) without --allow-destructive
blocked: host not allowedthe URL’s origin isn’t allowed, or it isn’t an http/https URL
blocked: production host not confirmedan allowed origin whose host is listed in production_hosts, but --production didn’t name it

Origins

An origin is a scheme, host and port: https://api.example.com is https://api.example.com:443, and differs from http://api.example.com and from https://api.example.com:8443. Hosts compare ignoring case and a trailing dot: https://api.example.com./ has the same origin as https://api.example.com/, so the fully qualified spelling of a host gets past neither the allowlist nor the production guard.

The target’s origin is always allowed. Every other origin is refused with blocked: host not allowed, including redirect targets and URLs built from response data, unless it is listed in [safety].allowed_hosts or given with --allow-host <origin>. Redirects are followed by hand so that each hop is checked before it is requested.

Allowed origins are written as scheme://host[:port]. A bare host, a path, a query or credentials are rejected so an entry can’t look narrower than it is:

rustman.toml:6: invalid origin 'auth.example.com': expected scheme://host[:port], such as https://api.example.com

Production guard

A target is production when any of these holds:

  • its environment file sets production: true (see Environments);
  • its environment is named prod or production (ignoring case);
  • its host matches an entry of [safety].production_hosts.

Against production, the command is refused (exit code 4) and nothing is sent, unless --production <host> repeats the exact target host:

error: refusing to send requests to production host 'api.example.com' (environment 'production' is a production name); repeat the host with --production api.example.com to allow non-destructive requests

With --production api.example.com, read-only requests (and mutations, with --allow-mutations) are sent. --allow-destructive is always refused against production, with no override:

error: refusing --allow-destructive against production host 'api.example.com' (environment 'production' is a production name): destructive requests are never sent to production

--production naming any other host is refused too (--production 'example.com' does not match the target host 'api.example.com'). Repeating the host, rather than passing a yes/no flag, is deliberate: the confirmation doesn’t carry over to another target when a command is copied from shell history or a script. An IPv6 host may be given with or without brackets.

An allowed origin whose host matches production_hosts is refused per request (blocked: production host not confirmed) unless it is the confirmed target host, so an allowlist entry can’t open a path to production.

Rate, concurrency and budgets

Governed requests are paced and capped:

LimitDefaultFlagMeaning
Rate10 requests/second--rateRequests are spaced evenly (100 ms apart at 10/s), with no bursts. Every redirect hop counts as a request.
Concurrency4--concurrencyProbes in flight at once. A probe holds one slot across its redirect hops.
Probe budget2000 probes--max-probesA probe is one request and the redirects it follows.
Time budget15 minutes--max-durationCounted from the start of execution (after discovery and planning). A request’s timeout is cut to the time left.

rate and concurrency can also be set in [safety]. When a budget is reached, nothing more is sent, and every probe left is recorded as not run: budget. A blocked probe isn’t sent, so it doesn’t count against the probe budget.

Backing off on 429

A 429 Too Many Requests response halves the rate, down to at least 1 request per second, for the rest of the session, and nothing is sent until its Retry-After has passed. Retry-After may be a number of seconds or an HTTP date. With the default rate, 429 with Retry-After: 5 means no request for 5 seconds, then 5 requests per second. Several 429s for requests sent at the same rate (for example, the 4 requests in flight at once) halve it only once. A Retry-After that ends after the time budget (however large the value) stops execution at once, and the probes left are recorded as not run: budget.

For developers

Front-ends and features that send requests on their own hold only a GovernedSender and never an HttpEngine, so there is no path around the policy:

#![allow(unused)]
fn main() {
let policy = SafetyPolicy::new(&settings.safety, options)?; // refusals exit with code 4
let governor = Governor::new(Limits::from_settings(&settings.safety));
let sender = GovernedSender::new(policy, governor);
match sender.send(&request, &send_options).await {
    Ok(exchange) => { /* record the exchange */ }
    Err(GovernedError::Blocked { reason, url }) => { /* "blocked: host not allowed" */ }
    Err(GovernedError::NotRun(_)) => { /* "not run: budget": stop dispatching */ }
    Err(GovernedError::Request(error)) => { /* network error, timeout, ... */ }
}
}

GovernedSender::send checks the request against the policy, admits it against the budgets and the concurrency limit, waits for the rate limit, and sends it. Each redirect hop is checked and paced again before it is sent; a blocked hop ends the probe with GovernedError::Blocked and is never requested. Errors are redacted like the engine’s. Create the Governor when execution starts, after discovery and planning: the time budget counts from its creation. Requests with auth: {type: oauth2} aren’t supported yet: the sender acquires no token, so they fail with oauth2: no access token was acquired before anything is sent or counted. Waiting for a concurrency slot is unbounded, so an executor should bound the probes it dispatches at once rather than spawn a task per probe for a whole plan.

The rate limit and budgets (Governor) live in rustman-core and do no I/O, so other governed senders (load tests, monitors, agents) can reuse them for non-HTTP transports.

rustman bench uses this policy with the allowlist pinned to its --target origin ([safety].allowed_hosts is ignored), and a Governor built from the [bench] caps instead of [safety] rate and concurrency.

[safety] in rustman.toml

Every key is optional:

# rustman.toml
[workspace]
name = "shop"
version = 1

[safety]
allowed_hosts = ["https://auth.example.com", "http://127.0.0.1:9000"]
production_hosts = ["api.example.com", "*.prod.example.com"]
rate = 10           # requests per second
concurrency = 4     # probes in flight at once
KeyDefaultMeaning
allowed_hosts[]Origins allowed in addition to the target’s own; --allow-host adds more.
production_hosts[]Hosts always treated as production. api.example.com matches that host exactly; *.example.com matches every subdomain of example.com, but not example.com itself. Ports and schemes aren’t part of an entry. Entries and hosts compare the way URLs normalize them: ignoring case and a trailing dot (api.example.com. is api.example.com), with internationalized names as punycode (bücher.example is xn--bcher-kva.example). An IP address is an exact entry; an IPv6 address may be written with or without brackets. Matching is by name only, without DNS: api.example.com doesn’t match the same server reached by its IP address or through a CNAME alias, so list those too, or mark the environment production: true.
rate10Requests per second for governed senders; at least 1. --rate overrides it.
concurrency4Probes in flight at once (a probe and its redirect hops hold one slot); at least 1. --concurrency overrides it.

Unlike other tables, an unknown key in [safety] is an error rather than a warning, so a misspelling such as production_host can’t silently turn the production guard off. Invalid values fail with their line, for example rustman.toml:8: invalid value: integer `0`, expected a nonzero u32 for rate = 0 in the example above.

Contract testing

rustman contract checks that an API keeps its promises to its clients, in three ways:

  • rustman contract diff compares two versions of an OpenAPI document, decides which differences fail the build, accepts known ones in an allowlist and reads the old version from Git. The rules it classifies with are listed in the contract rule catalog.
  • rustman contract pact generate and rustman contract pact verify write Pact contracts from a collection (the consumer side) and replay them against a provider (the provider side).
  • rustman contract verify checks recorded traffic (history or a run report) against an OpenAPI document, without sending any request.

Every command writes the same kind of report (kind: contract), and every output goes through the active environment’s redaction.

Comparing two documents

rustman contract diff <OLD> <NEW> [--fail-on-unknown] [--fail-on <breaking|unknown|non-breaking>]
                      [--allowlist <FILE>] [--report <FORMAT>[=<PATH>]]... [--env <NAME>] [--workspace <DIR>]
rustman contract diff --base <GIT-REF> <PATH> [same options]

OLD and NEW are files or http(s) URLs, loaded and validated as OpenAPI import does. An invalid document prints the import diagnostics and exits 2. Every difference is printed with its classification, rule id, operation, a message and a JSON pointer into each document, followed by the counts:

breaking      operation-removed  DELETE /users/{id}: operation removed
  old: /paths/~1users~1{id}/delete
  new: /paths
non-breaking  operation-added    GET /health: operation added
  old: /paths
  new: /paths/~1health/get

1 breaking, 1 non-breaking, 0 unknown (rule catalog version 2)

Exit codes and strictness

Exit codeWhen
0No difference fails the diff
1At least one difference fails it: by default, any breaking difference the allowlist does not accept
2An invalid document or allowlist, an unknown flag value, or a --base ref or path that cannot be read

unknown differences (such as composition-changed) do not fail the diff unless --fail-on-unknown (or --fail-on unknown) is given. --fail-on non-breaking makes every difference fail, for frozen APIs. Allowlisted differences never fail.

The allowlist

contracts/allowlist.yaml, in the workspace (or in the current folder outside a workspace), lists the differences a team has accepted; --allowlist <FILE> reads another file instead. Like Pact files and run reports, an allowlist larger than 20 MiB is refused (exit 2). Each entry names a rule and an operation (METHOD /path, as the diff prints it), optionally a pointer (into either document) to accept one element only, and needs a non-empty justification. expires (YYYY-MM-DD) ends the acceptance after that day.

- rule: operation-removed
  operation: "DELETE /users/{id}"
  justification: Deprecated since 2026-06, no traffic
  expires: 2026-12-31
- rule: response-enum-widened
  operation: GET /pets
  pointer: /components/schemas/Pet/properties/status
  justification: Every client maps unknown statuses to "other"

An accepted difference is still reported, as breaking (allowed), with its justification. The file is checked before the documents are compared; every invalid entry is reported with its line and exits 2:

error: contracts/allowlist.yaml:4: justification is required

Unknown rule ids, a missing operation, an expires that is not a date and unknown keys are errors too. Two situations only warn, on stderr, and leave the exit code alone:

  • warning: contracts/allowlist.yaml:1: allowlist entry expired on 2026-01-01: the entry allows nothing, so the difference it matched fails again.
  • warning: contracts/allowlist.yaml:5: unused allowlist entry (operation-removed DELETE /users/{id}): nothing matched it, and it can be removed.

Comparing with a Git ref

rustman contract diff --base origin/main openapi.yaml

reads the old document from origin/main:openapi.yaml in the repository that contains the current folder, and the new one from the working tree. Relative $ref files are read at the same ref, so a schema moved to another file is compared as it was. Paths are relative to the current folder. Rustman runs git show <ref>:<path>, so git must be on the PATH.

A path that does not exist at the ref exits 2 with openapi.yaml not found at origin/main (a document added on the branch has nothing to compare with). A ref that does not exist exits 2 too; in a shallow CI clone, fetch it first:

git fetch origin main --depth=1
rustman contract diff --base origin/main openapi.yaml --report markdown=out/contract.md

Reports

--report <format>[=<path>] (repeatable) writes the diff as a rustman.report/v1 report with kind: contract and mode: diff (see Reports), as json, markdown, junit, sarif or html. A report without a path goes to stdout, and the human summary then goes to stderr. The Markdown report suits a pull request comment: a summary line with the counts per classification, then a table per classification, breaking differences first, each with its rule id, operation, message and pointer.

In a GitHub Actions pull request workflow

The diff needs the base branch in the clone: check out with fetch-depth: 0 (or fetch the base branch), then compare the document with the base. The Markdown report suits a pull request comment, and the SARIF report shows each difference on the changed line of the pull request.

# .github/workflows/contract.yml
name: API contract
on: pull_request
permissions:
  contents: read
  security-events: write
jobs:
  contract:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
      - name: Install rustman
        run: cargo install --git https://github.com/CyberdyneCorp/rustman rustman-cli --locked
      - name: Breaking changes
        run: rustman contract diff --base origin/${{ github.base_ref }} openapi.yaml --report markdown=out/contract.md --report sarif=out/contract.sarif
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with:
          sarif_file: out/contract.sarif

The step fails (exit 1) on a breaking difference that contracts/allowlist.yaml does not accept; out/contract.md can be posted as a comment by a later step.

Pact contracts

Generating a Pact file (consumer side)

rustman contract pact generate [<COLLECTION>...] --consumer <NAME> --provider <NAME>
                               [--pact-version <3|4>] [--output <FILE>] [--env <NAME>] [--workspace <DIR>]

writes one Pact file for the consumer and provider pair, by default contracts/pacts/<consumer>-<provider>.json in the workspace (meant to be committed, or published with the pact-broker CLI). COLLECTION names folders or request files (the whole workspace by default); every http request in them becomes one interaction, named after the request. Requests of other kinds are skipped with a warning.

The request comes from the request file with its variables resolved in the active environment (an unresolved variable stops generation with exit 2). A secret is never written: its place holds «redacted:<name>», and the value gets a regex matcher, so Authorization: Bearer {{token}} becomes the example Bearer «redacted:token» with the matcher ^Bearer .+$. Dynamic values ({{$uuid}}, {{$timestamp}}, …) are written as «dynamic:$uuid» with a matcher the same way, so a file generated twice is the same file.

The expected response comes from the assertions:

AssertionPact
status: 200response status 200
status: 2xxv4: a statusCode matcher (success); v3: the status last recorded in history for the request, else 200 with a warning
status: [200, 201]v4: a statusCode matcher with the codes; v3: the first code
header: {name, equals} / {matches} / {contains}the header with an equality / regex / include matcher
json: {path, equals}the value at the path, with an equality matcher
json: {path, type}an example of the type, with a type matcher (integer for integers)
json: {path, matches} / {contains}a regex / include matcher
json: {path, length}an empty example array, with a type matcher whose min and max are the length (see Interop)

A Pact regex matcher must match the whole value, while a Rustman matches finds the pattern anywhere, so a pattern that is not anchored at both ends is written as [\s\S]*(?:<pattern>)[\s\S]* (matches: "^A" becomes [\s\S]*(?:^A)[\s\S]*); ^\d+$ is kept as it is.

Other assertions (latency, schema, body, the json comparisons, filter or recursive JSON paths) have no faithful Pact equivalent; each is left out with a warning that names it and the request file, and the interaction is still written:

warning: latency assertion has no Pact equivalent (users/get-user.rman.yaml)

Files follow the Pact Specification v4 by default (metadata.pactSpecification.version is 4.0); --pact-version 3 writes v3 (3.0.0).

Verifying a provider

rustman contract pact verify <PACT_FILE>... --provider-url <URL> [--provider-states-url <URL>]
                             [--allow-mutations] [--allow-destructive] [--production <HOST>]
                             [--report <FORMAT>[=<PATH>]]... [--env <NAME>] [--workspace <DIR>]

replays every interaction against the provider and compares the status, the expected headers and the body under the interaction’s matching rules (type, regex, equality, include, integer, decimal, number, min/max, eachLike, statusCode). A regex must match the whole value, as in Pact ([a-z]+ does not match ab-1). An interaction whose request path does not start with / (such as @other-host/x, which would change the host once appended to the provider URL) fails with request path '...' does not start with '/' and nothing is sent for it. Every mismatch names the interaction and where it is, as a JSON path for the body:

failed   get user (contracts/pacts/web-users.json)
  $.id: expected number 42, got string "42"

0 passed, 1 failed, 0 blocked

An interaction with provider states needs --provider-states-url: before the interaction, each state is POSTed to it as {"consumer", "state", "params", "action": "setup"}, and after it with "action": "teardown". A non-2xx setup fails the interaction. Stateful interactions without the URL stop verification before anything is sent (provider states declared but --provider-states-url not set, exit 2).

Every request goes through the safety policy: only the provider URL’s and the state URL’s origins may be reached, and [safety] paces them. Interactions that send POST, PUT or PATCH need --allow-mutations, and DELETE needs --allow-destructive; without them the interaction is reported as blocked: mutations not allowed (or blocked: destructive not allowed) and nothing is sent. State calls are POSTs to the endpoint named for them, so they need no flag. A provider whose host is in [safety].production_hosts is refused (exit 4) unless --production <HOST> repeats that host. Requests are sent as the Pact file holds them: a secret header holds its «redacted:...» example, so a provider that checks credentials needs a provider state (or a verification environment) that accepts it.

A typical flow, with the provider running locally:

rustman contract pact generate users --consumer web --provider users --env dev
rustman contract pact verify contracts/pacts/web-users.json --provider-url http://localhost:8080 --provider-states-url http://localhost:8080/_pact/state
Exit codeWhen
0Every interaction passed
1At least one interaction failed
2An unreadable Pact file (or one over 20 MiB, the limit OpenAPI documents have too), stateful interactions without --provider-states-url, or an invalid URL
4At least one interaction was blocked by the safety policy, or the provider is a production host (see Safety)

The Pact files Rustman writes validate against the published Pact JSON schemas, and a CI job verifies them with the official verifier (pact_verifier_cli) too, expecting the same verdicts.

Interop with the official verifier

The pact-interop CI job generates a v3 and a v4 Pact file, verifies both with Rustman and with pact_verifier_cli 1.4.0 against the same fixture provider, and requires the same verdict for every interaction but one, which the implementations disagree on:

  • length on an array. json: {path: "$.tags", length: 2} is written as the example "tags": [] with {"match": "type", "min": 2, "max": 2}. The example is empty because the assertion says nothing about the items, and any example item would constrain their type: the type matcher cascades to the items. The specification’s matcher tables (v3 and v4, MinType/MaxType/MinMaxType) say that for a collection “the length of the actual value is compared against the minimum” and maximum, and Rustman does that, so "tags": [] fails. pact_matching, which pact_verifier_cli uses, applies no matcher to a list whose example is empty (compare_lists_with_matchingrule in pact_matching/src/matchingrules.rs), so it passes any array there, of any length. The same holds in v3 and v4. A provider verified with the official tools is therefore not held to a length assertion; one verified with Rustman is.

Passive conformance

rustman contract verify --spec <OPENAPI> [--from <history|RUN_REPORT>] [--since <AGE>] [--grep <TEXT>] [--limit <N>]
                        [--fail-on-undocumented] [--report <FORMAT>[=<PATH>]]... [--env <NAME>] [--workspace <DIR>]

checks recorded exchanges against a document and opens no network connection. The document must be a local file: a URL is refused before anything is sent (download it first), and so are $refs to remote documents. The exchanges come from the workspace history (the ad-hoc history outside a workspace), filtered with --since, --grep and --limit as rustman history list does, or from a run report written by rustman run --report json=<path> (--from <path>). Each exchange is matched to an operation by method and path template, its request is checked against the operation’s parameters and body schema, and its response against the documented status and the JSON schema of its body:

violation     GET /users/{id}: exchange 01JD3W6Q0Z5RKM8V9S4T2B7XNC (GET http://localhost:8080/users/7)
  $.email: required property missing
undocumented  GET /internal/debug: exchange 01JD3W6Q1C8D2F4G6H8J0K2M4P (GET http://localhost:8080/internal/debug)

observed operations:
  GET /users/{id}  3 exchanges, 1 with violations
  GET /users  2 exchanges, 0 with violations

2/12 operations observed; 1 violation, 1 undocumented, 4 conforms

An exchange that matches no operation is undocumented. The summary lists the documented operations the traffic exercised with their number of exchanges, and the coverage (5/12 operations observed); the report carries the same coverage, with violations per operation.

rustman run users --env dev --report json=out/run.json
rustman contract verify --spec openapi.yaml --since 7d --report markdown=out/conformance.md
rustman contract verify --spec openapi.yaml --from out/run.json --fail-on-undocumented
Exit codeWhen
0No violation (and, with --fail-on-undocumented, no undocumented exchange)
1At least one violation, or an undocumented exchange with --fail-on-undocumented
2An invalid document, an unreadable run report or a report of another kind

Secrets

Documents can hold anything, such as an example with a real token, and a provider or a recorded response can echo a secret back. With a workspace and an active environment (--env, RUSTMAN_ENV or default_environment), every secret value of that environment is replaced with «redacted:<name>» in everything a contract command prints or writes: the diff, Pact files, verification mismatches, conformance evidence, the warnings and every report. Secrets used by a request are never written to a Pact file, whatever the environment (see Generating a Pact file).

Contract rule catalog

rustman contract diff compares two OpenAPI 3.0/3.1 documents and reports every difference with one of the rules below. rustman contract rules prints the same list (--json for a JSON array).

Catalog version: 2. The version is recorded in every diff and changes whenever a rule is added, removed or reclassified.

How differences are classified

Documents are compared after loading them as OpenAPI import does: references bundled, OpenAPI 3.0 schemas rewritten to 3.1 (nullable: true is the same as a null type) and path-item parameters merged into each operation. Operations are matched by method and path template, ignoring parameter names (/users/{id} and /users/{userId} are the same operation, reported as path-parameter-renamed). Path parameters are matched by position, other parameters by name and location (header names ignore case).

Schemas are compared with a direction:

  • Request schemas (parameters and request bodies) break clients when they get stricter: a new required field, a narrowed enum, a tighter constraint, a type that rejects old values.
  • Response schemas break clients when they lose guarantees: a removed field, a field that is no longer required, a type that accepts new kinds of values, a narrowed enum. A widened response enum or a looser response constraint may surprise clients and is unknown.

$refs are followed (each difference points to where the change is, such as /components/schemas/User/properties/email), and recursive schemas are compared once per level. The members of an allOf add up to one object: their properties, required lists and types are compared like those of any object, so moving a field between members, or wrapping a schema in an allOf, is not a change, and a field that disappears with a removed member is. What else an allOf member says (constraints, enums, nested oneOf), and any change inside oneOf, anyOf and not, is not proven equivalent or compatible: it is reported as composition-changed (unknown).

Response headers are compared like parameters, by name (ignoring case), and their schemas in the response direction.

items and additionalProperties are constraints too. Absent, true and an empty schema accept anything, false accepts nothing, and a schema is in between: a move towards false (additionalProperties absent -> {type: integer} -> false, or items appearing) is stricter, a move the other way looser, and two schemas are compared member by member. additionalProperties: false in an allOf member closes the whole object. multipleOf is compared by exact decimal divisibility: 10 -> 5 is looser (every multiple of 10 is a multiple of 5), 5 -> 10 stricter, and 4 -> 6 both, so it is breaking in a request and unknown in a response. Values too large or too precise to compare exactly are constraint-changed.

A removed response status that the new document still covers is not response-status-removed: OpenAPI lets a range (1XX to 5XX) stand for every code of its class that is not declared, and default for every status that is not declared otherwise. So when 200 gives way to 2XX (or, without 2XX, to default), and when a range gives way to default, the old response is compared with the one that now covers it, as response 200 (now 2XX).

Each difference carries a JSON pointer into each document. When an element exists in one document only, the pointer into the other is the closest enclosing element (for a removed operation, its path item or /paths).

Breaking

RuleDescriptionExample
operation-removedAn operation is removed.DELETE /users/{id} is in the old document only
response-status-removedA response status is removed from an operation.GET /users/{id} no longer declares 404
response-media-type-removedA response media type is removed.the 200 response drops application/xml
response-field-removedA response field is removed or renamed.$.email disappears from the 200 body
response-field-became-optionalA response field is no longer required.email leaves the required list of the 200 body
response-field-type-changedA response field’s type changes or accepts more types.$.id goes from integer to string
response-header-removedA response header is removed.the 200 response no longer declares X-Rate-Limit
response-header-became-optionalA response header is no longer required.X-Rate-Limit changes to required: false in the 200 response
response-enum-narrowedValues are removed from a response enum.$.status goes from [active, suspended, deleted] to [active, suspended]
request-required-field-addedA request body field becomes required, or a new required field appears.email is added to the required list of the POST /users body
request-field-removed-from-closed-schemaA request body field is removed from a schema with additionalProperties: false; clients that still send it are rejected.POST /users no longer declares nickname and allows no other properties
request-required-parameter-addedA new required parameter appears.GET /users gains a required query parameter tenant
parameter-became-requiredAn optional parameter becomes required.query parameter limit changes to required: true
request-body-became-requiredA request body becomes required, or a new required body appears.PATCH /users/{id} changes its body to required: true
request-media-type-removedA request body media type is removed.POST /users no longer accepts application/x-www-form-urlencoded
request-type-changedA request field’s type changes to one that rejects old values.$.age goes from [integer, string] to integer
request-enum-narrowedValues are removed from a request enum.query parameter sort goes from [asc, desc] to [asc]
request-constraint-tightenedA request constraint gets stricter (maxLength, maximum, pattern, minItems, additionalProperties, items, …).$.name goes from maxLength: 100 to maxLength: 50
parameter-location-changedA parameter (or an API key) moves to another location.api_key moves from a query parameter to a header
security-requirement-removedEvery security alternative an operation accepted is removed.GET /users accepted basicAuth and now accepts only bearerAuth

Non-breaking

RuleDescriptionExample
operation-addedAn operation is added.GET /health is in the new document only
operation-deprecatedAn operation is marked deprecated.GET /users/{id} gains deprecated: true
path-parameter-renamedA path parameter is renamed; the path template is the same./users/{id} becomes /users/{userId}
response-status-addedA response status is added to an operation.GET /users/{id} declares a new 429
response-media-type-addedA response media type is added.the 200 response adds application/xml
response-field-addedA response field is added to a schema that allows other properties.$.nickname appears in the 200 body
response-field-became-requiredA response field becomes required.nickname joins the required list of the 200 body
response-header-addedA response header is added.the 200 response declares a new X-Request-Id
response-header-became-requiredA response header becomes required.X-Request-Id changes to required: true in the 200 response
response-type-narrowedA response field accepts fewer types.$.nickname goes from [string, null] to string
response-constraint-tightenedA response constraint gets stricter.$.name goes from maxLength: 100 to maxLength: 50
request-optional-field-addedAn optional request body field is added.POST /users accepts an optional nickname
request-optional-parameter-addedAn optional parameter is added.GET /users gains an optional query parameter page
request-field-became-optionalA request body field is no longer required.email leaves the required list of the POST /users body
parameter-became-optionalA required parameter becomes optional.header X-Tenant changes to required: false
request-body-addedAn optional request body is added.DELETE /users/{id} accepts an optional JSON body
request-body-became-optionalA required request body becomes optional.PATCH /users/{id} changes its body to required: false
request-media-type-addedA request body media type is added.POST /users also accepts application/x-www-form-urlencoded
request-type-widenedA request field accepts more types.$.age goes from integer to [integer, string]
request-enum-widenedValues are added to a request enum.query parameter sort goes from [asc] to [asc, desc]
request-constraint-loosenedA request constraint gets looser.$.name goes from maxLength: 50 to maxLength: 100
security-alternative-addedA security alternative is added to an operation.GET /users also accepts apiKey
docs-changedOnly documentation changes (summary, description, title, examples).the GET /users description is reworded

Unknown

RuleDescriptionExample
response-enum-widenedValues are added to a response enum; clients may not handle them.$.status goes from [active] to [active, archived]
response-constraint-loosenedA response constraint gets looser; clients may not handle the new values.$.name goes from maxLength: 50 to maxLength: 100
constraint-changedA constraint changes in a way that cannot be ordered exactly as stricter or looser.$.amount goes from multipleOf: 3 to multipleOf: 1e300
response-field-added-to-closed-schemaA response field is added to a schema with additionalProperties: false.$.nickname appears in a 200 body that allowed no other properties
request-field-removedA request body field is removed; clients may still send it.POST /users no longer declares nickname
parameter-removedA parameter is removed; clients may still send it.GET /users no longer declares the query parameter page
request-body-removedA request body is removed; clients may still send one.DELETE /users/{id} no longer declares a body
security-alternative-removedSome, but not all, security alternatives of an operation are removed.GET /users accepted basicAuth or bearerAuth and now only bearerAuth
composition-changedA oneOf, anyOf, allOf or not composition changes.a 200 body goes from oneOf: [A, B] to oneOf: [A, B, C]
vendor-extension-changedAn x- vendor extension changes.x-rate-limit goes from 100 to 50

Load testing

rustman bench runs the request files and collections you already have as load: many virtual users (VUs) repeat them, with the same environments, variables, captures and assertions as rustman run. It is meant for quick, safe checks of how an endpoint behaves under load, not for distributed or scripted load generation.

rustman bench checkout/ --target https://staging.example.com --env staging --vus 5 --duration 30s

The behavior is specified in openspec/specs/load-testing. On a terminal a bench draws a live dashboard (see Live progress), prints a summary at the end and can write JSON and HTML reports. With --viz the viz companion shows it as a live dashboard.

Iterations and virtual users

An iteration runs every selected request once, in collection order (file-name order, or the folder’s _collection.yaml order:). For checkout/ with login, add-item and pay, each iteration sends login, then add-item, then pay.

Each VU is an independent client, like a separate user of the API:

  • its own variables and captures: a value one VU captures (a token, an order id) is never seen by another;
  • its own cookie jar, which starts empty and is not saved;
  • its own connection pool, so keep-alive behaves as it would for real clients.

Captures carry over from one iteration of a VU to the next. Unlike rustman run, a bench never writes to the workspace: captures are not persisted (and persisted captures are not read), nothing is recorded in history, and snapshot assertions compare only (a missing snapshot fails, as in CI mode).

A bench runs kind: http requests only; any other kind is refused before it starts. Requests are sent through the safety policy, so OAuth2 tokens are not acquired and Digest auth is refused (as for agents); use a token from a variable or a capture instead.

Executors

--executor picks how iterations are scheduled.

ExecutorModelFlags
constant-vus (default)closed--vus <n> (default 1), --duration <d> (default 30s) or --iterations <n>, --think-time
ramping-vusclosed--stage <duration>:<vus> (repeatable) or [[bench.stages]], --think-time
constant-arrival-rateopen--rate <n> (required), --duration <d> (default 30s), --max-vus <n> (default 50)

A flag of another executor is a usage error (exit code 2), such as error: bench: --vus does not apply to the ramping-vus executor.

constant-vus

--vus N VUs each run iterations back to back until --duration is over, or until --iterations iterations (in total, across every VU) have started. --think-time pauses each VU between two of its iterations: a fixed duration (500ms) or a uniform random one in a range (1s..3s); the default is 0.

rustman bench api/ --target http://localhost:8080 --vus 2 --think-time 1s..3s --duration 1m
rustman bench api/ --target http://localhost:8080 --vus 4 --iterations 200

ramping-vus

The VU count follows the stages, starting from 0: during each --stage <duration>:<vus> it moves linearly from the previous stage’s target to its own, and the target is adjusted every 100 ms.

rustman bench api/ --target http://localhost:8080 --executor ramping-vus \
  --stage 30s:20 --stage 1m:20 --stage 30s:0

This grows from 0 to 20 VUs over 30 seconds, holds 20 for a minute, and drops to 0 over 30 seconds.

Without --stage, the stages come from [[bench.stages]] in rustman.toml, so a reviewed ramp can live with the workspace; any --stage replaces them all:

[[bench.stages]]
duration = "30s"
target = 20

[[bench.stages]]
duration = "1m"
target = 20

[[bench.stages]]
duration = "30s"
target = 0

A VU removed by a ramp-down finishes its current iteration first (graceful stop); an iteration still running 30 seconds after its VU was removed is cancelled and counted as interrupted.

constant-arrival-rate

--rate R starts R iterations per second whatever the response times, each on a free VU of a pool of --max-vus. When every VU of the pool is busy, the iteration is not started: it is counted as dropped. With --rate 100 --max-vus 10 and responses taking one second, about 90 iterations per second are dropped.

rustman bench api/ --target http://localhost:8080 --executor constant-arrival-rate --rate 50 --max-vus 20 --duration 1m

When the duration is over (for every executor), no new iteration starts and those in flight get 30 seconds to finish before they are cancelled.

Request options

--timeout <duration> replaces every request’s total timeout (settings.timeout_ms); a request that takes longer counts as a timeout error. -k/--insecure skips TLS certificate verification for every request, as for rustman run.

Open and closed models

In a closed model (constant-vus, ramping-vus), a VU starts its next iteration only when the previous one is done. When the server slows down, the VUs send less: load adapts to the server, as a fixed group of users waiting for their pages would. The latency reported is service latency, the time each request took.

In the open model (constant-arrival-rate), iterations arrive at a fixed rate whatever happens, as independent users would. A slow server does not slow the arrivals, so queuing shows up in the latency.

Closed-model latencies hide queuing: during a two-second stall, a VU waits for one slow response and simply sends nothing else, so most of the stall never appears in the percentiles (coordinated omission). In the open model, latency is measured from each iteration’s scheduled start instead of its actual start, so every iteration scheduled during a stall reports the time it waited. These percentiles are labeled corrected. For “what latency do users see at this traffic level”, use the open model; for “how fast is one request”, either works.

Data feeding

--data <file> feeds each iteration a row of a CSV or JSON file, with its columns (or keys) as variables, read exactly as in data-driven runs. --data-mode chooses the row:

ModeRow of each iteration
sequential (default)The next row of one cursor shared by every VU: each row is used once per pass.
per-vuVU 1 always uses row 1, VU 2 row 2, and so on.
randomA uniformly random row.

--data-exhaust says what happens at the end of the rows: recycle (default) starts over; stop ends the VU (sequential) or leaves VUs without a row of their own idle (per-vu). random never runs out.

# users.csv: email,password with 3 rows
rustman bench login/ --target http://localhost:8080 --data users.csv --data-mode per-vu --vus 3

Here VU 1 uses row 1, VU 2 row 2 and VU 3 row 3 for {{email}} and {{password}}.

Values of secret columns are redacted from every output: columns listed with --secret-columns a,b or in a _collection.yaml secret_columns, and columns named like password, token, secret or api_key, which are marked automatically.

Safety

A bench always runs under the safety policy:

  • --target is required (error: bench: --target is required, exit code 2), and its origin is the only one requests may go to. [safety].allowed_hosts is ignored and there is no --allow-host. The target is shown in the report and the dashboards, so it must be a bare origin (scheme://host[:port], an optional trailing /): a target holding credentials (http://user:pass@host) or with a path, query or fragment (http://host/v1, http://host/?token=...) is refused with exit code 2, and the message does not repeat it. Put credentials in the request’s auth and paths in the request files.
  • Proxies: a proxy is where the load actually goes, so a request whose proxy (its settings.proxy, [http] proxy, or HTTP_PROXY/HTTPS_PROXY/ALL_PROXY) is not the target origin is refused like a foreign host (blocked: proxy not allowed (<proxy host>)): before any load when it is known statically, else as a blocked error when it is sent. Set the request’s proxy: none (or NO_PROXY) to bypass it, or bench the proxy itself as the target.
  • Before any load, every request is resolved with the environment, --var and the first data row. A request whose origin is not the target’s stops the bench with exit code 4 and, for example, error: api/report.rman.yaml: blocked: host not allowed (other.example.com), before anything is sent. The refusal names the bare host, with the port only when it is not the scheme’s default (127.0.0.1:8081). A URL that depends on a capture is checked when it is sent; a request (or redirect hop) to another origin is then not sent and counts as a blocked error.
  • Method gating: GET, HEAD and OPTIONS run by default; POST, PUT and PATCH need --allow-mutations, DELETE --allow-destructive. A blocked method stops the bench before any load, with exit code 4.
  • Production guard: benching a production target (as the production guard defines it) needs --production <host> repeating the exact target host, and --allow-destructive is always refused against production.
  • Agents can’t start a bench: the MCP server has no tool that generates load.

Load caps

A bench is capped at 50 VUs, 5 minutes and 200 requests per second by default. Flags asking for more fail with exit code 2 and name the cap:

error: bench: 100 VUs exceeds max_vus = 50 (raise it in rustman.toml [bench])

Only rustman.toml raises a cap, so that more load is a reviewed change rather than a flag:

[bench]
max_vus = 200          # VUs at once (--vus, the largest --stage, --max-vus)
max_duration = "10m"   # --duration, or the sum of the stages; also bounds --iterations runs
max_rps = 500          # --rate × requests per iteration, and a hard limit on requests per second

An arrival rate asks for --rate iterations per second, each sending every request of the collection, so --rate 150 over a 2-request collection asks for 300 requests per second and is refused under max_rps = 200.

max_rps is enforced across every executor by one rate limiter shared by all VUs, with evenly spaced requests and no bursts, so a closed model with fast responses never exceeds it either. When the target answers 429 Too Many Requests, the limiter halves its rate (and honors Retry-After), as for exploration; the summary warns when that happened, since it lowers the offered load. 429 responses also count as 4xx errors. Requests wait for the limiter in arrival order, so no VU is starved. The wait is in no latency of a closed model, so the summary also warns when the limit, not the target, set the throughput (over one request in ten waited at least half a request interval for it, at a rate near max_rps): raise max_rps to go beyond. The limiter spaces requests evenly and keeps no credit, so a sender that wakes up late for its slot loses that time: a fast sender stays below max_rps, never above it (on macOS the timer wakes a waiting sender about 2 ms late, so a single fast VU under the default 200 rps gets about 150 rps). In the open model the wait counts in the corrected latency, from the scheduled start.

Summary and errors

At the end, the bench prints a summary on stdout: iterations (completed and interrupted) and how long completed ones took (avg, p95, max; think time excluded), scheduled and dropped iterations (open model), requests per second, the error rate with errors by class, and latency percentiles (min, avg, p50, p90, p95, p99, max) per request file and overall, then the thresholds and, when the run stopped early, aborted: threshold or aborted: interrupted. Latency is the transport time of each request, from HDR histograms with 3 significant digits.

iterations: 120 completed, 0 interrupted
iteration duration (ms): avg 38.40, p95 71.20, max 130.10
requests: 240 (7.9/s), errors 1.25% (5xx 3)
latency (service, ms):
                                 min      avg      p50      p90      p95      p99      max  requests  errors
  checkout/login.rman.yaml      3.10    12.48    11.20    18.90    22.40    35.10    41.70       120  0.00%
  checkout/pay.rman.yaml        5.02    25.91    21.30    44.80    52.10    88.60   102.40       120  2.50% (5xx 3)
  overall                       3.10    19.20    15.90    38.20    46.70    80.30   102.40       240  1.25% (5xx 3)

Error classes: 4xx and 5xx (by response status, even when the request’s assertions pass), timeout, connect (refused or unreachable connections, DNS, proxy and other network failures), tls, blocked (refused by the safety policy at runtime), assertion (a failed assertion or required capture) and other (a request that could not be built, such as an unresolved variable).

Metrics

Besides the summary, a bench measures, per request file and overall: assertion checks passed and failed, the average time of each phase (dns, connect, tls, ttfb, download, over the requests that went through it), bytes sent (estimated from the request line, headers and text body) and received (response bodies). Each second also becomes a point of a time series: requests, errors, requests per second, p50/p95/p99 and active VUs (closed model: VUs running or thinking; open model: VUs of the pool busy with an iteration). Requests per second count from the start of the load to its end, over at least one second, so a run shorter than a second shows its request count. The report holds all of it.

Memory stays bounded whatever the number of requests: latencies and iteration durations go into fixed-size histograms, one per second merged into the totals, and no individual request is kept. Each VU still reads each response body as rustman run does, up to [http] max_body_bytes (10 MiB by default) in memory before spilling to disk, so very large responses with many VUs need up to VUs × that limit; lower max_body_bytes for such benches. Secret values a VU resolves or captures (a token from a login request, say) are kept for one iteration only, and the process-wide set that log lines are redacted with keeps at most about 32,000 of the most recent values, so a long bench that logs in on every iteration does not grow either.

Thresholds

A threshold makes a bench a pass/fail check for CI. --threshold "<metric><op><value>" (repeatable) is checked when the bench ends; if any is breached, the bench still writes its reports, then exits with code 1.

rustman bench api/ --target http://localhost:8080 --vus 10 --duration 1m \
  --threshold "p95<300ms" --threshold "error_rate<1%" --threshold "checks>99%"
MetricValueExample
p50, p90, p95, p99, max, avglatency, with us, ms, s or m (milliseconds when bare)p95<300ms, p99<=1.5s
error_rateerrors over requests, as a percentage or a fractionerror_rate<1%
checksassertions passed over assertions runchecks>99%
rpsrequests per second over the runrps>=50

Operators are <, <=, > and >=. file:<name>: scopes a threshold to one request file, named by its path, its path without .rman.yaml or its file name: file:checkout/login:p95<200ms. A scope that names no file of the bench is a usage error (exit 2). checks without any assertion is n/a and passes, with a warning in the summary.

The summary shows each threshold with what was measured:

thresholds:
  ✗ p95<300ms (412ms)
  ✓ error_rate<1% (0.20%)

Thresholds every bench of the workspace must keep go in rustman.toml, each metric with its condition; they are checked before those of --threshold:

[bench.thresholds]
p95 = "<300ms"
error_rate = "<5%!"
"file:checkout/pay:p99" = "<1s"

Abort on fail

A threshold ending in ! (error_rate<5%!) also stops the bench as soon as it is breached: after a 10-second warm-up it is checked every second against everything measured so far, and when it fails, no new iteration starts, those in flight get one second to finish, and the bench writes a partial report marked aborted: threshold and exits with code 1. Load stops within 2 seconds of the check.

Stopping with Ctrl+C

The first Ctrl+C stops starting iterations and waits up to 10 seconds for those in flight (the dashboard says so in its title; without it, a line on stderr does); the second cancels them at once. Either way the bench then prints its summary (ending in aborted: interrupted), writes its reports, which cover what ran, and exits with code 130.

Generator lag

If the machine running the bench is the bottleneck, every latency it measures is inflated. A bench measures its own scheduling lag (how late its tasks run) and, when the 99th percentile is above 10 ms, warns:

warning: the load generator lagged 23.4 ms at p99 (over 10 ms): results may be generator-bound

Fewer VUs, a lower rate or a faster machine then give truer numbers. The report keeps the lag as generator_lag_p99_ms.

Live progress

While a bench runs, stdout shows how it goes:

  • On a terminal, a live dashboard fills the screen: elapsed and remaining time (remaining only for a bench with a fixed duration), active VUs, requests per second, p50/p95/p99 latency (labelled service or corrected), the error rate, sparklines of p95 and requests per second over the last two minutes, each threshold as it stands so far, and a table per request file with an overall row. It redraws at most 4 times a second from a thread of its own, so drawing never slows the load. Ctrl+C works as below; when the bench ends the screen is restored and the summary printed.
  • Otherwise (stdout piped, redirected or in CI), no dashboard is drawn: one progress line is printed every 10 seconds, and a bench shorter than that prints none.
bench 20s/1m00s: 10 VUs, 412.0 req/s, 8240 requests, p50 18.20ms, p95 61.00ms, p99 120.40ms, errors 0.12%, thresholds 2/2 passing

A report written to stdout (--report json) never gets the dashboard; the progress lines and the summary then go to stderr.

Viz companion

--viz also streams the bench to the viz companion (rustman-viz, found as RUSTMAN_VIZ, then on PATH, then next to rustman) over the viz protocol: it opens the bench view, sends a bench_tick per second and a final bench_finished with the totals and thresholds. The companion draws them as the bench dashboard, and rustman viz <report.json> opens a saved bench report in the same view. These events hold counts, timings and threshold expressions only, never request or response content.

Viz never changes a bench: a companion that is missing, refuses the handshake or stops reading gets one warning (warning: --viz: Viz companion not found: ...), and the bench runs, reports and exits as without --viz. A companion built before the bench view gets:

warning: viz companion has no bench view

A slow companion misses ticks rather than slowing the bench; bench_finished waits for it at most 5 seconds.

Reports

--report <format>=<path> (repeatable) writes a rustman.report/v1 report with kind: bench (Bench reports): the profile and target, metrics per file and overall, the per-second series, the threshold results and up to 20 error samples per error class.

rustman bench api/ --target http://localhost:8080 --duration 1m \
  --report json=out/bench.json --report html=out/bench.html
FormatContent
jsonThe canonical report; validate it with rustman report schema, render it later with rustman report render
htmlA self-contained page with latency-over-time (p50, p95, p99) and requests-per-second charts, the thresholds, the latency table and the error samples; it loads nothing from the network
markdownThe same, as tables, for a pull request comment
junitOne test case per threshold, for CI test tabs
sarifOne result per breached threshold

A format without a path goes to stdout, and the summary then goes to stderr. Agents can read a bench report through the get_report tool by its path (out/bench.json); they cannot start a bench.

Redaction

Every output of a bench applies the environment’s redaction: the summary, the warnings, the progress lines and dashboard, the viz events, the error samples and every report format. Values of secret variables (captures of a secret variable included), of the request’s auth, and of secret data columns (--secret-columns, a collection’s secret_columns, and columns named like password, token, secret or api_key) appear as «redacted:<name>». An assertion that fails on a password shows «redacted:password», never the password. An error sample that shows the request (GET <url> -> 500) also replaces the value of every query parameter named like a secret (?password=...), even one set with a plain --var.

Exit codes

CodeMeaning
0The bench ran and every threshold passed.
1A threshold failed, or an abort-on-fail threshold stopped the bench (aborted: threshold).
2Usage error: a missing --target, a cap exceeded, a flag of another executor, a request kind other than http, an unreadable data file.
4Refused by the safety policy before any load: a host outside the target, a method not allowed, an unconfirmed production target.
130Interrupted by Ctrl+C: the summary and reports cover what ran, marked aborted: interrupted.

See also executor internals and overhead.

Stress testing

Only stress systems you own or are explicitly authorized to test. A stress run pushes a backend until it fails, on purpose. Rustman only sends load to targets listed in rustman.toml, refuses production unless you opt in twice, and stops at its caps, but the consent is yours.

rustman stress answers the question load testing does not: where does this backend break, how does it break, and does it recover? It runs the same request files and collections as rustman run and rustman bench, with the same environments, variables, captures and assertions, over the open-model (constant-arrival-rate) executor of rustman bench.

rustman stress breakpoint api/catalog --target https://staging.example.com --slo "p95<300ms" --slo "error_rate<1%"

Modes

ModeWhat it doesFlags
breakpointSteps the arrival rate up until an SLO breaks, then narrows down the last sustainable rate--start-rps (10), --step-factor (1.5), --step-duration (30s), --refine (3), --require-rps
spikeA baseline rate, a sudden multiple of it, then the baseline again; reports the errors during the spike and the recovery time--baseline-rps (10), --baseline (30s), --spike-factor (10), --spike-duration (30s)
soakA steady rate for a long time; fits a trend to latency and errors to spot leaks--rps, --duration, --drift-threshold (5%)
fuzzA steady rate with a share of mutated requests--rps, --duration (1m), --fuzz-ratio (0.2)

Rates count iterations per second; an iteration sends every request of the plan, so with three request files --start-rps 10 offers 30 requests per second. Results (max_sustainable_rps, breaking_rps, step rates) are in requests per second.

An unknown mode exits 2 and lists the valid ones. Every mode can mix in fuzzed requests and malformed payloads, and send wire faults after its load; all three are checked by the stress gate first.

Configuration

Everything that grants consent lives in rustman.toml, where reviewers see it:

[stress]
targets = ["https://staging.example.com"]   # the only origins a stress run may target
allow_production = []                       # production hosts, also confirmed with --production
families = []                               # costly families: compression-bomb, large-body
max_rps = 500                               # requests per second
max_duration = "10m"                        # breakpoint, spike and fuzz runs
max_soak_duration = "2h"                    # soak runs
max_body = "10MiB"                          # malformed payloads
max_bomb_ratio = 100                        # compression bombs expand to at most max_bomb_ratio × max_body
max_wire_connections = 20                   # wire faults
max_vus = 1000                              # VUs at once (--max-vus asks for fewer)
expected_max_body = "1MiB"                  # a 2xx to a larger body is a finding

[stress.slo]                                # SLOs of every stress run of the workspace
p95 = "<300ms"
error_rate = "<1%"

Durations take ms, s, m and h; sizes take bytes or KiB, MiB and GiB. Unlike the rest of rustman.toml, an unknown key in [stress] (such as a misspelt max_rsp) is an error, not a warning: a typo must not silently fall back to a default in the table that holds consent.

Safety

The safety policy of rustman explore and rustman bench applies first, pinned to --target as for rustman bench: no host besides the target, method gating (--allow-mutations, --allow-destructive), and the production guard (--production <host>). Every request is checked before any load. Then the stress gate adds its own refusals, all exiting 4 before anything is sent:

RefusalMessage
The target is not in [stress] targets (no flag adds one)stress: target not listed in rustman.toml [stress].targets
A production target whose host is not in [stress] allow_productionstress: production host <host> is not listed in rustman.toml [stress].allow_production
Fuzzing, malformed payloads or wire faults against production, whatever the opt-insstress: fuzzing and malformed input are never sent to production
--malformed compression-bomb without it in [stress] familiesnames rustman.toml [stress].families
--wire without --allow-wire-faultsstress: --wire sends raw, invalid HTTP and needs --allow-wire-faults
Requests or wire faults through a proxy the safety policy does not allownames the proxy: proxy not allowed (<host>)

The caps are checked next and exit 2 naming the key, such as stress: a duration of 4h exceeds max_soak_duration = 2h (raise it in rustman.toml [stress]). A breakpoint --step-duration longer than max_duration is refused the same way, since the run would end inside its first step. Flags only ask for less.

Every request goes through the same governed sender as exploration and rustman bench, with a governor built from the [stress] caps (max_rps as its rate, the VU pool as its concurrency). The governor lets a tenth of a second of max_rps (at least 2 requests) go out back to back, so a step offered at exactly the cap is not queued client-side by scheduler jitter; the average never exceeds max_rps. Unlike exploration, it never slows down on 429 Too Many Requests: throttling is what a stress run measures. Agents cannot start a stress run: the MCP server has no stress tool.

SLOs and windows

SLOs use the metrics of rustman bench thresholds: p50, p90, p95, p99, max, avg, error_rate, rps and checks. Give them with --slo (repeatable) or [stress.slo]; scope one to a request file with file:<name> <expr>, such as --slo "file:checkout p99<800ms". Without any SLO, breakpoint and spike use p95<1s and error_rate<5%.

SLOs are judged over 5-second windows. Latency counts from each iteration’s scheduled start (coordinated-omission correction), so queuing in the target shows up in the percentiles.

Breakpoint

Steps start at --start-rps and multiply by --step-factor: with the defaults, 10, 15, 22.5, 33.75, 50.6, 75.9 req/s and so on, 30 s each. The first window of a step is a warm-up and is not judged. A step breaks when SLOs fail in 2 consecutive windows (one bad window is not a break), and ends there. After the first broken step, --refine bisection steps run between the last good and the first broken rate, which brings the two within about 10%:

step  offered   achieved  p95        errors   verdict
   1  10        10        14ms       0.00%    ok
   ...
   5  50.62     50.6      182ms      0.00%    ok
   6  75.94     68.2      1420ms     0.00%    broken
   7  63.28     61.9      1105ms     0.00%    broken
   8  56.95     56.9      260ms      0.00%    ok
   9  60.12     59.8      1012ms     0.00%    broken
max_sustainable_rps: 56.95
breaking_rps: 60.12 (latency; first failing endpoint: search, p95 1890ms, errors 0.00%)
  • Failure mode: each broken window is classified by its dominant symptom: server-errors (5xx), timeouts, connection (refused, reset, TLS), throttled (429, or 503 with Retry-After) when an error SLO failed; otherwise saturation (achieved below 90% of offered while latency is up) or latency.
  • Rate limiting is not a break: throttled responses are not errors for the SLOs, and the run reports rate limited at <rps> req/s and climbs on, unless --treat-throttling-as-failure makes them errors.
  • First failing endpoint: for a broken step, the request file whose latency or error rate crossed its SLO first, from the per-file windows, with its p95 and error rate.
  • Cool-down: after a broken step, nothing is offered until a window closes with no request in flight (at most 6 windows), so the late answers of the broken step are not measured in the next step. Those windows show in the series at 0 req/s and belong to no step.
  • The cap: the rate never exceeds max_rps. A step at the cap that holds ends the search with no break found up to max_rps = 500 and max_sustainable_rps at the cap. The whole run also stops at max_duration.

A broken breakpoint is a result, not a failure: the run exits 0 unless --require-rps is given and max_sustainable_rps falls short of it, or a finding reaches --fail-on.

Spike

The baseline rate runs for --baseline, then --spike-factor times it for --spike-duration, then the baseline again for another --baseline. The summary gives the baseline p95, the requests and errors during the spike, the peak p95 and the recovery time: how long after the spike the per-second p95 came back within 20% of the baseline p95 (or within 10 ms of it, for very fast targets) and stayed there for 3 seconds, without errors.

baseline p95 31ms; during the spike 6000 requests, 42 errors; peak p95 2210ms
recovered in 14s

Soak

--rps is held for --duration (up to max_soak_duration). A linear trend is fitted to the p95 and error rate of each minute. A p95 slope above --drift-threshold (default 5% of the median p95 of the first 10 minutes, per hour) is the medium finding latency-drift, with the slope in ms per hour; an error rate rising by more than one point per hour is the medium finding error-drift. Both hint at leaks: memory, connections, queues. With fewer than three minutes of data, no trend is fitted: the summary says p95 trend not available: too little data instead of a slope.

Fuzz mixing

--fuzz-ratio r (0 < r <= 1; the fuzz mode defaults it to 0.2) replaces each request with a mutated variant with probability r. Requests are replaced, not added: offered load stays the same, so valid traffic can be compared with and without fuzzing. Fuzzed exchanges are measured apart: the step table, the SLO windows and the bench metrics count valid traffic only, and the summary shows fuzzed traffic on a line of its own.

rustman stress fuzz api/orders --target https://staging.example.com --rps 20 --duration 5m --allow-mutations --seed 42
  • Where variants come from. Without --spec, one mutation of the saved JSON body per variant: a type flipped (2 becomes "2"), a value nulled, a key removed, a number at the 64-bit boundary (9223372036854775808), a 10 000-character string, unicode edge cases (NUL, a byte order mark, a right-to-left override), a value wrapped in an array, or a key duplicated. With --spec openapi.yaml, a request whose method and path match an operation gets variants that break exactly one constraint of its body schema (a required field missing, a wrong type, a bound, a length, a pattern, an enum), drawn with the seeded generators of rustman explore. A request without a JSON body is sent as is. When no request was fuzzed (a plan without a JSON body to mutate, such as GETs only), the summary prints fuzz: warning: no request was fuzzed instead of the share replaced, and fuzz-degrades-valid-traffic is not judged: a drift then is not fuzzing’s doing.
  • Reproducible. Every run has a seed, printed at start (stress: seed 42) and in the summary; --seed replays it. A slot is one request of one iteration of the fuzz phase, and the same seed and plan fuzz the same slots with the same variants. Outcomes may still differ: servers are not deterministic.
  • Baseline. A run with fuzzing first runs a clean phase at the mode’s first rate for --baseline (default 30s, rounded up to whole windows; it counts toward max_duration). If valid traffic at that rate is then more than 50% slower at p95 (and more than 10 ms slower, so a fast target’s jitter does not count), or its error rate more than 1 point higher, and at least one request was fuzzed, the run reports the high finding fuzz-degrades-valid-traffic with both values: bad clients hurt good ones.
  • Findings. A 5xx answer to a variant is the high finding server-error-on-malformed-input, and no answer in time is timeout-on-malformed-input. A 2xx answer to a variant that breaks the schema is accepted-malformed-input, and to one over a documented maxLength or maxItems (or over [stress] expected_max_body) is oversized-input-accepted. Each finding names its source (mutation, schema or the malformed family) and keeps the first exchange as evidence, redacted: the request with the Content-Type the variant was sent with, the body sent, the status and the start of the response body (at most 4 KiB). Without a response, the evidence body says what happened instead (such as a timeout).

Malformed payloads

--malformed <families> adds raw-byte payloads to the fuzz pool (with --fuzz-ratio 0.2 unless given). They replace the request’s body on the normal send path, so the request’s headers, auth, cookies and timing apply as usual.

FamilyPayloadBounded by
json-syntaxthe body cut in half, a trailing comma, unquoted keys, single quotes, an unterminated string, NaN
deep-nestingarrays nested 16, 128, 1024, 5000 or 10 000 deepdepth 10 000, max_body
large-bodya JSON string of 64 KiB up to max_body1 MiB unless large-body is in [stress] families
widean object of 1000, 10 000 or 100 000 keys100 000 keys, max_body
encodinginvalid UTF-8, a raw NUL, an overlong encoding, a lone surrogate
content-type-mismatchJSON sent as XML, XML or a form sent as JSON
duplicate-keysthe body’s first key repeated with another value
numbers1e400, a 40-digit integer, -0, 1e-400
compression-bombgzip with Content-Encoding: gzipexpands to at most max_bomb_ratio × max_body (64 MiB at most); needs [stress] families

A 5xx answer names the family and, for families that grow, the smallest input that failed, such as smallest failing depth: 5000. A 2xx answer to json-syntax, encoding, content-type-mismatch, duplicate-keys or numbers is accepted-malformed-input; the well-formed families (deep-nesting, large-body, wide, compression-bomb) are judged by size only, against expected_max_body.

Wire faults

--wire <families> --allow-wire-faults sends raw HTTP/1.1 that a correct client never sends, after the load phase (not after Ctrl+C). It opens its connections with the engine’s connector (DNS, connect timeout, ca_bundle, client certificates, TLS with ALPN http/1.1); proxies are always tunnelled, never asked to forward, and a proxy outside the safety policy is refused (exit 4). At most max_wire_connections (default 20) sockets are open at once, whatever the mode. Only the status line and the connection state of an answer are read, within 10 s.

FamilySentFinding
oversized-headersa 70 KiB headerconnection-dropped-without-response (low) when the server closes without answering; 431 expected
many-headers1000 headersthe same
cl-te-conflictContent-Length and Transfer-Encoding: chunked, with a body that is complete only by Content-Lengthambiguous-framing-accepted (high) on a 2xx: the server framed the body by Content-Length (a request-smuggling desync); 400 expected
invalid-chunkeda chunk size that is not hexadecimalambiguous-framing-accepted on a 2xx
invalid-request-linea garbage request lineambiguous-framing-accepted on a 2xx
slow-bodymax_wire_connections connections sending a body at 1 byte per second, for 60 s at mostno-slow-client-timeout (low) when the server keeps every one open for the whole 60 s

Each family except slow-body sends 3 requests. A server that times slow clients out (with a 408 or a close) before the 60 s are up gets no finding. Wire faults are never sent to production, and agents cannot send them.

The client as the bottleneck

  • Before load starts, the open-file limit is read (on Unix) and a warning is printed when it is below max_rps × 2: every connection is a file descriptor.
  • During the run, the scheduler measures how late it dispatches each iteration. When it lags more than 100 ms behind schedule for 3 consecutive seconds, the windows holding those seconds are marked client-saturated: they never count as server breaks, a breakpoint step made of them never sets breaking_rps, and the search stops there.
  • Each VU is a task of its own on a pool of worker threads (one per core, 2 to 16), so load does not share one thread. The VU pool grows on demand up to --max-vus (default: max_rps; never above the max_vus cap, default 1000, so in-flight memory stays bounded); a scheduled iteration with no VU free is dropped, which shows as achieved below offered.

Kill switch and recovery

While load runs, the health request goes out once per second: --health <file>, or by default the first GET request of the plan. The target is declared down, and load stops at once (requests in flight are cancelled), when for 5 s connection errors (refused, reset, TLS) exceed half of the attempts, or timeouts do, or when the health request gets no answer 3 times in a row. The summary then says killed: target down at <rps> req/s (<reason>); a breakpoint run’s step breaks there with the failure mode connection (or timeouts).

After every mode, and after a kill, the recovery check sends the health request once per second. The target has recovered after 10 consecutive 2xx or 3xx answers whose latency is within 20% of the pre-stress baseline (the median of 3 health requests sent just before load; a 20 ms floor keeps a fast local target’s jitter from counting against it). Without recovery within --recovery-timeout (default 2m), the run reports the high finding no-recovery, with the last status and latency:

recovery: not recovered (no-recovery)
findings:
  high no-recovery: api/health.rman.yaml had not recovered 2m after load stopped: the last health request answered 503 in 12ms

The check is skipped (recovery: not checked (...)) when the plan has no GET and no --health is given, or when the health request already failed before load: recovery cannot be judged against a target that was never healthy. The health request goes through the same safety policy, with a governor of its own built from the [stress] caps.

Minimization

Once load has stopped and the target has recovered (or recovery was not checked), the input behind each crash-like finding (a 5xx or a timeout caused by a variant) is replayed alone, at 2 requests per second and at most 50 replays per finding, and reduced by delta debugging while the failure still reproduces: keys and items are removed, nesting is unwrapped and strings are halved. The smallest input is shown under the finding and kept in the report:

  high server-error-on-malformed-input: mutation input on api/orders.rman.yaml answered 500 (12 times)
    minimized (6 replays): {"qty":"2"}

A finding whose input does not fail when replayed alone is marked load-dependent: it only fails under load, which is itself a useful signal. Inputs that are not JSON (or larger than 64 KiB) are replayed once, not reduced. Minimized inputs are redacted like every other output. Ctrl+C stops minimization: after a first Ctrl+C (during load or during the recovery check) no replay is sent, and a minimization it interrupts is dropped rather than reported half done.

Reports and the live view

  • On a terminal the run shows a dashboard, redrawn at most 4 times a second: the mode, phase and step; offered and achieved rate; p50, p95 and p99 of valid and fuzzed traffic apart; error classes and the SLO status of the last windows; the kill-switch state and findings as they arrive. Drawing never holds up load generation.
  • Off a terminal (CI) it prints one line per step instead: step 3: offered 22.5 req/s, achieved 22.4 req/s, p95 31ms, errors 0.00%: ok. A step is a breakpoint step; in the other modes it is a stretch at one rate (a spike’s phases), at most a minute long.
  • The report (rustman.report/v1, kind: stress) is always kept as .rustman/stress/<id>/report.json (the run prints its id), and --report <format>[=<path>] also writes it as json, html, markdown, junit or sarif. It holds the mode, profile, seed, target and SLOs, the per-second series, the step table, breakpoint (max_sustainable_rps, breaking_rps, failure_mode, first_failing_endpoint), rate_limited_at, killed, recovery and the findings in the exploration finding format, so rustman report render, SARIF upload and rustman report diff treat them like exploration findings (a new no-recovery in the later report exits 1). The HTML page is self-contained and offline: latency and errors against offered load with the breakpoint marked, and the recovery timeline.
  • --viz streams per-second points to the viz companion’s stress view; a companion without it is a warning (viz companion has no stress view), shown once, and never changes the result.
  • Agents read stress reports through the report tools (get_report with a report file), but no MCP tool starts a stress run or sends malformed or wire-fault traffic.

Regression export

rustman stress export <id> --findings <ids|all> --into <dir> writes one file per finding from the kept report:

rustman stress export str-20261120-3fa9c1 --findings all --into regressions/stress

A finding with an input becomes a request file: the finding’s own request file (its URL, headers and auth, as templates) with the minimized input as its body and the assertion a correct API passes, status: "4xx". Secret placeholders in an input become {{name}} references again, so no export holds a secret. rustman run regressions/stress then fails while the bug is there and passes once it is fixed. Wire faults cannot be written as request files: they are exported as .wire.txt files of comments with the request line and the expected status (431 for oversized headers, 400 for ambiguous framing). Findings without an input (no-recovery, drift, fuzz-degrades-valid-traffic) are skipped by all and refused by id.

CI recipe

A capacity gate for a staging deployment: fail the job when the API no longer sustains 100 requests per second within its SLOs, or when a high finding appears, and keep the reports.

- name: Capacity gate
  run: rustman stress breakpoint api/catalog --target https://staging.example.com --env staging --slo "p95<300ms" --slo "error_rate<1%" --require-rps 100 --report html=out/stress.html --report sarif=out/stress.sarif
- uses: actions/upload-artifact@v4
  if: always()
  with:
    name: stress-report
    path: out/

The output is one line per step, and the exit code is 1 when max_sustainable_rps is below 100. Compare two runs with rustman report diff old.json new.json (--report json=out/stress.json).

Exit codes

CodeMeaning
0The run completed with no finding at or above --fail-on (default high), and max_sustainable_rps reached --require-rps when given.
1A finding at or above --fail-on, or max_sustainable_rps below --require-rps.
2A usage error or a cap.
4A refusal of the safety policy or the stress gate; nothing was sent.
130Ctrl+C: load stops at once and the recovery check still runs (a second Ctrl+C cancels requests in flight and the check).

Trace propagation

Rustman can send standard trace context with every request, so the exchange shows up in the backend’s distributed traces (Jaeger, Grafana Tempo, Honeycomb, Datadog, or any OpenTelemetry-compatible system). It is off by default: with no configuration, no tracing header is ever added, and nothing is sent anywhere but the request’s own target.

Turning it on

Propagation is enabled by one of:

  • a trace: block in an environment file (environments/<name>.yaml),
  • [trace] in rustman.toml,
  • the --trace flag of rustman send, rustman run, rustman graphql query, rustman rpc call / batch / discover and rustman grpc call, which turns it on even when no block enables it (enabled: false included).
# environments/staging.yaml
variables:
  base_url: https://staging.example.com
  tenant_id: acme
trace:
  enabled: true
# rustman.toml
[workspace]
name = "shop"
version = 1

[trace]
enabled = true
sampled = true
formats = ["w3c", "b3multi"]

[trace.baggage]
tenant = "{{tenant_id}}"

The active environment’s block applies over [trace] key by key: a key the environment sets wins, the others come from rustman.toml. So rustman.toml can hold the shared formats and link while each environment only says enabled: true. A preset link may take its link_base from the other file; the merged result is checked for every environment when the workspace loads. export is a single key: an environment’s export: table replaces [trace.export] as a whole, so each table that enables export names its own endpoint.

Settings

KeyDefaultMeaning
enabledfalseAdd trace headers to every request.
sampledtrueThe sampled flag sent: traceparent flags 01, or 00 when false; 1/0 in B3.
scopeexchangeexchange: each request starts its own trace. run: every request of one rustman run (or one exploration) shares one trace id, each with its own span id, so a whole flow appears as one trace.
formats[w3c]Any of w3c (traceparent), b3 (the single b3 header) and b3multi (X-B3-TraceId, X-B3-SpanId, X-B3-Sampled). Every format carries the same ids.
tracestatenoneA map of tracestate members. Values may use {{variables}}.
baggagenoneA map of baggage members. Values may use {{variables}}; they are percent-encoded on the wire.
linknoneA trace link template, or a preset name (see below).
link_basenoneThe base URL of a preset link, such as http://localhost:16686.

Every key is checked when the workspace loads; an unknown key or format is an error, and so is an invalid tracestate or baggage key. In rustman.toml, the [trace] keys above are known and never warn as unknown key.

Variables in tracestate and baggage

Values are resolved once per run from --var overrides, the active environment (secrets included) and rustman.toml [variables]. Request variables and captures are not available there. An unresolved name stops the run before anything is sent, with trace: unresolved variable(s): <name>, and a resolved tracestate value that is not valid there (a comma, =, or a character outside printable ASCII) fails with trace.tracestate: invalid tracestate value for '<key>'.

trace:
  enabled: true
  baggage:
    tenant: "{{tenant_id}}"

With tenant_id=acme, every request carries baggage: tenant=acme. A baggage header over the W3C limits (64 members or 8192 bytes) is still sent, with a warning, since servers may drop or reject it.

A secret used in a tracestate or baggage value is sent to the server as written (that is the point of baggage), and is redacted like any other secret in every output Rustman writes, in its percent-encoded baggage form too. Its headers are dropped on a cross-origin redirect, like any other header carrying a secret.

What is sent

With trace: {enabled: true}, each request carries a new traceparent:

traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01

Trace and span ids are random (from the operating system’s CSPRNG through rand) and never all zeros.

Headers you set yourself win

If a request file, a collection’s default headers or --header already sets traceparent, b3 or the X-B3-* headers, Rustman sends them unchanged and uses their ids instead of generating new ones. Formats the request does not set are added with those same ids. A tracestate or baggage header you set is never replaced either. A traceparent, b3 or X-B3-TraceId/X-B3-SpanId header you set that is not valid (uppercase hex, version ff, or not a trace context at all) is also sent unchanged, but Rustman then adds no trace header, records no trace id or link, and prints a warning, so the request never carries two conflicting traces. A B3 sampling decision without ids (b3: 0, b3: 1, b3: d, or X-B3-Sampled/X-B3-Flags without X-B3-TraceId and X-B3-SpanId) is valid B3: it is sent unchanged with no warning, and Rustman adds no trace header, so a deny decision is never overridden.

headers:
  - name: traceparent
    value: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01

Signed requests

The headers are added before auth helpers sign the request, so an AWS SigV4 signature covers traceparent and the other trace headers.

CORS

Trace headers are custom request headers: a browser-facing API with a strict CORS policy may reject them in a preflight. That only matters when you replay Rustman’s requests from a browser; Rustman itself sends no preflight.

Request kinds

KindWhere the context goes
httpThe request’s headers, on every redirect hop.
graphqlThe HTTP POST or GET, the SSE subscription request, and the WebSocket upgrade request.
jsonrpcThe HTTP request, or the WebSocket upgrade. A WebSocket connection is reused for the run (trace headers are not part of what decides the reuse), so calls sharing it share the handshake’s context.
grpcRequest metadata (traceparent, b3, x-b3-*) on native gRPC; HTTP headers on gRPC-Web.
wsThe WebSocket upgrade request. Frames carry no trace context, so the whole session shares the handshake’s.
sseThe stream request, sent again on each reconnect.
mcpEvery HTTP request of a Streamable HTTP or legacy HTTP+SSE server’s session. A stdio server has no HTTP layer and gets nothing.

What is recorded

Every exchange that carried trace context (propagation on, or a traceparent/B3 header the request set itself, even with propagation off) records a trace object in history and in each request of a --reporter json run report (requests[].trace), and exploration findings record the ids of their evidence exchange (evidence.trace). Kinds without an HTTP exchange record the context of the request that opened them: a ws session and a graphql subscription over WebSocket the upgrade’s, an sse session and a graphql subscription over SSE the first stream request’s (a reconnect sends the context again but the record keeps the first), a jsonrpc call over WebSocket the handshake of the connection it shares, and a grpc call the metadata it sent (native) or its request’s headers (gRPC-Web); the traceresponse of the handshake or response headers is read as for HTTP. MCP requests carry the context on every HTTP request of a session but do not record it yet:

"trace": {
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
  "span_id": "00f067aa0ba902b7",
  "sampled": true,
  "backend_trace_id": "0af7651916cd43dd8448eb211c80319c",
  "baggage": "tenant=acme,api_key=«redacted:api_key»",
  "start_ms": 1763372400000,
  "end_ms": 1763372400084,
  "link": "http://localhost:16686/trace/0af7651916cd43dd8448eb211c80319c"
}

Every field is optional in the schema except the ids and sampled, so reports and history written before tracing existed stay valid (rustman.report/v1 and rustman.history/v1 are unchanged). Trace and span ids are not secrets and are never redacted; tracestate, baggage and the link are redacted like any other output, so a secret baggage value shows as api_key=«redacted:api_key».

traceresponse and Server-Timing

A response’s W3C traceresponse header names the trace the server recorded. When its trace id differs from the one sent (the backend ignored the incoming context and started its own trace), it is recorded as backend_trace_id, both ids are kept, and links use the backend’s id. A malformed traceresponse is ignored.

The response’s Server-Timing metrics (db;dur=53.2;desc="query", app;dur=12) are parsed whether or not tracing is on and recorded per exchange as exchange.server_timings ([{"name": "db", "dur_ms": 53.2, "desc": "query"}]). The parser is lenient: it keeps each metric’s first dur and desc, and skips a malformed metric (logged at -vvv) while keeping the others. The TUI’s Timing tab draws them as sub-bars under the waiting phase.

link names where a trace can be opened. A preset expands to a template that starts with link_base (required with a preset, in the same file or the other one; loading fails with trace.link: preset 'jaeger' needs trace.link_base when neither sets it):

PresetTemplate
jaeger{base}/trace/{trace_id}
tempo{base}/explore?left=… (Grafana Explore with a TraceQL query for {trace_id})
honeycomb{base}/trace?trace_id={trace_id}
datadog{base}/apm/trace/{trace_id}

A custom template may use {trace_id}, {span_id}, {start_ms}, {end_ms} (Unix milliseconds of the exchange), {trace_id_dd} (the lower 64 bits of the trace id in decimal, for Datadog setups that show 64-bit ids, such as https://app.datadoghq.com/apm/trace/{trace_id_dd}) and {{variables}}, resolved like baggage values. Any other {name} is reported when the workspace loads:

environments/staging.yaml:3: trace.link: unknown placeholder {traceid}

A link is opened in the system browser, so it must be an absolute http:// or https:// URL: a template that does not start with one fails when the workspace loads with trace.link: expected an http:// or https:// URL, got '<link>', and one that starts with a {{variable}} (or a preset whose link_base is not such a URL) is checked once resolved. A link whose variable cannot be resolved, or that does not resolve to an http(s) URL, only loses the links (a warning is logged); requests are still sent. The browser opener itself also refuses anything but an http(s) URL.

Opening a trace

  • CLI: rustman send prints the ids and the link on stderr, after the response:

    trace: 4bf92f3577b34da6a3ce929d0e0e4736
    trace: http://localhost:16686/trace/4bf92f3577b34da6a3ce929d0e0e4736
    

    A trace: backend <id> line appears when the server’s traceresponse named another trace.

  • rustman trace open <exchange-id> opens the link of a history exchange (its id or a unique prefix, as rustman history show takes) in the system browser and prints it on stdout; --no-browser only prints it. The link is built from the exchange’s ids and the link template configured now for the exchange’s environment. Without a template it exits with code 2 and trace: no link template configured ([trace].link); an exchange that carried no trace context also exits with 2.

  • TUI: the Timing tab shows the trace id, the backend’s id and the link, and Ctrl+O (action trace.open) opens the link in the system browser.

The browser is opened with open (macOS), rundll32 url.dll,FileProtocolHandler (Windows) or xdg-open (Linux and the BSDs). The TUI shows the recorded (redacted) link; when it hides a secret variable, Ctrl+O rebuilds the real link from the template configured now and the active environment’s secrets, as rustman trace open does, and hands only that to the browser.

Exporting client spans (OTLP)

Rustman can also send its own side of each exchange to an OpenTelemetry collector, so a trace shows the client span next to the backend’s server spans. Export is a build feature and an explicit setting:

  • Build: release binaries include the exporter. A plain source build has no exporter and no OpenTelemetry crate; build with cargo install --path crates/rustman-cli --features otlp (or cargo build -p rustman-cli --features otlp). A build without it that finds export enabled prints warning: trace.export: this build cannot export spans (build rustman with the otlp feature) and sends requests as usual.
  • Setting: [trace.export] in rustman.toml (or export: in an environment’s trace: block, which replaces the whole table):
[trace.export]
enabled = true
endpoint = "http://localhost:4317"
protocol = "grpc"          # or "http/protobuf"
service_name = "api-tests" # the spans' service.name; "rustman" by default
use_env = false

There is no default endpoint: enabled = true without one fails when the workspace loads with trace.export.endpoint is required when export is enabled. Enabling export also turns trace propagation on (exported spans need the ids the requests carried), as enabled = true in [trace] would.

KeyMeaning
enabledExport spans. Off by default.
endpointhttp:// or https:// collector address. With grpc, spans go to the opentelemetry.proto.collector.trace.v1.TraceService/Export method (HTTP/2, h2c for http://); with http/protobuf, to <endpoint>/v1/traces, or to the endpoint as written when it has a path of its own.
protocolgrpc (default) or http/protobuf.
service_nameThe service.name resource attribute.
use_envRead the standard variables OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_(TRACES_)PROTOCOL and OTEL_EXPORTER_OTLP_(TRACES_)HEADERS (key=value,key2=value2, for an API key); they take precedence over the file. Off by default: an OTEL_EXPORTER_OTLP_* variable set in your shell is never read otherwise, so a shared collector configured for other tools never receives Rustman’s spans by accident.

The exporter uses Rustman’s own HTTP stack (rustls with the platform’s trust store; no proxy), so it needs no system library.

What a span holds

One span of kind CLIENT per exchange that got a response and carried a sampled trace context, with the exchange’s trace and span ids (so the backend’s server span is its child) and its tracestate (redacted). Its name is the HTTP method, and it has the OpenTelemetry HTTP semantic-convention attributes:

AttributeExample
http.request.methodGET
url.fullhttps://api.example.com/users?token=«redacted:token»
url.scheme, server.address, server.porthttps, api.example.com, 443
http.response.status_code200
network.protocol.version1.1
error.typethe status code, for 4xx and 5xx (the span status is then ERROR)
rustman.request.idthe request’s id in the workspace; for an exploration probe, <probe id>/<step> (cleanup for a cleanup delete)

Every query value in url.full is replaced by «redacted:<key>» and every query component without = by «redacted», credentials in the URL become REDACTED:REDACTED and the fragment is dropped. Header values are never exported, so Authorization and cookies cannot leak this way. The phases (dns, connect, tls, waiting, download) are span events at the end of each phase, with rustman.phase.duration_ms. Request and response bodies are not exported.

Delivery and failures

Spans are built after an exchange completes and queued; a worker thread sends them in batches every 5 seconds (or as soon as 512 are waiting), so export never sits on a request’s path. The queue holds 2048 spans and drops the oldest when full. rustman send, rustman run and the other commands that send requests wait up to 5 seconds for the last batch before exiting; the TUI does the same when it quits, and prints the last export warnings once the terminal is restored.

Explorations export too: rustman explore run (and explore resume) and the agent’s explore tools send one client span per probe exchange (each step of a probe, and each cleanup delete) through the same exporter, with the [trace.export] of the exploration’s environment. Under scope: run every probe of an exploration shares one trace. rustman explore run waits up to 5 seconds for the last batch before exiting and prints export warnings like rustman run; the agent server, which outlives the exploration, lets the worker send them on its schedule.

A collector that is down, slow or refusing never changes a result: exchanges, assertions, reports and exit codes are the same as without export. Failures are shown as a warning at most once a minute, such as:

warning: trace export to localhost:4317 failed: cannot connect to localhost:4317: Connection refused (os error 111) (3 span(s) dropped; requests are unaffected)

The TUI shows OTLP →<host:port> in the status bar while the active environment exports spans. Export failures appear there as warning toasts, after the next send.

Library use

Front-ends and other transports use the same primitives from rustman-core’s trace module: TraceConfig (the settings block), TracePropagation (the settings resolved for a run, set on SendOptions::trace for rustman-http), and TraceContextInjector, the trait a transport implements to receive the headers or metadata when it does not go through rustman-http’s request builder, as native gRPC does. ClientSpan::from_record builds the exported span of a recorded exchange, and ExportTarget resolves [trace.export]; the exporter itself is rustman-http’s otlp feature, used through the runner, or through runner::SpanExport (record_exchange, flush, take_warnings) by senders that do not go through a runner, as explorations do.

Agents (MCP server)

rustman mcp serve runs Rustman as a Model Context Protocol server, so an AI agent (Claude Code, Claude Desktop, IDE agents, any MCP client) can use your workspace: its saved requests, environments, explorations and reports. The agent goes through the same engine and the same safety policy as you. It can’t read secret values, it is read-only unless rustman.toml says otherwise, and every call it makes is written to an audit log.

The server is built on the official Rust SDK, rmcp 3.10. It negotiates MCP protocol revisions up to 2025-11-25 through initialize.

Setup

Claude Code

From the workspace folder (or any folder below it):

claude mcp add rustman -- rustman mcp serve

Claude Desktop and other clients

Configure a stdio server whose command is rustman with the arguments mcp serve --workspace /path/to/workspace:

{
  "mcpServers": {
    "rustman": {
      "command": "rustman",
      "args": ["mcp", "serve", "--workspace", "/path/to/workspace"]
    }
  }
}

rustman mcp serve finds the workspace like every other command: --workspace <dir>, else the folder holding rustman.toml at or above the current one. Without a workspace it exits with code 2 before the handshake. The session starts in the active environment (--env, else RUSTMAN_ENV, else default_environment); an agent can switch environments for its own session only.

Over stdio, stdout carries only MCP messages. Warnings, errors and logs (-v, RUST_LOG) go to stderr, redacted.

HTTP mode

For clients that can’t spawn a process, --http serves the Streamable HTTP transport at /mcp:

rustman mcp serve --http                    # http://127.0.0.1:8765/mcp
rustman mcp serve --http 127.0.0.1:9000 --token-file ~/.config/rustman/mcp-token

HTTP mode is a convenience for local tools, not a hosted service. Three locks protect it:

  • Loopback bind. The default address is 127.0.0.1:8765. A non-loopback address such as 0.0.0.0:8765 is refused with exit code 2 unless --allow-remote is also given, and then a warning is printed. Requests whose Host is not a loopback name are rejected. When --allow-remote serves a non-loopback address this Host check is off (on a loopback address it stays on), because remote clients reach the server under names it cannot know: the bearer token and the Origin check below are then the only locks, so keep the token secret and serve remote mode only on a trusted network.
  • Bearer token. Every request needs Authorization: Bearer <token>. The token is read from --token-file (surrounding whitespace is ignored, and an empty file is an error) or generated at startup (32 random bytes, base64url) and printed once on stderr. A missing or wrong token gets 401 and never reaches MCP. Tokens are compared in constant time.
  • Origin check. A request carrying an Origin header gets 403 unless the origin is a loopback origin (localhost, 127.0.0.0/8, [::1]) or listed in [agent].allowed_origins. This stops a web page from driving the server through DNS rebinding.

There is no TLS and no OAuth: keep HTTP mode on the loopback interface.

Permissions: the [agent] table

Agent permissions come only from rustman.toml. No command-line flag raises them, so an agent that can run shell commands can’t relaunch the server with more rights, and a change to them shows up in git diff and code review.

Without an [agent] table, these defaults apply:

[agent]
allow_mutations = false       # POST, PUT and PATCH
allow_destructive = false     # DELETE and unknown methods (implies allow_mutations)
require_confirmation = true   # mutations need a client that can ask the human
allowed_hosts = []            # empty: the hosts of the session's active environment
allowed_origins = []          # browser origins accepted in HTTP mode, besides loopback
max_output_bytes = 262144     # cap on one serialized tool result (256 KiB)
max_jobs = 2                  # background jobs at once
plugin_kinds = []             # plugin request kinds agents may run (each counts as a mutation)

allowed_hosts and allowed_origins take origins written as scheme://host[:port], as [safety].allowed_hosts does. Unknown keys and invalid values are errors, so a misspelled permission is never ignored.

What an agent may send

Every request an agent triggers, saved or ad hoc, passes these checks before anything is sent:

  1. Method. By default only GET, HEAD and OPTIONS. allow_mutations = true adds POST, PUT and PATCH; allow_destructive = true adds DELETE and every other method. A refused method gets code: "blocked" with the reason mutations not allowed for agents or destructive not allowed for agents.
  2. Allowlist. The origin must be in [agent].allowed_hosts, or, when that is empty, among the http(s) origins of the session’s active environment variables (base_url: http://127.0.0.1:8080/api allows http://127.0.0.1:8080). [safety].allowed_hosts doesn’t apply to agents. Anything else gets code: "blocked" with the reason host not allowed, and so does every redirect hop that leaves the allowlist.
  3. Production. An environment marked production: true, or a host in [safety].production_hosts, is refused: agents can’t confirm production hosts.
  4. Confirmation. See below.

A request of a plugin kind is run by its plugin, under the plugin’s own grants, not sent by the agent gate. It runs only when plugin_kinds lists its kind, counts as a mutation (it needs allow_mutations and the human’s confirmation), and is audited with the kind as its method and <kind>:<request id> as its URL. An unlisted kind gets code: "blocked" with plugin kind '<kind>' not allowed for agents (list it in [agent] plugin_kinds). The network requests the workspace’s plugins send in an agent session must also reach an origin of the allowlist above, and each one gets an audit line (see Plugins).

All the requests of a session share one rate limit and one concurrency limit, from [safety].rate and [safety].concurrency, rpc_call calls included (over HTTP or WebSocket).

rpc_call sends JSON-RPC calls, which are all POSTs: instead of the method rule it only sends methods matching [jsonrpc] agent_read_only_methods, and refuses subscriptions; the allowlist and production checks apply as above. See JSON-RPC.

grpc_list, grpc_describe and grpc_call check a gRPC target as the http or https origin it is reached over (grpc://h:1 as http://h:1); grpc:// and grpcs:// values of the active environment count for the allowlist like http(s) ones. grpc_call calls unary and server-streaming methods only. Every gRPC call is a POST, so the method rule reads the proto instead: a method marked option idempotency_level = NO_SIDE_EFFECTS; is a read, and any other method is a mutation, which needs allow_mutations and the human’s confirmation like an HTTP POST. See gRPC.

graphql_introspect and graphql_query reach the endpoint through the same sender as rpc_call (allowlist, production check and rate limit, on every request and redirect hop). Every GraphQL operation over HTTP is a POST, so the method rule reads the operation instead: a query is a read, and a mutation needs allow_mutations and the human’s confirmation like an HTTP POST (refused with blocked: mutations not allowed for agents otherwise). Subscriptions, and saved requests with transport: ws or sse, are refused with code: "blocked". So are an endpoint URL that carries query, operationName or extensions parameters (some servers run those in place of the POSTed body, so the operation the human confirmed might not be the one that runs) and $file upload markers in the variables of an ad-hoc graphql_query operation (an agent can’t attach a workspace file; a saved request you wrote may still upload one). graphql_query validates the document against the request’s active schema before sending, as rustman graphql query does without --no-validate; an invalid document comes back with outcome: "errored" and nothing is sent. graphql_introspect reads the schema_file or the cached schema and introspects the endpoint only when there is neither, or with refresh: true; the result is cached in .rustman/graphql/schemas/ like rustman graphql introspect’s.

send_request and run_collection also run saved kind: kafka, kind: mqtt and kind: amqp request files. A produce is a mutation (refused with blocked: produce requires allow_mutations unless [agent] allow_mutations, then confirmed by the human), a consume from a named AMQP queue without requeue or through a persistent MQTT session (clean_session: false) is destructive, and every broker (and a Kafka schema_registry.url) must pass the allowlist as its http(s) origin (mqtt:// and amqp:// URLs of the active environment count; Kafka host:port brokers need [agent] allowed_hosts). Agent consumes stop after at most 100 messages or 60 s. See Messaging.

The EVM tools (evm_call, evm_decode, evm_tx, evm_block, evm_logs_query, evm_ens) are read-only: they reach nodes through the same sender as rpc_call (allowlist and rate limit), pass the JSON-RPC method guards, never take or send a signed transaction, and evm_logs_query spans at most 10,000 blocks. See EVM toolkit.

realtime_listen opens a WebSocket or SSE session and returns the messages it received, after at most 100 messages or 60 s. Its URL must pass the allowlist (a ws:// URL is checked as its http:// origin, wss:// as https://), and sending frames is a mutation: refused with blocked: sending frames requires allow_mutations unless [agent] allow_mutations, and confirmed by the human otherwise. See WebSocket and SSE.

send_request and run_collection compare snapshots in CI mode: an agent never writes or updates a snapshot file, and a missing snapshot fails the assertion.

Human confirmation

When mutations are allowed, each mutating request first asks the human, through MCP elicitation, with the method, the redacted URL and the environment:

An agent wants to send DELETE http://127.0.0.1:8080/users/7 (environment 'local'). Allow it?

Only an explicit yes sends the request. Declining or dismissing the question gets code: "declined". A client that doesn’t support elicitation gets code: "confirmation_unavailable", unless require_confirmation = false: that setting accepts unattended mutations and should be used only when you trust the agent’s every call. A client that supports elicitation is always asked, whatever the setting. If asking fails, the call fails with confirmation_unavailable.

Clients that speak the stateless 2026-07-28 revision can’t receive elicitation requests from the server, so for them mutations fail closed with confirmation_unavailable (or need require_confirmation = false).

Tools

Every tool declares an input and an output JSON Schema, and returns structuredContent that conforms to its output schema, plus a one-line summary as text. Tools are thin adapters over the same engine calls the CLI makes.

The reference below is generated from the tool schemas that tools/list returns; a test keeps it in sync.

ToolArguments (required)Read-onlyDescription
list_requestscollection, kind, text, cursor, limityesList the workspace’s saved requests, filtered by collection folder, kind or text, 50 per page.
get_requestpathyesRead one saved request file by its id or path. Secrets appear as {{name}} references, never as values.
list_environmentsnoneyesList the environments: names, which is active in this session, and variable and secret names.
select_environmentnameyesMake an environment active for this session only; nothing is written to disk.
send_requestpath, vars, method, url, headers, body, timeout_msnoSend a saved request (path, optional vars) or an ad-hoc one (method, url, headers, body) through the safety policy. Returns the redacted exchange.
run_collectionpath, filter, vars, bailnoRun the requests under a folder or file like rustman run, in the background. Returns a job_id; get_report with it gives the run report.
import_openapispec, into, dry_runnoImport an OpenAPI document (a workspace file or an allowed URL) as a request collection. dry_run (the default) only reports what would change.
explore_planspec, target, probes, operations, seed, fuzz_cases, allow_mutations, allow_destructive, cursor, limityesPlan the probes of an exploration against a target without sending anything. Review it before explore_run.
explore_runspec, target, probes, operations, seed, fuzz_cases, allow_mutations, allow_destructive, cursor, limit, max_probes, max_duration_ms, fail_onnoStart an exploration in the background (read-only unless rustman.toml allows more). Returns a job_id and exploration_id.
explore_statusidyesThe phase, progress and findings by severity of an exploration, by job_id or exploration_id (default: the latest).
explore_canceljob_idnoStop a running exploration job. It stays resumable with rustman explore resume <id>.
get_reportid, formatyesA report by exploration id, run job id or JSON report file of the workspace (such as out/report.json): a summary (default), or rendered as json, markdown, junit, sarif or html.
list_findingsexploration_id, severity, operation, cursor, limityesThe findings of an exploration (default: the latest), filtered by minimum severity and operation, 50 per page.
search_historyurl, method, status, since, until, cursor, limityesSearch recorded exchanges by URL text, method, status range (500-599, 5xx, 404) and time range, newest first, 50 per page.
rpc_callpath, endpoint, method, params, vars, timeout_msnoSend one JSON-RPC call (endpoint, method, params) or a saved jsonrpc request through the safety policy. Only methods matching [jsonrpc] agent_read_only_methods are sent; subscriptions are refused.
realtime_listenpath, url, frames, max_messages, duration_ms, varsnoOpen a WebSocket (ws:// or wss:// url) or SSE (http(s):// url) session, or a saved ws or sse request, through the safety policy, optionally send initial frames (a mutation: needs [agent] allow_mutations), and return the redacted messages received, after at most 100 messages or 60 s.
graphql_introspectendpoint, path, type_name, refresh, varsyesThe schema of a GraphQL endpoint or saved graphql request: its schema_file or cached schema, else (or with refresh) introspected through the safety policy and cached. Lists the root and named types, or describes type_name.
graphql_querypath, endpoint, query, operation_name, variables, headers, vars, timeout_msnoValidate and send a GraphQL query or mutation (endpoint, query, operation_name, variables, headers) or a saved graphql request over HTTP through the safety policy. A mutation needs [agent] allow_mutations and the human’s confirmation; subscriptions are refused. Returns the redacted data and errors.
list_webhook_capturespath, method, verdict, since, cursor, limityesList the webhook captures saved to request history from the webhook inspector, newest first, filtered by path text, method, signature verdict and time, 50 per page. Redacted; nothing is replayed.
grpc_listtarget, path, refresh, varsyesList the services and methods (with call types) of a gRPC target or saved grpc request, by reflection or its schema, through the safety policy’s allowlist.
grpc_describesymbol, target, path, refresh, varsyesDescribe a gRPC service, method (with a request message template) or message of a target or saved grpc request.
grpc_callpath, target, method, message, metadata, deadline_ms, varsnoCall a unary or server-streaming gRPC method (target, method, message, metadata) or a saved grpc request through the safety policy. Returns the redacted status, metadata and messages; streams stop at 100 messages or 30 s.
evm_callpath, rpc, to, abi, function, args, block, from, estimate, varsyesRun a read-only eth_call (a saved evm-call request, or rpc, to, abi, function, args, block) through the safety policy and return the decoded outputs or revert, with the node’s chain and client. Never signs or sends a transaction.
evm_decodeabi, data, topicsyesDecode call data, revert data or (with topics) a log with an ABI (erc20, erc721, erc1155 or a workspace ABI file), offline.
evm_txhash, rpc, varsyesRead a transaction and its receipt by hash, with input data and logs decoded (token amounts in token units).
evm_blockblock, rpc, varsyesRead a block by number, tag or hash: number, hash, timestamp, gas and transaction count.
evm_logs_queryfrom_block, to_block, addresses, event, topics, rpc, varsyesQuery logs by address, event signature and topics over a block range of at most 10000 blocks, decoded.
evm_enstarget, rpc, varsyesResolve an ENS name to an address, or an address to its primary name verified by a forward lookup (needs a mainnet endpoint or [evm] ens_rpc).

Some tools belong to an optional capability and are registered only when rustman-mcp is built with its cargo feature: graphql_introspect and graphql_query with graphql, list_webhook_captures with webhook, and grpc_list, grpc_describe and grpc_call with grpc. All three features are on by default, so the rustman binary has every tool. A build without a feature (for example --no-default-features --features grpc) doesn’t list its tools in tools/list, and calling one gets a protocol error, like any unknown tool.

list_webhook_captures reads the captures you saved to request history from the webhook inspector (save to history, request webhook). The agent server runs no listener, so a capture that was never saved isn’t visible to agents. The captures were redacted when saved and are redacted again on the way out; bodies longer than the inline limit come with a body_ref like send_request’s.

Notes:

  • Saved and ad-hoc requests go through the runner like rustman send: variables, auth, assertions, captures and history all apply. Requests with OAuth2 auth can’t be sent by agents, because the token flow may need a browser; run rustman auth login and send them yourself. Requests with Digest auth are refused with an error rather than sent without credentials, because the agent path does not answer the challenge; send them with rustman send.
  • explore_plan and explore_run read the document from a workspace file or from an http(s) URL on a host agents may reach. The target must be such a host too. The seed defaults to 0, so a plan stays the same between its pages and the explore_run that follows; pass seed to vary the fuzz cases. Probes are read-only unless the agent asks for allow_mutations (or allow_destructive) and [agent] allows it; a mutating exploration asks the human first.
  • import_openapi with dry_run: false writes workspace files, so it asks the human first, like a mutation (and fails with confirmation_unavailable when the client can’t ask, unless require_confirmation = false). The running session keeps the request list it started with; reconnect to see the new files.
  • run_collection and explore_run start background jobs; see below.

Background jobs

explore_run and run_collection answer within 2 seconds with a job_id and keep working in the background, so an agent never waits on a long call. At most max_jobs jobs (2 by default) run at a time across every session of the server; a further job-starting call, from any session, gets code: "busy" until one ends. A cancelled job keeps its slot until its work has really stopped.

  • Status. explore_status reports an exploration’s state (running, completed, cancelled, interrupted or failed), phase, probes done out of the total, and findings by severity. get_report with a run’s job_id returns the run report once the run ends; while it runs, the error message says how far it got (job-1 is still running (2/5 requests)). A report file is read only inside the workspace (a symlink leading out of it is refused) and up to 32 MiB; a file that is not a report is refused without quoting it.
  • Progress. When the tools/call that started a job carried a progress token (_meta.progressToken), the server sends notifications/progress for that token every 2 seconds while the job runs, and once more when it ends. progress counts probes or requests done, total is the job’s size, and message reads like job-1 running: 12/51 probes. Messages are redacted like every other output. The tools/call itself has already answered with the job_id, so these notifications arrive after its response; this is how the server keeps a long job visible without making the agent wait. The MCP specification expects progress to stop when its request completes, so a strict client may drop them or log them under an unknown token. Poll explore_status or get_report when yours does.
  • Cancellation. explore_cancel with the job_id (or exploration id) stops an exploration; an MCP notifications/cancelled for the tools/call that started an exploration or a run does the same, if the client still sends one after that call answered (many clients only cancel requests still pending, so prefer explore_cancel). Cancelling stops dispatching new probes or requests, lets those in flight finish for up to 10 seconds, and still cleans up what the probes created, exactly like Ctrl+C on rustman explore run. The job’s status becomes cancelled.
  • Resuming. An exploration is journaled under .rustman/explorations/<id>/ like one started from the terminal, so a cancelled exploration stays resumable: rustman explore resume <exploration_id> runs the probes that did not finish, and never sends one twice. A run’s report stays available for the session; an exploration’s report is written next to its journal.

Resources

URIContent
rustman://requests/<path>A request file of the workspace, by its path (users/get-user.rman.yaml)
rustman://reports/<id>A rustman.report/v1 report: an exploration id, or the job id of a finished run
rustman://schemas/<name>report (the report JSON Schema) or an imported OpenAPI snapshot from .rustman/openapi/
rustman://bodies/<id>The whole redacted body of a truncated response (body_ref)

Every content is redacted. A path with .., a root, a drive or a backslash is refused before anything is read, and only files the workspace loaded as requests are readable under rustman://requests/.

Prompts

  • explore-api (arguments spec, target) guides an agent through explore_plan, reviewing the plan with the human, explore_run, polling explore_status, then get_report and list_findings.
  • triage-findings (argument exploration_id) guides an agent through grouping an exploration’s findings by root cause, with reproduction steps and a proposed fix per cause.

Secrets and redaction

An agent can refer to secrets by name but never read their values, in any form. Engine output is already redacted; the server then runs a second pass over the final JSON of every tool result, resource, log and progress message, which replaces:

  • every value of the session environment’s secrets, and of the secrets and credentials of every request sent in the session, in the forms the redactor matches (JSON, URL and HTML encodings) plus their base64 forms (standard and URL-safe, padded or not), with «redacted:<name>»;
  • the values of the Authorization, Proxy-Authorization, Cookie, Set-Cookie and X-Api-Key headers wherever a header appears, with «redacted:<Header-Name>»;
  • literal credentials pasted into tracked request and collection files: those headers’ values and the credentials of auth blocks (a Basic password, a Bearer token, an API key value). They are redacted in every output, including the file text get_request and rustman://requests/ return. Literals shorter than 6 characters are too common to replace everywhere and stay visible in file text; use a {{secret}} reference for any credential.

A backend that echoes Authorization: Bearer <api_token> into its body is shown as Bearer «redacted:api_token». Other transforms of a secret (hashing, encryption, custom encodings) are not recognized.

Output limits

  • A tool result whose JSON exceeds max_output_bytes (256 KiB by default) is refused with code: "invalid_input": narrow the request or page through it.
  • A response body over 32 KiB is cut to its first 32 KiB with truncated: true, its full size in bytes, and a body_ref such as rustman://bodies/b3. The whole redacted body stays readable through resources/read while the session keeps it: each session keeps up to 64 MiB of bodies, dropping the least recently used first.
  • Lists return 50 items by default with a next_cursor when more exist. Pass it back to get the next page; the last page has none. A cursor from a list that has changed since is refused.

Audit log

Every tool call appends one JSON line to .rustman/audit/<YYYY-MM-DD>.ndjson (UTC date) with the timestamp, session id, client name, tool, redacted arguments, outcome (ok, error, blocked or declined), the reason of a failed call and, for outbound requests, the method and redacted URL:

{"timestamp":"2026-11-18T10:04:12.311Z","session":"9f1c…","client":"claude-code","tool":"send_request","arguments":{"method":"POST","url":"http://127.0.0.1:8080/users"},"outcome":"blocked","reason":"mutations not allowed for agents","method":"POST","url":"http://127.0.0.1:8080/users"}

Plugin network requests in agent sessions get a line each too, with session plugins, client plugin and tool plugin:<name>.

Lines are appended with one write each; the server never rewrites or deletes them. Retention is up to you (the files are small). The audit log fails closed: if it can’t be written, the call is refused before it runs, or fails if the line can’t be appended afterwards. A background job checks it before each request it sends, so once the log can’t be written the job sends nothing more. .rustman/ is git-ignored by rustman init.

Error codes

Tool errors are tool results with isError: true and structuredContent {"code": "...", "message": "..."}, not protocol errors:

CodeMeaning
not_foundThe request, environment, report or resource does not exist
invalid_inputMalformed arguments, a stale cursor, or a result over max_output_bytes
blockedRefused by the agent permissions or the safety policy; the message is the reason
declinedThe human declined or dismissed the confirmation
confirmation_unavailableA mutating call needs confirmation and the client can’t ask
busyToo many background jobs are running (max_jobs)
internalAnything else, such as a network error or an audit log that can’t be written

MCP client

Rustman can connect to other MCP (Model Context Protocol) servers as a client, to explore and test them like any other API. This page covers server definitions, workspace trust, the transports and the session lifecycle, tools, resources, prompts and completion, notifications, progress and cancellation, server-initiated requests, OAuth, kind: mcp request files with their assertions, captures, runs and history, rustman mcp-client, and the TUI MCP inspector. Rustman as an MCP server for agents is a separate feature, described in Agents (MCP server).

Server definitions

MCP servers are defined by name, either in rustman.toml:

[mcp_servers.files]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "."]
env = { LOG_LEVEL = "info", API_TOKEN = "{{api_token}}" }
cwd = "fixtures"          # optional; default: the workspace root

[mcp_servers.remote]
url = "{{mcp_base}}/mcp"
headers = { X-Team = "core" }
auth = { type = "bearer", token = "{{mcp_token}}" }
timeout_ms = 30000        # optional

or one per file in mcp/servers/<name>.yaml (the file name is the server name):

url: "{{mcp_base}}/mcp"
headers:
  X-Team: core
auth:
  type: bearer
  token: "{{mcp_token}}"
KeyApplies toMeaning
commandstdioThe program to spawn.
argsstdioIts arguments.
envstdioVariables set for the process. The process inherits only a few of Rustman’s own variables (see Transports); everything else it needs goes here.
cwdstdioIts working directory, relative to the workspace root (default: the root).
urlHTTPThe server’s MCP endpoint.
headersHTTPHeaders sent with every request.
authHTTPAny auth helper (bearer, basic, api_key, …).
oauthHTTPA pre-registered OAuth client: client_id, client_secret, scopes (see OAuth).
rootsbothThe roots answered to the server’s roots/list (default ["{{workspace}}"]).
timeout_msbothThe request timeout of this server (default 60 000).

A server has either command (a stdio server) or url (an HTTP server). A definition with both fails to load with mcp: server <name> must define either command or url, not both; one with neither, or with keys of the other transport, fails too. Server names use letters, digits, -, _ and ., and a name may be defined only once across rustman.toml and mcp/servers/. Unknown keys are errors.

Every string value supports {{variable}} interpolation from the active environment, its secrets and [variables], resolved when a session is opened. Secret values are redacted from everything a session shows: its stderr log, errors and history.

Workspace trust

Spawning a stdio server runs a command the workspace chose, so Rustman asks first. Before a stdio server is spawned for the first time, or after its command, args, cwd, env keys or literal env values change, the full command line is shown and nothing is spawned until you confirm. Headless commands refuse an untrusted server with:

mcp: server files is not trusted; review it or pass --trust

--trust approves the server as it is defined now.

Approvals are kept per machine in .rustman/trust.yaml (git-ignored, readable by you only; trust is never shared through Git). An approval covers a SHA-256 fingerprint of the command, args, env (sorted by key) and cwd. A secret substituted into any field counts only by its name, so rotating a secret never asks again, while adding an env variable, changing a literal env value (such as PATH or NODE_OPTIONS, which decide what code runs) or changing an argument does. HTTP servers run nothing locally and need no approval.

Each entry is sealed with an HMAC-SHA256 under a key that never leaves this machine: 32 random bytes in trust.key in your data directory ($RUSTMAN_DATA_DIR, else ~/Library/Application Support/rustman on macOS, $XDG_DATA_HOME/rustman or ~/.local/share/rustman on Linux, %APPDATA%\rustman on Windows), created with the first approval and readable by you only. The seal also covers the workspace’s location. A trust file that came with a workspace (committed, or inside a downloaded archive with no Git at all), copied from another machine or from another workspace therefore approves nothing, and the server is asked about (or refused headless) as if it were new. Moving a workspace folder, or deleting trust.key, asks again.

As a second guard, a trust file that Git tracks or does not ignore, or that is a symbolic link, is refused rather than read:

refusing .rustman/trust.yaml: Git tracks it or does not ignore it; delete it and approve the servers again

.rustman/trust.yaml is a small library store other features can reuse: each entry maps a subject (here mcp/<name>) to the seal of the approved fingerprint.

Transports

stdio. The server is spawned with its args and cwd, and speaks newline-delimited JSON-RPC over stdin and stdout. Its environment is not Rustman’s: it gets only PATH, HOME, USER, LOGNAME, SHELL, TERM, LANG, LC_ALL, LC_CTYPE, TMPDIR, TEMP and TMP (on Windows also SystemRoot, SystemDrive, windir, ComSpec, PATHEXT, USERPROFILE, APPDATA, LOCALAPPDATA, ProgramData, ProgramFiles, ProgramFiles(x86), HOMEDRIVE, HOMEPATH, NUMBER_OF_PROCESSORS and PROCESSOR_ARCHITECTURE) when they are set, plus the definition’s env over them. Tokens and credentials in your shell (GITHUB_TOKEN, AWS_*…) never reach a server unless its definition passes them, for example env = { GITHUB_TOKEN = "{{github_token}}" }. Everything it writes to stderr goes to the session’s stderr log (secrets redacted), never into the protocol stream. If the process exits on its own, the session is marked disconnected with the exit code and the last 50 stderr lines. Disconnecting closes stdin, waits 5 seconds for the process to exit, then kills it together with every process it started, so a server behind a launcher such as npx, uvx or sh -c is not left running (on Unix the server runs in a process group of its own; on Windows its process tree is killed with taskkill). On Windows a bare command such as npx is looked up with PATHEXT, so npx.cmd and .bat launchers are found. A server that does not answer initialize within its timeout (--timeout of rustman mcp-client, else timeout_ms, default 60 s) fails with mcp: request timed out after 60s. Each stderr line keeps at most 4 KiB (the rest is replaced by [truncated]), and a message larger than 16 MiB (a stdio line, or an HTTP server’s event) ends the session, so a misbehaving server cannot exhaust memory; the requests in flight fail with mcp: server <name>: the server sent a message larger than 16 MiB; the session was closed.

Streamable HTTP. Requests go through Rustman’s HTTP engine, so the workspace TLS settings and proxies apply, plus the definition’s headers and auth. The Mcp-Session-Id the server assigns is sent on every following request, responses may be JSON or SSE streams, and the session is deleted on disconnect.

Legacy HTTP+SSE. If the server answers the initialize POST with a 4xx status other than 401, Rustman retries with the pre-2025 transport: it GETs the same URL as an event stream, waits for the endpoint event, and POSTs messages there. Such sessions are labelled legacy SSE.

Initialization

Rustman sends initialize with protocol version 2025-11-25, client info rustman/<version> and the roots, sampling and elicitation capabilities, then notifications/initialized. A server answering with an older supported version (2024-11-05, 2025-03-26, 2025-06-18) gets a session in that version; any other version closes the session with mcp: unsupported protocol version <v>.

After initialization the session shows the server name, version and title, the negotiated protocol version, the server’s instructions, and its declared capabilities (tools, resources with subscribe and listChanged, prompts, logging, completions). Operations of capabilities the server does not declare are disabled with a reason such as server does not declare prompts.

Tools

tools/list follows nextCursor until the list is complete (at most 100 pages; more fails with mcp: tools/list returned more than 100 pages) and shows each tool’s name, title, description, annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), input schema and output schema. When the server sends notifications/tools/list_changed, a listed toolset is fetched again.

Argument forms. A tool’s inputSchema becomes a form: typed inputs for strings, numbers, integers and booleans, a picker for enum (and const), nested objects, arrays whose items are added and removed, a variant picker for oneOf/anyOf, required markers, defaults and descriptions. A subtree using any other keyword (patternProperties, $ref, …) is edited as raw JSON, and the raw JSON editor is always available for the whole arguments object.

Validation. Arguments are validated against inputSchema before tools/call is sent (with the same jsonschema engine as the schema assertion), and violations block the call, each named by its JSON pointer:

mcp: invalid arguments: /path: required property missing

--no-validate (CLI) or an explicit confirm (TUI) sends the call anyway; the overridden violations are kept with the result for history.

Results. Each content item is shown by type: text, image and audio (type and size), resource links, and embedded resources (their text, or the size of their blob). structuredContent is shown as JSON. A result with isError: true is labelled tool error; a JSON-RPC error is labelled protocol error <code> (for example protocol error -32602). When the tool declares an outputSchema, structuredContent is validated against it, and each violation (such as /count: expected integer, or /: structuredContent missing) is reported as a warning (and, in rustman run, a failure of the implicit output_schema assertion).

Resources

resources/list and resources/templates/list follow every page. resources/read shows each content item’s URI, MIME type and text, or its base64 blob. Templates are expanded from the parameters you enter (RFC 6570 {var}, {+var} for reserved characters such as /, and {a,b} lists); template file:///{path} with path=README.md reads file:///README.md. When the server declares resources.subscribe, you can subscribe to a resource: its notifications/resources/updated appear in the notifications stream with an offer to read it again.

Prompts and completion

prompts/list follows every page and shows each prompt’s arguments with required markers; prompts/get checks required arguments first (mcp: invalid arguments: /code: required property missing) and shows the returned messages with their roles and content types. When the server declares completions, the forms of prompt arguments and resource-template parameters ask completion/complete as you type, 250 ms after the last keystroke, and offer the returned values.

Notifications, progress and cancellation

Every server notification of a session (log messages with level and logger, progress, list changes, resource updates, cancellations) is kept in a timestamped stream, with secrets redacted. When the server declares logging, you can set its log level (logging/setLevel); messages below the level are no longer sent.

Every request carries a progressToken, and progress notifications update the request’s progress indicator. The notifications received while a request runs are kept with its result (at most 200). A request times out after 60 seconds by default; timeout_ms on the server definition, or on a request file, changes that. On timeout Rustman sends notifications/cancelled and the request fails with mcp: request timed out after 60s; cancelling it yourself sends the same notification and ends it with cancelled by user.

Server-initiated requests

A server may ask the client to sample an LLM (sampling/createMessage) or to ask you something (elicitation/create). Rustman never answers either on your behalf:

  • Sampling. The TUI shows the full messages, system prompt, model preferences and max tokens, and nothing is returned until you reject the request or type (or edit) the response. A pending request shows a badge until it is handled. Headless commands reject it with JSON-RPC error -1 User rejected sampling request and print a warning naming the request, unless --sampling-response <file> gives a canned answer: a JSON CreateMessageResult such as {"role": "assistant", "content": {"type": "text", "text": "..."}, "model": "human"}.
  • Elicitation. The TUI shows the server’s message and a form generated from requestedSchema; you choose accept (with content that passes the schema, formats such as email included), decline or cancel. Headless commands decline and print a warning.

There is no setting that approves these requests automatically.

Roots. Rustman declares the roots capability and answers roots/list with the definition’s roots as file:// URIs: {{workspace}} is the workspace root, relative paths are taken from it, and file:// URIs are kept. Without roots, the answer is exactly the workspace root. Changing the roots during a session sends notifications/roots/list_changed.

OAuth

When an HTTP server without auth answers 401, Rustman logs in with OAuth 2.1:

  1. It reads the protected resource metadata (RFC 9728) named by the resource_metadata parameter of the WWW-Authenticate challenge (or at /.well-known/oauth-protected-resource), then the metadata of its authorization server (RFC 8414, with the OpenID Connect discovery URL as fallback). The advertised resource must be the server URL or a parent of it on the same origin, and the authorization server’s issuer the URL it was looked up for; otherwise the login stops before the browser opens (mcp: oauth: the protected resource <resource> does not match the server URL <url>), so a server cannot obtain a token meant for another API. The issuer and the authorization, token and registration endpoints must use https (http only on a loopback host such as 127.0.0.1 or localhost); any other URL stops the login before anything is opened or sent (mcp: oauth: refusing OAuth URL <url>: it must use https (http only on a loopback host)), so a server cannot have your browser handler open a file: or custom-scheme URL, or have a code or client secret sent in plain text.
  2. It registers itself as a public client when the authorization server offers dynamic client registration (RFC 7591); otherwise it uses the definition’s oauth.client_id. With neither, the connection fails with mcp: oauth requires client_id for <server>.
  3. It opens the authorization URL in your browser (and prints it) with PKCE (code_challenge_method=S256), the resource parameter naming the MCP server (RFC 8707) and the scopes (oauth.scopes, else the ones the resource advertises), and waits for the redirect on a loopback listener (http://127.0.0.1:<port>/callback). When the browser cannot reach it (over SSH, say), paste the URL the browser was redirected to.
  4. It exchanges the code for tokens and retries the connection.
[mcp_servers.remote]
url = "https://mcp.example.com/mcp"
oauth = { client_id = "rustman-cli", scopes = ["mcp:read"] }

Tokens are stored only in the OS keychain (or, without one, in the git-ignored .rustman/secrets.yaml), under mcp/<hash of the server name and URL>, together with the token endpoint and client, so an expired access token is refreshed with its refresh token without opening the browser. A failed refresh drops the tokens and the next 401 starts a new login. Token values (and a client secret) are redacted from everything the session shows, and the Authorization header is always shown as «redacted:Authorization». rustman mcp-client logout <server> deletes them. Headless commands cannot log in: a server that needs a login fails until you connect once from a terminal.

Request files

A request file with kind: mcp saves an MCP call so it can be replayed and asserted on in CI:

version: 1
kind: mcp
name: Search for rust
server: files                  # a server of the workspace
operation: tools/call
params:
  name: search
  arguments:
    q: rust
    token: "{{api_token}}"     # string values are interpolated
timeout: 30s                   # optional: replaces the server's timeout
validate: false                # optional: send arguments that break inputSchema
assertions:
  - is_error: false
  - content_text_contains: found
  - structured: {path: $.count, gt: 0}
captures:
  - {var: count, from: json, path: $.count}
FieldMeaning
serverThe name of a server the workspace defines.
operationtools/list, tools/call, resources/list, resources/read, prompts/list or prompts/get.
paramsname and arguments for tools/call and prompts/get, uri for resources/read. String values support {{variable}} interpolation; keys and other values are kept as written. A missing name or uri fails to load with mcp: tools/call requires params.name (a string).
timeoutThe request timeout (500ms, 30s, 2m), above the server’s timeout_ms.
validatefalse sends tool arguments that break inputSchema (recorded in history).
variablesVariables of this request, as in kind: http.
assertions, capturesSee below.

The TUI saves the current call as such a file (see the inspector); a saved call is written field by field, and a loaded file keeps its own text.

Assertions and captures

Besides latency and the generic json, body and schema checks (which read the MCP result as JSON), mcp requests have their own assertions:

AssertionPasses when
is_error: true / falseThe tool result has (or has not) isError: true.
content_text_contains: <text>Some text content item (or embedded text resource) contains the text.
structured: {path, <op>: value}A JSONPath check rooted at structuredContent: $.count is structuredContent.count.
output_schema: truestructuredContent matches the tool’s outputSchema. Implicit for every tool that declares one; write output_schema: false to expect a violation.
tool_exists: <name>A tools/list result has the tool. A failure lists the available tools: tool_exists: expected a tool named "search", got available tools: read, write.

A snapshot assertion compares the MCP result (the JSON the server answered, with no status or headers) with a stored snapshot, recorded under __snapshots__/ like those of HTTP requests.

Expected values support {{variable}} interpolation. Captures read structuredContent when the result has it, else the text content: from: json with $.count reads structuredContent.count (or the text, when it is JSON), and from: body_regex reads the text. For resources/read they read the text contents; for the list operations, the result JSON.

In rustman run

rustman run executes kind: mcp files in collection order with the other kinds. All mcp requests of a run that target the same server share one session: it is initialized once (a stdio server is spawned once) and shut down at the end of the run. Runs are headless: an untrusted stdio server makes its requests error with mcp: server <name> is not trusted; review it or pass --trust unless rustman run --trust is given, sampling is rejected and elicitation declined (each with a warning on the request), and an OAuth login is only possible from a terminal.

A connection, protocol, validation or timeout error marks the request errored; failed assertions mark it failed, as for HTTP requests.

Sending a kind: mcp file from the TUI workbench (Ctrl+Enter on an open file) runs it the same way, with one session for that send: a stdio server must have been approved first (in the inspector, or with --trust), and OAuth uses the tokens already stored. The agent MCP server’s execution tools (send_request, run_collection; see Agents) do not connect to other MCP servers: they skip kind: mcp requests as an unsupported kind, so an agent cannot spawn workspace commands through them.

History

Every MCP operation of a run is recorded in request history. The entry’s request is the method (such as tools/call), the server’s URL (or stdio:<command line>), its headers (credentials such as Authorization stored as «redacted:Authorization») and the params; its record adds an mcp object:

{
  "server": "files",
  "transport": "stdio",
  "protocol_version": "2025-11-25",
  "method": "tools/call",
  "params": {"name": "search", "arguments": {"q": "rust", "token": "«redacted:api_token»"}},
  "result": {"content": [{"type": "text", "text": "found 3 files"}], "isError": false},
  "outcome": "ok",
  "duration_ms": 12.5,
  "notification_count": 5,
  "notifications": [{"at": 1763460000000, "type": "progress", "token": "1", "progress": 20.0, "total": null, "message": null}]
}

outcome is ok, tool error, protocol error <code>, cancelled or error; error holds the message when there is no result. At most 200 notifications are kept (notification_count counts them all), and validation_override lists input violations sent anyway. Params, results, notifications and errors are redacted with every secret of the run and the session’s OAuth tokens. MCP entries cannot be replayed with rustman history replay.

rustman mcp-client

rustman mcp-client tools <server> [--json]
rustman mcp-client call <server> <tool> [--args <json> | --arg k=v | --arg k:=<json>]... [--no-validate]
                                        [--sampling-response <file>] [--json]
rustman mcp-client resources <server> [--read <uri>] [--json]
rustman mcp-client prompts <server> [--get <name> [--arg k=v]...] [--json]
rustman mcp-client logout <server>

<server> is a server of the workspace, stdio:<command line> (split like a shell: stdio:npx -y @modelcontextprotocol/server-everything), or an http:// / https:// URL. A command line typed after stdio: is your own, so it runs without a trust prompt and nothing is recorded; a workspace server needs this machine’s trust or --trust. Ad-hoc servers work outside a workspace too.

FlagEffect
--jsonPrint the MCP result as JSON instead of text.
--trustApprove (and record) an untrusted stdio server of the workspace.
--timeout <duration>The request timeout, initialize included (default: the server’s timeout_ms, else 60s).
--env <name>The environment whose variables and secrets fill the server definition.
--args <json>call: the arguments as one JSON object.
--arg k=vcall: a string argument; --arg k:=<json> gives any JSON value (--arg limit:=10). prompts --get: a prompt argument.
--no-validatecall: send arguments that break the tool’s inputSchema.
--sampling-response <file>call: answer sampling requests with this CreateMessageResult instead of rejecting them.

The text output lists one tool per line with its annotations (search [read-only]) and description, one resource per line (file:///notes.md notes text/markdown), prompts with their arguments (review (code*), * marks required ones), a tool result’s content items and structuredContent (with tool error first for an isError result and warning: outputSchema: ... lines for violations), and a prompt’s messages as role: content.

Exit codeWhen
0The operation succeeded.
1The tool returned isError: true (its content is printed), or the server answered with a JSON-RPC error (error: mcp: protocol error -32602: ...).
2A usage, definition or trust problem: an unknown server, invalid arguments, a server that is not trusted.
3The server could not be started or reached, failed, or did not answer in time.
130Interrupted with Ctrl+C (on Unix also SIGTERM or SIGHUP): the request in flight is cancelled (notifications/cancelled) and the server is stopped with every process it started, after its 5-second grace period. A second Ctrl+C quits at once, still killing the server’s processes first.
rustman mcp-client tools https://mcp.example.com/mcp --json
rustman mcp-client call files read --arg path=missing     # prints the content, exits 1
rustman mcp-client resources files --read file:///README.md
rustman mcp-client prompts files --get review --arg code='fn main() {}'

The TUI MCP inspector

Alt+I (or MCP inspector in the command palette) opens the inspector in place of the request and response panes; Esc or Alt+I hides it, and the session keeps running.

  • Servers. The left column lists the workspace’s servers with their transport and status (○ idle, … connecting, ● connected, ✗ failed). Enter connects; d disconnects. A stdio server that is not trusted yet shows its full command line, working directory and env variables (KEY=value, the values of secrets and of variables named like one, such as API_TOKEN, redacted) first, and nothing runs until you press y (which records the approval in .rustman/trust.yaml); n cancels. An HTTP server that asks for OAuth opens the authorization URL in your browser and shows it in a toast; the session connects once the browser reaches the loopback redirect, and the tokens are kept in the workspace’s secret store as for rustman mcp-client.
  • Session. The title shows the server name and version, the transport and the negotiated protocol version; the first line lists the declared capabilities. Tabs 1-5 switch between Tools, Resources, Prompts, Notifications and Stderr; a tab whose capability is not declared shows the reason, such as server does not declare prompts. Tab moves the focus between the servers, the list and the form.
  • Forms. Enter on a tool opens the form generated from its inputSchema: one row per property with its type, a * for required ones and the description below. Type into text, number and JSON rows, toggle booleans with Space, and pick enum values with ←/→ (exactly the values the schema lists). Ctrl+J swaps the rows for the raw JSON editor and back. Enter sends the call; arguments that break the schema are refused with each violation, and Ctrl+O sends them anyway (the override is recorded). Prompts open a form of their arguments; Enter on a resource reads it, and on a template opens a form of its variables.
  • Results. The result view shows the call, its label (ok, tool error, protocol error <code>, cancelled), each content item, structuredContent and outputSchema warnings. A call in flight shows its progress in the top line; Ctrl+C cancels it (notifications/cancelled). Ctrl+S saves the last call as a kind: mcp request file in the workspace.
  • Notifications and stderr. The Notifications tab is the timestamped stream; l cycles the server log level (debug, info, warning, error), s on a resource subscribes to it, and r reads again the resource a notifications/resources/updated offered. Stderr shows the stdio server’s stderr log.
  • Approvals. A sampling request opens a dialog with its messages, system prompt, model preferences and max tokens: type the response and press Ctrl+S to send it, or Ctrl+R / Esc to reject. An elicitation shows the server’s message and a form from its requested schema: Ctrl+S accepts (only with content that passes the schema), Ctrl+D declines and Esc cancels. Until a request is handled, the status bar shows MCP APPROVAL (<n>) on every screen.

The reference-server contract test (crates/rustman-mcp/tests/client_everything.rs) runs the client against @modelcontextprotocol/server-everything; it is ignored by default and runs with cargo test -p rustman-mcp --test client_everything -- --ignored when RUSTMAN_MCP_EVERYTHING points at its dist/index.js. CI installs the package in the mcp-reference-server job.

Mock server

rustman mock serve serves an OpenAPI 3.0 or 3.1 document as a local HTTP mock. Each operation becomes a route, and responses come from the document’s examples or from data synthesized from its schemas. You can build a client before the backend exists, or ask for the error responses that are hard to get from a real one.

The mock is a development tool, not a security boundary. It binds to loopback by default.

The TUI runs the same server in its mock server pane (Alt+O).

The behavior is specified in openspec/specs/mock-server.

Starting the mock

$ rustman mock serve petstore.yaml
mock: serving 19 operations on http://127.0.0.1:4010

The mock speaks HTTP/1.1 (with keep-alive) and h2c (HTTP/2 without TLS) on the same port. It runs until Ctrl+C. Then it stops accepting connections, gives the requests in flight up to 5 seconds to finish, and exits with code 130.

FlagEffect
<OPENAPI>The document: a file or an http(s) URL.
--host <HOST>Address to bind: an IP address or localhost (default: [mock] host in rustman.toml, else 127.0.0.1).
--port <PORT>Port to bind (default: [mock] port, else 4010). 0 picks a free port, and the banner shows it.
--allow-remoteRequired to bind an address reachable from the network, such as 0.0.0.0 or a LAN IP.
--allow-remote-refsFetch $refs that point at other http(s) documents. Without it they are refused, as in rustman import openapi.
--seed <N>Seed of synthesized bodies (default: [mock] seed, else 0). See Synthesized data.
--no-preferIgnore the Prefer request header.
--no-validateSkip request validation.
--enforce-securityAnswer 401 to requests without the credentials their operation declares. See Security.
--statefulBack resources with an in-memory store. See Stateful mode.
--env <NAME>The environment whose secrets hold the [mock.security] expected values, and that receives the secrets --record moves out of recorded requests (default: RUSTMAN_ENV, else the workspace default).
--workspace <DIR>The workspace whose rustman.toml holds [mock]. Without it the workspace is searched from the current directory upwards. Outside a workspace the defaults apply.
--cors, --no-corsTurn CORS on or off (default: on for a loopback bind, off otherwise).
--jsonlWrite the request log as JSON lines on stdout; the banner goes to stderr.
--historyAlso record each exchange in history, tagged mock.
--proxy-unmatched <URL>Forward requests that nothing matches to this upstream. See Proxy and record.
--record <DIR>Save each proxied exchange as a request file in DIR (needs --proxy-unmatched and a workspace).

Settings can live in the workspace. The flags win over these:

[mock]
host = "127.0.0.1"
port = 4011
seed = 7
max_body_bytes = 10485760   # 413 past it
max_headers = 100           # 431 past it
max_header_bytes = 65536    # 431 past it
dir = "mocks"               # the hand-written overrides
delay_ms = 0                # delay of every response without an override delay
jitter_ms = 0               # uniform ± range around delay_ms
max_items = 10000           # stateful items per resource (507 past it)
max_store_bytes = 67108864  # stateful JSON in all resources together (507 past it)

[mock.security]
bearerAuth = "{{api_token}}"   # expected value of a security scheme, from an environment secret

Start-up errors

Every start-up failure exits with code 2 before anything is served.

A port that cannot be bound:

$ rustman mock serve petstore.yaml
error: mock: cannot bind 127.0.0.1:4010: address in use

An address reachable from the network, without --allow-remote:

$ rustman mock serve petstore.yaml --host 0.0.0.0
error: mock: binding 0.0.0.0 exposes the mock to the network; pass --allow-remote

With --allow-remote, the mock starts and prints a warning on stderr.

A document that is not valid. The document is read by the same parser as rustman import openapi, with the same versions, $ref rules and diagnostics. Each error names the JSON pointer of the problem:

$ rustman mock serve api.yaml
error: /paths/~1a/get/responses/200/content/application~1json/schema/$ref: unresolved reference '#/components/schemas/Nope'

Routing

Each path and method of the document is a route.

  • Path parameters. A template such as /users/{id} matches one segment per parameter. Literal text around a parameter, as in /files/{name}.json, must match too. Parameter values are percent-decoded.
  • Literal segments win. When several paths match, the one with more literal segments wins, then the one earlier in the document. GET /users/me goes to /users/me, not /users/{id}, in whatever order the document lists them.
  • Base paths. The path of each servers URL (with its variables at their defaults) is stripped from the request first. With servers: [{url: https://api.example.com/v1}], both /v1/pets and /pets reach /pets.
  • 404. A path that matches nothing gets 404.
  • 405. A path that exists without the request’s method gets 405 with an Allow header listing the declared methods, such as Allow: GET, POST.

Errors

Every error the mock generates itself is application/problem+json (RFC 9457) with type, title, status and detail:

{
  "type": "urn:rustman:mock:no-matching-operation",
  "title": "No matching operation",
  "status": 404,
  "detail": "GET /nope matches no operation of the document"
}
Statustype (after urn:rustman:mock:)When
400undocumented-code, unknown-examplePrefer asks for a status or example the operation does not document. The detail lists the documented ones.
400malformed-requestThe body could not be read.
400invalid-parametersA path, query, header or cookie parameter is missing or invalid.
401unauthorizedWith --enforce-security, the credentials are missing or do not match.
404no-matching-operationNo path matches.
404unknown-idStateful mode: no item has that id.
404reserved-pathA path under /__rustman/ other than POST /__rustman/reset.
405method-not-allowedThe path does not declare the method.
406not-acceptableAccept matches none of the documented media types.
408request-timeoutThe body did not arrive within 30 seconds.
413body-too-largeThe body is over the limit.
415unsupported-media-typeThe body’s Content-Type is not documented for the operation.
422invalid-bodyThe body is not valid JSON or does not match its schema.
431header-fields-too-largeToo many header fields, or too many header bytes.
507store-fullStateful mode: the resource already holds max_items items.
anyinjected-faultAn override’s fault.error_rate picked this request.

Validation errors add an errors array, with one entry per violation (up to 20):

{
  "type": "urn:rustman:mock:invalid-parameters",
  "title": "Invalid request parameters",
  "status": 400,
  "detail": "1 violation of the operation's schema",
  "errors": [{"location": "query", "pointer": "/q", "message": "required"}]
}

Choosing the response

A request first passes security (with --enforce-security) and validation. Then the response is chosen in this order:

  1. A matching override. Overrides also answer paths the document does not have.
  2. The stateful store, with --stateful, for operations on a resource. Prefer does not apply to these operations.
  3. The Prefer header, when the request sends one (see below).
  4. The lowest documented 2xx. A 2XX range counts as 200. Without any 2xx, default is used and sent as 200. An operation that documents only errors gets its lowest one.

The response’s media type is then negotiated from Accept, and the body is taken, in order, from:

  1. the first named example (examples) of that media type;
  2. the media type’s example;
  3. the schema’s examples or example;
  4. data synthesized from the schema.

A response without content is sent with an empty body and no Content-Type. A JSON media type is sent as compact JSON. A string example of another media type, such as text/plain, is sent as is.

The Prefer header

The Prefer header is compatible with Prism:

PreferenceEffect
code=<status>Answer with that status. It must be documented exactly, by its range (4XX) or by default. Otherwise the answer is 400, listing the documented codes.
example=<name>Use that named example of the chosen response. An unknown name gets 400, listing the documented names.
dynamic=trueSynthesize the body from the schema, even when examples exist.

Preferences are separated by commas or semicolons, and can be combined:

$ curl -i http://127.0.0.1:4010/pets/1 -H 'Prefer: code=404, example=notFound'
HTTP/1.1 404 Not Found
content-type: application/json

{"error":"no such pet"}

--no-prefer makes the mock ignore the header.

Content negotiation

Without an Accept header, or with only */*, the first JSON media type of the response is used (application/json or any +json type), else the first one. Otherwise the documented media type that the highest-quality Accept range covers wins. Ranges such as application/* work in both directions. When nothing is acceptable, the answer is 406.

Synthesized data

When there is no example, the body is synthesized from the schema by the same synthesizer as rustman import openapi. It fills the required properties (all properties when none is required) and honors type, format, pattern, enum, const, length, item-count and numeric bounds. A string with a pattern its plain sample does not match is generated from the regular expression (\d, \w, \s and . with their ASCII meaning). Past three levels of nesting only required properties and minItems items are filled, so circular schemas stay small; a schema whose required properties recurse without end has no finite instance and is cut at ten levels.

Synthesis is seeded. The seed combines --seed (default 0), the operation and the request path. So the same request always gets the same body, whatever the order of calls, and another seed gives other data:

  • free-form strings get a suffix, such as string-3fa2c1;
  • numbers move up inside their bounds and stay on multipleOf;
  • booleans flip.

Strings with a format, and values the schema documents (const, enum, default, examples), stay as they are; strings with a pattern are generated from the seed. A synthesized body validates against its schema, except where the schema cannot be satisfied (endless required recursion, contradictory bounds) or uses a regular expression the generator does not support (look-around, back-references), where the plain sample is kept.

Request validation

By default every request is checked against its operation before a response is chosen:

  • Parameters → 400. Required path, query, header and cookie parameters must be present. Their text is read as the schema’s type (integer, number, boolean, or an array written as a,b or as repeated query parameters) and validated against the schema.
  • Media type → 415. A body must have a Content-Type that the operation documents (ranges such as application/* count).
  • Body → 422. A JSON body must parse and match its schema. A required body must not be empty.

The schemas are those of rustman import openapi: OpenAPI 3.0 schemas are converted to JSON Schema 2020-12 (nullable, boolean exclusiveMinimum) and validated by the same engine as schema: assertions. Every violation is listed, up to 20: missing required properties, then the first violation of each property, then the first of the body as a whole. Bodies of non-JSON media types are only checked for their media type.

--no-validate turns validation off.

Security

Credentials are not checked by default. With --enforce-security, a request must carry the credentials of one alternative of its operation’s security requirement (the operation’s own security, else the document’s). Otherwise the answer is 401 with a WWW-Authenticate header for each scheme involved:

SchemeCredentialWWW-Authenticate
http bearer, oauth2, openIdConnectAuthorization: Bearer <token>Bearer
http basicAuthorization: Basic <base64 of user:password>Basic realm="rustman-mock"
apiKeythe named header, query parameter or cookieApiKey name="...", in="..."
$ curl -i http://127.0.0.1:4010/users
HTTP/1.1 401 Unauthorized
www-authenticate: Bearer
content-type: application/problem+json

Any value is accepted unless [mock.security] names an expected one for the scheme. Each expected value is a {{variable}} read from the active environment’s secrets (never a literal in rustman.toml); for basic it is user:password. Values are compared in constant time and never appear in responses.

Overrides

Hand-written overrides live in *.rman-mock.yaml files in the mocks/ directory of the workspace (or of the current directory outside a workspace; [mock] dir changes it). Files are read in name order and overrides in declaration order. The first override that matches answers, even for paths the document does not have:

overrides:
  - name: big payment               # optional
    match:
      method: POST                  # default: any method
      path: /payments               # exact, a template (/users/{id}) or a glob (* within a segment, ** across)
      query: {currency: EUR}        # each pair must be present
      headers: {X-Tenant: acme}     # names in any case
      body:                         # JSONPath conditions on a JSON body, all must hold
        $.amount: {gt: 10000}
    respond:
      status: 402                   # default 200
      headers: {X-Mock: "1"}
      body: {error: "over the limit"}
  - match: {method: GET, path: /health}
    respond: {body: '{"ok":true}'}
ConditionHolds when the first node the JSONPath selects
a bare value, or eq: <value>equals the value
ne: <value>differs from it (or is absent)
gt, gte, lt, lteis a number past the bound
contains: <text>is a string containing the text, or an array holding it
exists: true / falseis present / absent

respond.body can be a structure (sent as JSON), a string (sent as JSON when it parses, else as text), or body_file: <path> relative to the mock file, inside its directory and at most 10 MiB. Content-Type follows from the body unless respond.headers sets it. Framing and hop-by-hop headers (Content-Length, Transfer-Encoding, Connection…) cannot be set.

Requests to documented operations are checked for security and validated before overrides are tried. An invalid mock file stops start-up with exit code 2 and its file name, line and override number.

Response templates

Override bodies (including body_file text) and header values can use request data:

TemplateValue
{{request.path.<name>}}a path parameter of the override’s template, or of the matched operation
{{request.query.<name>}}the first value of a query parameter
{{request.header.<name>}}a header (any case)
{{request.body.<JSONPath>}}the first node of the JSON body, such as {{request.body.$.user.name}}
{{$uuid}}, {{$timestamp}}, {{$randomInt}}…the dynamic variables of environments, except {{$env}}
overrides:
  - match: {method: GET, path: '/users/{id}'}
    respond:
      body: {id: "{{request.path.id}}"}   # GET /users/42 → {"id":"42"}

A reference that does not resolve renders as an empty string and is logged as a warning on stderr. Templates only substitute; there is no logic.

Latency and faults

overrides:
  - match: {path: /slow}
    delay_ms: 2000          # before the response headers
    jitter_ms: 500          # uniform ± range; both at most 60000
  - match: {path: /flaky}
    fault: {error_rate: 0.2, status: 503}   # 20% of requests get a 503 problem+json (default status 500)
  - match: {path: /gone}
    fault: {drop_connection: true}          # close the connection without a response
  - match: {path: /trickle}
    fault: {slow_body_bps: 100}             # stream the body at 100 bytes per second

[mock] delay_ms and jitter_ms delay every response that has no override delay.

Delays and faults are random but reproducible: each route (an override’s name, else its file and position) has its own sequence, seeded by --seed and advanced per request. The same seed and the same requests to a route give the same delays and faults, whatever other routes receive meanwhile.

Stateful mode

With --stateful, resources are backed by an in-memory store. Resources are found like the explorer’s dependency discovery: a POST collection (/users) whose response holds the id that the item path’s parameter (/users/{id}) takes.

RequestEffect
POST /usersStores the body with a new id and answers with it and the documented creation status.
GET /usersLists the stored items, when the documented response is an array.
GET /users/{id}The stored item, else 404.
PUT /users/{id}Replaces the item (keeping its id), else 404.
PATCH /users/{id}Merges the body into the item (JSON merge patch), else 404.
DELETE /users/{id}Removes the item, else 404.

New ids follow the id’s schema: format: uuid gives a UUIDv4 drawn from the seed, integer counts from 1, anything else counts as text ("1"). Each resource holds at most 10000 items ([mock] max_items), and all resources together at most 64 MiB of JSON ([mock] max_store_bytes); a create, replace or patch past either limit gets 507.

POST /__rustman/reset clears the store and answers 204. Every path under /__rustman/ is reserved for the mock and never routed to the document. The store lives in memory only and is lost when the mock stops.

Request limits

The mock enforces the same defaults as the webhook inspector. Each limit can be changed under [mock].

LimitDefaultOver it
Request body (max_body_bytes)10 MiB413. A declared Content-Length past the limit is refused before the body is read.
Header fields (max_headers)100431
Header bytes (max_header_bytes)64 KiB431

Requests far past the header limits (more than twice the limit) are refused by the HTTP layer itself with a plain 431. Malformed requests get 400. On HTTP/1.1, a refused request also closes the connection.

CORS

CORS is on by default when the mock is bound to loopback, so a browser app on another local port (a Vite dev server on http://localhost:5173, say) can call it. It is off for any other bind. --cors and --no-cors override the default.

When CORS is on:

  • A preflight (OPTIONS with Origin and Access-Control-Request-Method) is answered 204 before routing, security and validation run. Access-Control-Allow-Origin echoes the request’s Origin, Access-Control-Allow-Methods lists the methods the document declares for the path (the requested method for a path it lacks), and Access-Control-Allow-Headers echoes Access-Control-Request-Headers.
  • Every other response to a request with an Origin echoes it in Access-Control-Allow-Origin, with Access-Control-Expose-Headers: * and Vary: Origin. Credentials are never allowed (no Access-Control-Allow-Credentials), and responses forwarded by --proxy-unmatched get no CORS headers, so a web page cannot read the upstream through the mock.

With --no-cors, an OPTIONS request is routed like any other (usually 405, unless the document declares options).

Request log

Every request is logged once its response is sent, with:

FieldMeaning
timeWhen it arrived, RFC 3339 UTC.
method, pathThe request line; the path keeps its query.
operationThe matched operation’s operationId (else METHOD /template).
overrideThe name of the override that answered, if one did.
statusThe response status; null when a fault dropped the connection.
sourceWhere the response came from: override, prefer, example, synthesized, stateful, proxy, cors (a preflight) or error (an error the mock made itself, including injected faults).
errorsThe validation errors (location pointer: message), the detail of other errors, and unresolved template references.
duration_msTime from the request head to the response head.
headersThe request headers.

By default each entry is one line on stderr:

2026-11-18T10:15:30.125Z GET /pets/1 -> 200 example (getPet) 0.4 ms
2026-11-18T10:15:31.002Z POST /pets -> 422 error (createPet) 0.3 ms [body /name: 5 is not of type "string"]

With --jsonl, each entry is one JSON object on stdout (and the banner moves to stderr, so stdout holds only entries):

{"time":"2026-11-18T10:15:30.125Z","method":"GET","path":"/pets/1","operation":"getPet","status":200,"source":"example","duration_ms":0.4,"headers":[{"name":"authorization","value":"«redacted:Authorization»"}]}

Entries are redacted before they are written: credential headers (Authorization, Cookie, the headers the document’s apiKey schemes name, and names like X-Api-Key, X-Auth-Token or Client-Secret) always show as «redacted:<header>»; credential query parameters (the apiKey ones, and names like api_key, token or key) show as api_key=«redacted:api_key»; and the values of both, and the expected values of [mock.security], are replaced wherever else they appear. Entries are written on their own thread, so a slow reader of the output never holds up the server; when it falls more than 1024 entries behind, the skipped count is reported on stderr.

History

With --history, each exchange is also recorded in history, after the same redaction. In a workspace it goes to the workspace’s history, otherwise to the ad-hoc one, subject to the usual retention limits. The entries carry "request": "mock" (rustman history list --json shows it), the request as received, the status and the duration, and record.mock holds the source, the operation, the override and the errors. They cannot be replayed with rustman history replay.

Hot reload

The mock watches the document (when it is a file) and the mocks directory. About 200 ms after the last change it reads both again and serves the new version from the next request on:

mock: reloaded: 20 operations, 3 overrides

Requests in flight finish with the version they started with, and the stateful store is kept. If the new version does not load (invalid YAML, a dangling $ref, an invalid mock file), the previous one keeps being served and the error is logged with its file and location:

mock: reload failed, still serving the previous version: api.yaml: invalid YAML at line 4: unclosed bracket '['

Proxy and record

--proxy-unmatched <URL> forwards every request that matches no operation and no override (instead of answering 404 or 405) to that upstream, through the HTTP engine. The request path and query are appended to the URL (--proxy-unmatched https://staging.example.com sends GET /legacy/report to https://staging.example.com/legacy/report). The URL may carry a base path but no query.

The request is sent with the header hygiene of webhook replay: hop-by-hop headers, the headers Connection names, Host, Content-Length and Transfer-Encoding are dropped, as is Proxy-Authorization (it is meant for the mock, never forwarded or recorded), and the engine sets the framing for the upstream. The upstream’s response is returned as it came (status, headers, body; compressed bodies stay compressed), without its own hop-by-hop and framing headers. Redirects are returned to the client, never followed, so the upstream’s origin is the only one contacted. An upstream that cannot be reached gets 502 problem+json. The request log marks forwarded requests proxy.

--record <DIR> saves each proxied exchange as a kind: http request file in DIR, which must be inside the workspace. The exchange goes through the same pipeline as a HAR import: the file is named after the method and path (recorded/get-legacy-report.rman.yaml), a different request with the same name gets the next free suffix (get-legacy-report-2.rman.yaml), the same request is recorded once, and credentials (an Authorization token, an API key header) are moved to secrets of the active environment (--env, else RUSTMAN_ENV, else the workspace default; a new environments/recorded.yaml without one), leaving a {{placeholder}} in the file:

kind: http
name: GET /legacy/report
method: GET
url: https://staging.example.com/legacy/report
headers:
  - name: authorization
    value: Bearer {{authorization_token}}

Each saved file is reported on stderr (mock: recorded recorded/get-legacy-report.rman.yaml).

Self-check against the explorer

A mock of a valid document is a consistent exploration target: the explorer’s conformance probes find nothing against it. CI checks this for fixtures/petstore.yaml:

rustman mock serve fixtures/petstore.yaml --port 4010 &
rustman explore run --spec fixtures/petstore.yaml --target http://127.0.0.1:4010 \
  --probes conformance --fail-on info --env ci --allow-destructive

The ci environment gives the security schemes’ variables (bearerAuth_token, apiKey_key) any value, since the mock does not check credentials by default. The exploration reports zero findings and exits with code 0.

Webhook inspector

rustman webhook listen runs a local HTTP listener that captures every inbound request (any method, any path), answers it with a default acknowledgement or a mock you configure, and prints an event log. It is meant for testing webhook producers (GitHub, Stripe, your own services) without a third-party service; pair it with your own tunnel if the producer is on the internet.

The behavior is specified in openspec/specs/webhook-inspector.

Starting the listener

$ rustman webhook listen
Listening on http://127.0.0.1:9090
#1 POST /hooks/github from 127.0.0.1:53114 (1832 B) -> 200
FlagEffect
--host <HOST>Address to bind: an IP address or localhost (default: [webhook] host in rustman.toml, else 127.0.0.1).
--port <PORT>Port to bind (default: [webhook] port, else 9090); 0 picks a free port and the banner shows it.
--allow-remoteRequired to bind an address reachable from the network, such as 0.0.0.0 or a LAN IP.
--max-body <BYTES>Largest accepted body (default 10485760, 10 MiB); larger bodies get 413.
--max-captures <N>Exit with code 0 once N requests were captured. Events already queued for the last capture (its mock match) are still printed, and the replies in flight are still sent (for up to 65 s) before the process exits.
--jsonlPrint one JSON object per line per event, flushed at once; the banner and warnings go to stderr, so stdout holds only events.
--workspace <DIR>The workspace whose webhook/mocks.yaml answers requests. Without it the workspace is searched from the current directory upwards; outside a workspace every request gets the default reply.
--env <NAME>The environment whose secrets the signature verifiers use (default: RUSTMAN_ENV, then [defaults] default_environment).

The bind address can live in the workspace:

[webhook]
host = "127.0.0.1"   # the flags win over these
port = 9191

A port that cannot be bound stops the command with exit code 2:

$ rustman webhook listen
error: webhook: cannot bind 127.0.0.1:9090: address in use

Binding a non-loopback address without --allow-remote is refused, and with it a warning stays on stderr:

$ rustman webhook listen --host 0.0.0.0
error: webhook: binding 0.0.0.0 exposes the listener to the network; pass --allow-remote
$ rustman webhook listen --host 0.0.0.0 --allow-remote
Listening on http://0.0.0.0:9090
warning: the webhook listener on 0.0.0.0:9090 is reachable from the network

Ctrl+C stops the listener (exit code 130), even while nothing reads the output. When the output is closed (a pipe whose reader exited), the listener stops as soon as the next event cannot be printed, without waiting for replies in flight, and exits with code 0. Captures live in memory only; they are gone when the listener stops.

Printing never holds up the listener: when the output is read slower than events arrive (a paused | less, a slow | jq), requests are still answered, at most 256 events (32 MiB of bodies) wait to be printed, and the rest are dropped with warning: N events not shown (output too slow) on stderr once the output moves again. rustman webhook listen keeps no capture buffer of its own: it only prints events.

HTTP handling and limits

The listener speaks HTTP/1.1 (including chunked bodies) and HTTP/2 over cleartext with prior knowledge, through hyper; nothing is parsed by hand. Each HTTP/1 connection carries one request: the response closes it, as most webhook senders expect.

Requests that break a rule are answered with an error, are not captured, and appear on the event log with the client address, the status and the reason:

RuleDefaultResponse
Malformed request line or head, conflicting Content-Length values, or Transfer-Encoding together with Content-Length400
Header fields per request100431 (too many header fields)
Bytes of header fields per request64 KiB431 (header fields too large)
Body size, declared (Content-Length) or streamed10 MiB413, before the body is read or as soon as the limit is passed; the connection is closed
Time to receive the request head, counted from the connection10 s408 when part of a head arrived; a connection that sent nothing (or speaks HTTP/2) is closed without a reply or a log line
Time to receive the body30 s408
Idle connection (no request in flight, no traffic)60 sthe connection is closed
Connections served at once256more wait to be accepted (see the note below)
Requests in flight on one HTTP/2 connection16the sender waits (HTTP/2 flow control)
127.0.0.1:53120 rejected 431 too many header fields

Over HTTP/2 the protocol layer itself answers 431, without a log line, to a header list over twice the header-byte limit plus 32 bytes per allowed field (about 131 KiB by default); smaller lists over the limits are refused and logged as above.

Bodies are held in memory while they are received, before the size check can drop them, so the requests in flight bound that memory: up to the body limit per request, which with the defaults is 2.5 GiB over HTTP/1 (256 connections) and in theory 40 GiB over HTTP/2 (16 streams on each). No overall budget caps it; lower --max-body on a machine where that matters.

The listener is a development tool, not a hardened server: a client that opens connections and sends nothing, or a head byte by byte, holds a connection slot until the 10 s head timeout. 256 such connections stall other deliveries for that long, since further connections wait in the operating system’s backlog. Keep the listener on loopback, and use --allow-remote only on networks you trust.

Error responses are JSON, such as {"error":"body larger than 10485760 bytes","status":413}.

Captures

Each capture keeps a sequence id, the receive time (RFC 3339 with the local offset), the client address, the HTTP version, the method, the path and the query string separately, every header field in arrival order with duplicates (names in the sender’s case on HTTP/1; HTTP/2 names are lowercase by protocol), and the body as raw bytes. Nothing is decoded or replaced: a body that is not UTF-8 is kept byte for byte and shown as a hex dump; JSON bodies are shown pretty-printed and form bodies as fields.

Captures are kept in a ring buffer of at most 500 captures and 256 MiB of body bytes: when either bound would be passed, the oldest captures are dropped until both hold (the newest capture is always kept). The buffer’s memory is therefore bounded by the byte budget plus one maximum body. Events (a capture included) are also queued for each front-end, up to 1024 of them: a front-end that falls that far behind can briefly keep evicted captures alive until it catches up, and then misses the oldest events. The TUI and the CLI read events as they arrive, so in practice the queue stays short.

Responses and mocks

Without a matching mock the reply is:

HTTP/1.1 200 OK
content-type: application/json
content-length: 34

{"status":"ok","source":"rustman"}

Mocks live in webhook/mocks.yaml in the workspace. The first mock whose method and path match answers; the request is captured either way.

mocks:
  - method: POST              # or "*" for any method (the default)
    path: /hooks/github       # exact, or a glob: * within one path segment, ** across segments
    status: 500               # default 200
    headers: { X-Mock: "1" }
    body: '{"error":"boom"}'  # or body_file: github-error.json, inside mocks.yaml's directory (at most 10 MiB)
    delay_ms: 2000            # wait before answering; at most 60000
  - path: /hooks/**
    status: 202

The path is matched without the query string. A mock’s reply always carries a correct Content-Length: a mock may not set Content-Length, Transfer-Encoding, Host or a hop-by-hop header (Connection, Keep-Alive, Proxy-Connection, TE, Trailer, Upgrade), and such a mocks file is refused. A body_file must be a relative path that stays inside the directory of mocks.yaml (symlinks included) and be at most 10 MiB.

Changes to any file under webhook/ reload the mocks while the listener runs (after 200 ms of quiet); the next request uses them. A file that does not parse leaves the previous mocks active, and both outcomes are on the event log:

mocks reloaded: 2 active
mocks not reloaded (previous mocks kept): /home/me/api/webhook/mocks.yaml: mock 1: delay_ms 90000 exceeds 60000

Event log

One line per event:

EventLine
Capture#1 POST /hooks/stripe?debug=1 from 127.0.0.1:53114 (2 B) -> 200 (the last number is the status answered), followed by signature: valid (or invalid, missing, expired) when a verifier covers the path
Mock match#1 matched mock POST /hooks/github -> 500 after 2000 ms
Rejection127.0.0.1:53120 rejected 413 body larger than 10485760 bytes
Mock reloadmocks reloaded: 2 active or mocks not reloaded (previous mocks kept): <error>

Printed lines are redacted with the verifier secrets: a sender that echoes a key back (in a path or query) shows «redacted:<name>» instead.

JSON-lines output

With --jsonl every event is one JSON object on its own line, written and flushed as it happens, so a pipe sees it at once:

$ rustman webhook listen --jsonl | jq -c '{path, signature}'
{"path":"/hooks/github","signature":"valid"}

Every object has a type:

typeFields
captureid, ts (RFC 3339 with the local offset), remote, version, method, path, query (or null), status (the status answered), mock (the matching mock’s path pattern, or null), signature (valid, invalid, missing, expired, or null without a verifier), headers ([{"name": ..., "value": ...}] in arrival order, duplicates included), body_size, and body when the body is UTF-8 text or body_base64 when it is not
rejectionremote, status (400, 408, 413, 431), reason
mockid (the capture), method, pattern, status, delay_ms
mocks_reloadedcount
mocks_invalidmessage
{"type":"capture","id":1,"ts":"2026-11-18T10:15:30.125+01:00","remote":"127.0.0.1:53114","version":"HTTP/1.1","method":"POST","path":"/x","query":null,"status":200,"mock":null,"signature":null,"headers":[{"name":"Host","value":"127.0.0.1:9090"},{"name":"Content-Length","value":"2"}],"body_size":2,"body":"{}"}

Values are redacted like the human-readable lines: verifier secrets become «redacted:<name>», and credential headers (Authorization, Cookie, …) show a placeholder instead of their value.

Signature verification

Verifiers in rustman.toml check the signature of every request to a path; the first verifier whose path matches (exact, or a glob with * within a segment and ** across segments) decides. The check runs on the raw body bytes before anything is decoded, and MACs are compared in constant time. The verdict is part of the capture: valid, invalid, missing (no signature header) or, for Stripe, expired.

[[webhook.verifiers]]
path = "/hooks/github"
type = "github"                # X-Hub-Signature-256: sha256=<hex HMAC-SHA256 of the body>
secret = "{{gh_hook}}"

[[webhook.verifiers]]
path = "/hooks/stripe"
type = "stripe"                # Stripe-Signature: t=<unix time>,v1=<hex>[,v1=...]
secret = "{{stripe_whsec}}"
tolerance_s = 300              # optional; timestamps further off are "expired"

[[webhook.verifiers]]
path = "/hooks/shop/**"
type = "hmac"
header = "X-Signature"
algorithm = "sha256"           # sha256 (default), sha1 or sha512
encoding = "base64"            # hex (default) or base64
prefix = ""                    # text before the encoded MAC, e.g. "sha1="
secret = "{{shop_secret}}"
TypeSigned contentHeader
githubthe raw body, HMAC-SHA256X-Hub-Signature-256: sha256=<hex>
stripe<t>.<raw body>, HMAC-SHA256; any v1 may match (key rotation); v0 is ignoredStripe-Signature: t=...,v1=...
hmacthe raw body, with algorithmheader: prefix + the MAC in encoding

A Stripe event whose signature matches but whose t is more than tolerance_s seconds old (300 by default), or more than that far in the future, is expired; a signature that does not match is invalid whatever its age.

secret must be a {{variable}} reference: keys stay out of rustman.toml, which is meant for Git. The variable is read from the active environment (--env, else RUSTMAN_ENV, else the workspace default; in the TUI, the environment shown in the status bar), normally as a secret (secrets: [gh_hook] in environments/local.yaml and rustman secret set gh_hook --env local), or as a plain variable of that environment; never from [variables] in rustman.toml. A secret that is not set stops the listener before it binds:

error: rustman.toml: webhook verifier 1 (/hooks/github): gh_hook: secret not set; run 'rustman secret set gh_hook --env local'

Secret values never enter a capture, the event log, saved files or history.

Replay and save

A capture can be replayed to any URL, saved as a request file or a history entry, or copied as a curl command. rustman_webhook::replay, rustman_webhook::save and rustman_webhook::curl provide these to every front-end; the TUI webhook pane exposes them as actions (r, w, h, y).

Both replay and request files use one header filter, so a capture whose body was edited still replays with correct framing (the Ghostman B1 bug). It removes:

  • Host, Content-Length and Transfer-Encoding, which rustman computes for the new target and body;
  • the hop-by-hop headers Connection, Keep-Alive, Proxy-Connection, TE, Trailer and Upgrade;
  • every header named in a Connection header (Connection: close, X-Trace drops X-Trace).

Every other header is sent in its captured order, duplicates included.

Replay sends the original method, the body bytes (binary bodies byte for byte) and the filtered headers through the same HTTP engine as rustman send, so Host becomes the target’s (https://staging.example.com/hook is sent with Host: staging.example.com). A capture without Content-Type gets text/plain; charset=utf-8 for a text body or application/octet-stream for a binary one. A header value that is not text cannot be replayed and is reported.

Save as request file writes a kind: http file targeting the URL you choose (which may use variables, such as {{api}}/hooks/stripe):

version: 1
kind: http
name: POST /hooks/stripe
description: 'Saved from webhook capture #4 (POST /hooks/stripe?debug=1)'
method: POST
url: '{{api}}/hooks/stripe'
headers:
  - name: Content-Type
    value: application/json
  - name: Stripe-Signature
    value: t=1700000000,v1=5257a869...
body:
  type: json
  content: '{"id":"evt_1","type":"invoice.paid"}'

JSON bodies are kept as JSON text, other text bodies as type: text, and a body that is not UTF-8 is written byte for byte to a file next to the request (stripe.body.bin) that the request sends with type: file. Any {{ in captured text is escaped (\{{) so it is sent literally. Credentials (Authorization, Proxy-Authorization, Cookie, Set-Cookie) are left out and reported, since request files are meant for Git, and a capture holding a verifier secret is refused. Existing files are never replaced.

Save to history records the capture as an inbound entry in .rustman/history/ (request webhook): the method, the path and query, the headers and the text body as received, redacted like every history entry, the status answered, and under record.inbound the capture id, receive time, client address, HTTP version, mock, signature verdict and, for a binary body, body_base64. rustman history list and show display these entries; they are not replayable from history (replay the capture instead).

Agent tool

The agent MCP server registers list_webhook_captures when it is built with webhook inspector support (the default webhook feature of rustman-mcp; a build without it doesn’t list it). It lists the captures saved with save to history, newest first: the history entry id, the capture id, receive time, method, path and query, status answered, client address, HTTP version, mock, signature verdict, headers and body (base64 for a binary body, with a body_ref past the inline limit). Filter with path (text in the path and query, any case), method, verdict (the signature verdict: valid, invalid, missing or expired) and since (an age such as 1h, or an RFC 3339 time), and page with cursor and limit (50 by default).

The agent server runs no listener, and the tool never replays or sends anything: captures still in a listener’s buffer are not visible until saved. Entries were redacted when saved and are redacted again with the session’s secrets on the way out.

Traffic recorder

rustman record runs a local recording proxy. Point an app or a CLI at it and every request it sends is relayed to the real server and recorded, so you can see what the app actually sends. HTTPS stays opaque unless you explicitly include its host and trust a local certificate authority (CA) that Rustman creates for the workspace.

The behavior is specified in openspec/specs/traffic-recorder.

Starting the proxy

$ rustman record
Recording proxy on http://127.0.0.1:8888
export HTTP_PROXY=http://127.0.0.1:8888
export HTTPS_PROXY=http://127.0.0.1:8888
GET http://api.example.test/v1/items 200 14 ms 512 B
TUNNEL www.google.com:443 1834 B up, 5120 B down

Run the printed export lines in another shell (or set the proxy in the app’s settings) to route traffic through the proxy. They are POSIX shell syntax; on Windows use $env:HTTP_PROXY = "http://127.0.0.1:8888" and $env:HTTPS_PROXY = "http://127.0.0.1:8888" in PowerShell, or set HTTP_PROXY=http://127.0.0.1:8888 and set HTTPS_PROXY=http://127.0.0.1:8888 in cmd. Rustman never changes system or browser proxy settings itself. Press Ctrl+C to stop recording; the command then exits with code 0.

FlagEffect
--host <HOST>Address to bind: an IP address or localhost (default: [record] host in rustman.toml, else 127.0.0.1).
--port <PORT>Port to bind (default: [record] port, else 8888); 0 picks a free port and the banner shows it.
--allow-remoteRequired to bind an address reachable from the network, such as 0.0.0.0. A warning is printed: anyone who can reach the port can use the proxy and see intercepted traffic.
--intercept <GLOB>Decrypt HTTPS to hosts matching the glob (repeatable, case-insensitive, *.example.com). Needs the workspace’s local CA. Other hosts stay opaque tunnels.
--workspace <DIR>The workspace whose [record] settings and local CA are used. Without it the workspace is searched from the current directory upwards; recording without interception works outside a workspace.
--include-host, --exclude-host, --method, --content-type, --keep-staticChoose what is recorded; see Filters and limits. Everything is still proxied.
--jsonPrint one redacted JSON object per capture; see JSON lines.
--upstream <URL>, --insecureReverse-proxy mode for clients that cannot use a proxy.
--save, --into <DIR>, --env <NAME>, --store-secretsSave the captures as request files when recording stops; see Saving captures as request files.

The defaults can live in the workspace:

[record]
host = "127.0.0.1"   # the flags win over these
port = 8888
intercept = ["*.example.com"]
max_body = 10485760          # bytes of each body kept in a capture (10 MiB)
max_captures = 2000          # captures kept, oldest evicted first
max_buffer_bytes = 536870912 # bytes all kept bodies may take (512 MiB)

A port that cannot be bound, or a network address without --allow-remote, stops the command with exit code 2:

$ rustman record
error: record: cannot bind 127.0.0.1:8888: address in use
$ rustman record --host 0.0.0.0
error: record: binding a non-loopback address requires --allow-remote

What is printed

One line per capture, as it completes, with the method, absolute URL, status, duration and response size (truncated when only part of a body was kept). Lines are redacted: the credentials carried by Authorization, Proxy-Authorization, Cookie and Set-Cookie, and every value that saving would turn into a placeholder (the values of X-Api-Key-style headers and of query and body fields named like token, password, secret or api_key, values starting with an auth scheme such as Bearer … in any header or field, known token formats such as ghp_… or AKIA… wherever they appear, under any name, URL path segments saved as secrets, and the neutral fields of credential objects in JSON bodies) are replaced by «redacted:<name>» wherever they reappear, URLs included. A request the upstream could not answer shows --- and the error, and the client gets 502 Bad Gateway (504 Gateway Timeout when no response head arrived in time, see Timeouts). Lines are printed by a thread of their own, so a slow terminal or pipe never slows the proxy down: when more than 1024 lines wait, the newest are dropped and stderr shows warning: <n> captures not shown (output too slow) (they are still captured, saved and exported). When recording stops, the lines still waiting are printed (for up to 2 seconds) before the --har and --save output.

What the proxy accepts

  • Plain HTTP proxy requests (GET http://host/path HTTP/1.1): forwarded to the origin, the response streamed back byte for byte (bodies are not decoded), and the exchange recorded.
  • CONNECT host:port tunnels: see below.
  • Anything else (an origin-form request such as GET /v1/users) gets 400: the proxy is not a web server. Use reverse-proxy mode for clients that send those.
  • A URL with credentials in it (http://user:password@host/) gets 400 and is not recorded: the password would otherwise reach the upstream Host header and the captures. Send credentials in an Authorization header.

The upstream leg uses the same connector as rustman send: DNS, a 10-second connect timeout and TLS verification with the OS trust store plus the workspace’s [http] ca_bundle (see Upstream TLS). Hop-by-hop headers (Connection, Proxy-Connection, Proxy-Authorization, Keep-Alive, TE, Trailer, Transfer-Encoding, Upgrade) are not forwarded. Each stored body keeps at most its first 10 MiB; the client always receives the whole body.

Filters and limits

Filters decide what is recorded; every request is still proxied, so the app keeps working.

FlagRecords only
--include-host <GLOB>Hosts matching the glob (repeatable, case-insensitive, *.example.com; no port).
--exclude-host <GLOB>Hosts not matching the glob (repeatable); wins over --include-host.
--method <METHOD>This method (repeatable, case-insensitive).
--content-type <PREFIX>Exchanges whose request or response Content-Type starts with the prefix (repeatable, application/json).

Host filters also apply to tunnel and TLS REJECTED entries. Static assets are dropped by default: responses whose type is an image, font, audio, video, CSS or JavaScript, and URLs ending in an image, font, media, .css, .js, .mjs or .map extension. --keep-static records them too.

Memory stays bounded: each body keeps its first max_body bytes (10 MiB by default) and the capture is marked truncated, while the client still receives the whole body. The capture list keeps at most max_captures captures (2000) whose bodies take at most max_buffer_bytes (512 MiB) together, evicting the oldest first. The copies of the bodies still being received (many connections, HTTP/2 streams) share a budget of the same max_buffer_bytes: once it is used up, a body being copied stops growing and its capture is marked truncated, while the traffic still flows in full. All three can be set in [record].

Timeouts

WhatDefault[record] key
Upstream connection (DNS, TCP and TLS)10 s
A client’s request head, and the TLS handshake of an intercepted tunnel30 s
The upstream’s response head, counted once the request body is sent (a long upload is not cut short)60 sresponse_timeout_ms
A client connection (plain HTTP, an opaque tunnel, or an intercepted HTTP/1.1 or HTTP/2 connection) without a byte either way, a request body that stalls included5 minidle_timeout_ms

A response head that does not arrive in time gets 504 Gateway Timeout and is recorded with the error no response within 60 s. An idle tunnel is closed and recorded with idle timeout: no traffic for 300 s; an idle plain or intercepted connection is closed (clients open a new one), so a client that announces a body (Content-Length or chunked) and stops sending it frees its connection slot. Set a key to a number of milliseconds (idle_timeout_ms = 900000 for long-polling apps); 0 keeps the default.

rustman.toml is committed, so a cloned workspace can carry [record] settings you did not choose. rustman record prints a warning on stderr when [record] intercept decides which hosts are decrypted (no --intercept flag was given), and when max_body, max_captures or max_buffer_bytes is above its default. The TUI recorder pane shows the interception scope in its header.

JSON lines

rustman record --json prints one JSON object per capture on stdout, and the banner, the --har line and the --save summary on stderr, so stdout can be piped into jq:

{"type":"exchange","method":"GET","url":"http://api.example.test/v1/me","version":"HTTP/1.1","status":200,"duration_ms":12,"intercepted":false,"request_headers":[{"name":"authorization","value":"«redacted:Authorization»"}],"response_headers":[{"name":"content-type","value":"application/json"}],"request_size":0,"response_size":512,"truncated":false,"error":null,"id":1,"ts_ms":1700000000123}

Tunnels have "type":"tunnel" with host, port, bytes_up, bytes_down and duration_ms; rejected handshakes have "type":"tls_rejected" with host, port and hint. Objects are redacted like the summary lines: Authorization, Proxy-Authorization, Cookie and Set-Cookie values are replaced whole, and their credentials, like the values of secret-named headers, query parameters and body fields, are redacted wherever else they appear. Bodies are not printed; their sizes are.

Tunnels and interception

For every CONNECT, the host is matched against the --intercept globs before any TLS handshake. A CONNECT host that is neither a DNS name nor an IP address (such as *.example.com) gets 400 Bad Request, so no certificate is ever minted for a wildcard:

  • Not included (the default for every host): the tunnel is relayed byte for byte, nothing is decrypted, and the capture list shows only TUNNEL host:port with the bytes sent each way. Banking or personal traffic in the same browser stays opaque while you record.
  • Included: the proxy completes the TLS handshake itself with a certificate for that host signed by the local CA, decrypts HTTP/1.1 or HTTP/2 (negotiated by ALPN), forwards each request to that same host over a new verified TLS connection, and records the full exchange. Requests always go to the CONNECT host, whatever their Host header says.

A client that does not trust the local CA, or pins its certificates, aborts the handshake. The capture list then shows:

TLS REJECTED api.example.com: client rejected the Rustman CA (not installed or pinned); exclude the host or install the CA

Remove the host from --intercept to let such an app work again (its traffic then becomes a tunnel), or install the CA.

Reverse-proxy mode

Some clients cannot be pointed at a proxy. --upstream <URL> turns the recorder into a reverse proxy: it accepts plain requests on the listen address and forwards each one to that origin, with Host rewritten to it.

$ rustman record --upstream https://api.example.com --port 9000
Recording reverse proxy on http://127.0.0.1:9000 -> https://api.example.com
GET https://api.example.com/v1/users 200 85 ms 2048 B

Point the client at http://127.0.0.1:9000 instead of https://api.example.com: GET http://127.0.0.1:9000/v1/users goes to https://api.example.com/v1/users and is recorded exactly like forward mode (filters, limits, --json, --save). Every request goes to the upstream, whatever its Host or absolute URL says; CONNECT gets 405. The URL must be an origin (http or https, a host and an optional port, no path or user info).

HTTPS upstreams are verified like intercepted hosts (see Upstream TLS), so a self-signed upstream fails with 502 Bad Gateway. --insecure (allowed only with --upstream, for that one host) turns verification off and prints a warning.

--upstream cannot be the proxy’s own address (--port 9000 --upstream http://127.0.0.1:9000, or any other loopback spelling of it: 127.0.0.0/8, ::1, ::ffff:127.0.0.1, localhost, *.localhost): every request would be forwarded back to the proxy, so the command exits with code 2: record: --upstream "http://127.0.0.1:9000" is this proxy's own address; requests would loop.

Upstream TLS

Upstream servers, intercepted or --upstream, are verified with the OS trust store plus the CAs of [http] ca_bundle in rustman.toml (a PEM file, relative to the workspace root), the same rules as rustman send. Point ca_bundle at the private CA of a local or staging API to record it:

[http]
ca_bundle = "certs/dev-ca.pem"

A ca_bundle that cannot be read or holds no certificate stops the command with exit code 2. [defaults] verify_tls = false is deliberately not applied to the recorder: it would turn verification off for every intercepted host. Only --insecure turns it off, and only for the one --upstream host. Client certificates ([http] client_cert) are not presented to upstreams.

The local CA

Interception needs a certificate authority that the client trusts. Rustman creates one per workspace, only when you ask:

$ rustman record ca init
Created the local CA of this workspace
  subject: CN=Rustman Local CA (0b5c0b9e), O=Rustman
  SHA-256: 3F:9A:...:C2
  expires: 2027-11-21
  key:     OS keychain (rustman / record-ca/0b5c0b9e-58c4-4c1e-9f0e-6f1f4b7f2a10)
  cert:    /home/me/.config/rustman/record-ca/0b5c0b9e-58c4-4c1e-9f0e-6f1f4b7f2a10.pem
It is not trusted yet: run 'rustman record ca install' to trust it on this machine.

rustman record --intercept ... without a CA asks to create one when run in a terminal (type yes), and otherwise exits with code 2.

CommandEffect
rustman record ca initCreate the CA. Refused (exit 2) when the workspace already has one.
rustman record ca export [--out FILE]Print the certificate in PEM (or write it to FILE) and its SHA-256 fingerprint. Never the key.
rustman record ca install [--yes]Trust the CA in this machine’s trust store after printing what will be trusted and asking you to type yes. Answering anything else changes nothing and exits with code 1.
rustman record ca uninstallRemove the CA from every trust store Rustman installed it in.
rustman record ca rotate [--yes]Uninstall the old CA, delete its key and certificate, create a new one and print both fingerprints. The new CA is not installed.
rustman record ca remove [--yes]Delete the CA when you are done with interception: remove it from the trust stores Rustman installed it in (the commands are printed), then delete its key from the keychain and its certificate, after you type yes. Answering anything else changes nothing and exits with code 1. A failed uninstall command keeps the CA, so it can be retried.

Every CA command takes --workspace <DIR>.

Security model

A trusted CA is a long-lived interception capability: whoever holds its private key can impersonate any website to this machine. Rustman limits that risk as follows.

  • Created only on request. rustman record ca init, or the explicit prompt of --intercept. Nothing else creates a CA.
  • Key in the OS keychain only. The private key is stored in the macOS Keychain, the Windows Credential Manager or the Linux Secret Service (service rustman, account record-ca/<workspace-id>). It is never written to a file, inside the workspace or anywhere else. Without a keychain (or with RUSTMAN_SECRET_STORE=file) there is no CA, and ca init fails with exit code 2: record: a keychain is required to store the CA private key. (Rustman’s own integration tests use a stand-in keychain directory; that hook exists only in test builds, compiled in by the record-test-hooks feature, so cargo build, cargo run and cargo install, debug or release, have no such fallback.)
  • Outside the workspace. The public certificate lives in the user config directory ($XDG_CONFIG_HOME/rustman/record-ca/ or ~/.config/rustman/record-ca/, %APPDATA%\rustman\record-ca\ on Windows), so it cannot be committed by accident. The only workspace file involved is the per-clone id .rustman/workspace-id (git-ignored), created on first use like for secrets.
  • Narrow certificate. ECDSA P-256, CA:true with pathlen:0 (it can sign only end-entity certificates), key usage keyCertSign, extended key usage serverAuth (TLS server authentication only), valid for one year. Name constraints are not set: clients handle them inconsistently, and the intercept globs change between sessions. An installed CA can therefore vouch for any host while its key exists, and the recorder holds the key in memory while it runs: keep --intercept to the hosts you need (never '*' on a machine you browse with), and uninstall or rotate the CA when you are done.
  • Short-lived leaves, in memory. Certificates for intercepted hosts are minted on demand, only for a DNS name or an IP address (never a wildcard), valid for 7 days, cached in memory for the session (up to 1000 hosts) and never written to disk. A rotated CA’s leaves are gone with the session that minted them.
  • Never trusted automatically. Only rustman record ca install changes a trust store, after showing the subject, SHA-256 fingerprint and expiry and asking you to type yes (or --yes). The exact commands are printed before they run.
  • Undo is one command. Rustman records which stores it touched in <config dir>/rustman/record-ca/<workspace-id>.installed, so uninstall and rotate undo exactly that.
  • Scope first. Only hosts you list with --intercept are decrypted; see Tunnels and interception.
  • Loopback only by default. Binding another address needs --allow-remote and prints a warning. Clients that are not on loopback can then reach only globally routable addresses through the proxy: everything else is refused by default, namely localhost, loopback (127.0.0.0/8, ::1), unspecified, private (RFC 1918 10/8, 172.16/12, 192.168/16), shared CGNAT 100.64.0.0/10 (with the metadata service 100.100.100.200), link-local (169.254.0.0/16 with cloud metadata, fe80::/10), unique local fc00::/7 (with fd00:ec2::254), 192.0.0.0/24, benchmarking 198.18.0.0/15, documentation ranges, multicast, 240.0.0.0/4, broadcast, every IPv6 address outside global unicast 2000::/3 and, inside it, 2001::/23 (Teredo and IETF assignments), 2001:db8::/32 and 3fff::/20, and IPv6 addresses wrapping such an IPv4 address (IPv4-mapped and IPv4-compatible, NAT64 64:ff9b::/96, 6to4 2002::/16). These are the same rules as the plugin network (one classifier, rustman_http::address::is_public_ip). Literal addresses get 403 at once; names and other spellings (127.1, 2130706433, a DNS name pointing at 10.0.0.5 or 169.254.169.254) are checked after DNS, for tunnels, forwarded plain requests and requests inside intercepted tunnels alike, and refused with 502. The check is made on the resolved addresses that are then connected to, so a name cannot resolve to a public address for the check and to a private one for the connection (DNS rebinding). Clients on loopback (this machine) may record local and private targets as before, and reverse-proxy mode is not checked: its upstream is your own choice.
  • Bounded connections. At most 512 client connections are served at once (an open tunnel counts until it closes; more wait), and a client has 30 seconds to send each request head (inside intercepted tunnels too) or to finish the TLS handshake of an intercepted tunnel. An intercepted HTTP/2 connection carries at most 100 requests at once, the copies of bodies in flight share the max_buffer_bytes budget, and idle tunnels and connections, plain ones with a stalled request body included, are closed after 5 minutes (see Timeouts), so memory and connection slots stay bounded.
  • Upstream TLS is verified. The proxy checks upstream certificates with the same rules as rustman send (see Upstream TLS); turning verification off is possible only for one --upstream host.

Run rustman record ca uninstall when you are done recording (or rustman record ca remove to delete the CA as well), and rustman record ca rotate if you suspect the key was exposed.

Trusting the CA

rustman record ca install uses the platform tool:

SystemInstallUninstall
macOSsecurity add-trusted-cert -r trustRoot -p ssl <cert> (your keychain; macOS may ask for your password)security remove-trusted-cert <cert>, then security delete-certificate -Z <SHA-1>
Windowscertutil -user -addstore Root <cert> (current user, no administrator rights)certutil -user -delstore Root <SHA-1>
Linux with update-ca-certificates (Debian, Ubuntu, Alpine)sudo install -m 644 <cert> /usr/local/share/ca-certificates/rustman-record-<id>.crt, then sudo update-ca-certificatessudo rm -f /usr/local/share/ca-certificates/rustman-record-<id>.crt, then sudo update-ca-certificates --fresh
Linux with p11-kit (Fedora, Arch)sudo trust anchor --store <cert>sudo trust anchor --remove <cert>

On other systems ca install exits with code 2 and names the certificate file to trust by hand.

Some clients keep their own trust store:

  • Firefox (its NSS store is not managed by Rustman): open Settings, Privacy & Security, Certificates, View Certificates, Authorities, Import, select the file written by rustman record ca export --out rustman-ca.pem, and tick “Trust this CA to identify websites”. Remove it from the same dialog when you are done. Alternatively set security.enterprise_roots.enabled to true in about:config to use the OS store.
  • Node.js: export NODE_EXTRA_CA_CERTS=rustman-ca.pem.
  • Python requests: export REQUESTS_CA_BUNDLE=rustman-ca.pem (this replaces the default bundle for that shell).
  • curl: curl --cacert rustman-ca.pem ....

Saving captures as request files

--save writes the captures as request files when you stop recording with Ctrl+C. It needs a workspace, and the flags are checked before the proxy starts.

$ rustman record --save --env staging
Recording proxy on http://127.0.0.1:8888
...
GET https://api.example.com/users/17 200 31 ms 120 B
GET https://api.example.com/users/42 200 28 ms 118 B
^C
Saved 1 request file (0 unchanged), environment 'staging'
Secrets parameterized (values not stored; use --store-secrets or 'rustman secret set <name> --env staging'): auth_token

A session that recorded no request (nothing at all, or only tunnels and rejected handshakes) writes nothing, not even the environment, and prints No requests recorded; nothing saved instead of a summary. The TUI’s w says the same for marked captures without a request.

Saving goes through the same pipeline as rustman import:

  1. Paths are templatized. Segments that look like identifiers (integers, UUIDs, 24-hex ObjectIds, ULIDs) become variables named after the previous segment in singular form: /users/42 becomes /users/{{user_id}}, /orders/9b2c…/items becomes /orders/{{order_id}}/items. Without a usable previous segment the name is id_1, id_2… The first value seen is the variable’s default in the environment. Since UUIDs and ULIDs cannot be guessed, a save that keeps one as a plain default says so with a warning naming the variables, so you can review the environment file before committing it. Segments that look like secrets become secret variables instead, declared under secrets: like the other placeholders and kept out of the URL, the file name and the committed defaults:
    • a segment holding a known token format (ghp_…), or a compact random token: 20 characters or more of letters, digits, - and _, mixing uppercase, lowercase and digits, less than half of it words. The last segment of a Slack webhook /services/T0…/B0…/<secret> becomes {{path_secret}} ({{<word>_secret}} after a plain word such as /hooks/), and the file name shows secret in its place. camelCase names (listOrganizationMembersV2), lowercase slugs and hex hashes stay as they are;
    • a UUID or ULID after a segment that names a credential or a one-time link (reset, verify, confirm, activate, invite, magic-link, recover, unsubscribe, or a secret name such as tokens or sessions): /password/reset/<uuid> becomes /password/reset/{{reset_id}}, with reset_id a secret. After such a segment, a token in any case (16 characters or more, with letters and digits, mostly not words) is a secret too, so a hex reset token /password/reset/5f4dcc3b… becomes /password/reset/{{reset_secret}}. Integer ids stay plain variables.
    • whichever rule applies, a secret path variable holds the value of the capture its file saves; when another request (or a plain default) already gives the name another value, the new value gets a suffixed name (reset_id_2), so every secret a saved file carries is declared and scrubbed wherever it repeats (a Referer header, say).
  2. Captures are deduplicated. One file per method and templated path, named after them (GET /users/17 and GET /users/42 give get-users-id.rman.yaml), with the most recent capture as the example (headers, query, body). Transport and Proxy-* headers are left out; a truncated or binary request body is not saved, with a warning. A request that got no response (the upstream could not be reached) is still saved, as a starting point, with a warning naming it.
  3. The base URL goes to the environment. --env <NAME> (default recorded) gets base_url (scheme, host and port), so URLs read {{base_url}}/users/{{user_id}}. Another origin in the same save gets base_url_2, base_url_3… and a warning. An origin the environment already holds under one of these names keeps it, and a new origin never takes a name the environment uses for another value, so a later session over part of the same traffic writes the same URLs.
  4. Secrets become placeholders. Authorization: Bearer eyJ… is saved as Authorization: Bearer {{auth_token}}, Cookie as {{cookie}}, and X-Api-Key-style headers, query and body fields named like token, password, secret or api_key, values starting with an auth scheme (Bearer …) in any header or body field, and known token formats (ghp_…, AKIA…, JWTs…) under any name get placeholders named after them. A bare refresh field (as in {"access": …, "refresh": …}) counts as a secret name. Inside a JSON object or array named like a credential (credentials, auth, authentication, authorization, oauth, token, secret…), at any depth, a field whose name only holds a value (value, data, raw, current, new, old, access…) or whose value looks random gets a placeholder named after both: {"credentials": {"type": "password", "value": "…"}} is saved as {"credentials": {"type": "password", "value": "{{credentials_value}}"}}. Descriptive fields such as type or user are kept, and the rest of the body keeps its layout. A body that holds JSON is judged as JSON whatever its Content-Type (browsers send a string body from fetch as text/plain). A placeholder never takes a name a path variable or base URL of the save already uses for another value ({{token_id_2}}). Each name is declared under secrets: in the environment. A name the environment already declares as a secret is reused for the same field in a later session (the value is not compared, since it may be stored nowhere; with --store-secrets the recorded value replaces the stored one); a plain variable of the same name is left alone and the secret gets a suffixed name (api_key_2). The raw values are written nowhere: with --store-secrets they are stored in the secret store (the OS keychain), otherwise set them with rustman secret set <name> --env <NAME>. Long random-looking header, query, JSON body values and URL path segments that none of these rules catch are kept but reported with a warning (a body field by its dotted path, nested.blob, a path segment by its position; the value is never printed, and control characters in names are shown escaped); a value that did become a placeholder is never reported as kept.
  5. Files are written deterministically. Files go to --into <DIR> (inside the workspace), or by default to recorded/<host>/ with the host written as a file name (api.example.com becomes recorded/api-example-com/, localhost:8080 becomes recorded/localhost-8080/). Saving the same captures again, in the same or a later session, changes nothing; a file that differs is overwritten with the recorded version, with a warning, so review the diff before committing. A _collection.yaml keeps the order: entries of earlier saves whose files are still there, ahead of the new ones, so saving part of the traffic again drops nothing.

Saving never writes a raw secret, but review the saved files before committing them: secret detection works on names and known formats, and the warnings point at values it was unsure about.

HAR export

--har <FILE> writes every capture still in the buffer to FILE as HAR 1.2 when you stop recording with Ctrl+C, before --save runs. The path is relative to the current directory, and missing folders are created. The file is readable and writable by you only, redacted or not: mode 0600 on Unix (an existing file included), an access list for your user alone on Windows.

$ rustman record --intercept "*.example.com" --har session.har
Recording proxy on http://127.0.0.1:8888
...
^C
Wrote 3 captures to /home/me/app/session.har

What the file holds:

  • One entry per capture, oldest first: the request (method, URL, HTTP version, headers, query, body) and the response (status, headers, body), the start time and the duration as wait. Bodies are the stored part only; text bodies are written as text, others base64-encoded ("encoding": "base64" in content, a comment in postData). cookies arrays are empty: the Cookie and Set-Cookie headers carry them.
  • Secrets redacted. Authorization, Proxy-Authorization, Cookie and Set-Cookie values become «redacted:<Header>», and the credentials they carry are redacted wherever they reappear (an echoing server, the URL). Every value that saving would turn into a placeholder (see Secrets become placeholders: secret-named headers and fields, auth scheme values such as Bearer …, known token formats under any name, secret path segments, neutral fields of credential objects) is redacted the same way, in the HAR, the --json lines and the TUI alike. In the URL, the placeholder is percent-encoded so it stays a valid URI. --show-secrets writes the values as they are; keep such a file out of Git.
  • Comments for what a viewer would misread. A tunnel that was not decrypted is a CONNECT https://host:port/ entry with status 0 and the comment tunnel: not decrypted; <up> B up, <down> B down. A rejected handshake is a CONNECT entry with TLS REJECTED: <hint>. A truncated body says truncated: response body stored <n> of <total> bytes (or request), a decrypted exchange says decrypted by the Rustman local CA, and a failed exchange carries its error.

The TUI recorder pane

Alt+P (or Traffic recorder in the palette) shows the recorder pane in place of the request and response panes; Esc or Alt+P hides it, and the proxy keeps running while it is hidden. The pane shows the proxy’s state and address, the intercepted host globs, the number of captures and how many are marked; the capture list newest first (time in UTC, method, host, path, status, duration and size; TUNNEL host:port with byte counts; TLS REJECTED host), and the selected capture: the request line, the HTTP version, status and duration, then the request and response headers and bodies. Everything is redacted as in the HAR export: a captured Cookie: sid=abc shows as Cookie: «redacted:Cookie».

KeyWhat it does
sStart or stop the proxy. It binds [record] host and port from rustman.toml (default 127.0.0.1:8888) and decrypts [record] intercept hosts with the workspace’s local CA (it must exist: run rustman record ca init). An address reachable from the network asks for confirmation first (Cancel is preselected); while such a proxy runs, the pane shows REACHABLE FROM THE NETWORK and the status bar a red RECORDER ON NETWORK badge.
Up/Down, j/k, g/GSelect a capture. The top row follows new captures; another selected capture stays selected as captures arrive.
PageUp/PageDownScroll the selected capture.
SpaceMark or unmark the selected capture (* in the list).
aMark every shown capture, or unmark them all when they all are.
/Filter the list: type text the rows must contain (case-insensitive); Enter keeps the filter, Esc clears it.
wSave the marked captures (or the selected one) as request files, exactly like --save with the default folder and the recorded environment. Secrets become placeholders; their values are never stored from the TUI (set them with rustman secret set).
eExport the marked captures (or the selected one) as HAR, redacted: asks for the file name (recording.har first), relative to the workspace root.

The status bar shows record <addr> while the proxy runs, and a CA TRUSTED badge in the warning colour while Rustman has this workspace’s CA installed in a trust store (read when the pane is opened and when the proxy starts), as a reminder to run rustman record ca uninstall when you are done.

Monitors

A monitor runs some of a workspace’s requests on a schedule and keeps the results locally, so “is this still working right now?” has an answer without a SaaS. Monitors are plain files in the workspace; their results stay on the machine in .rustman/monitors/, which Git must ignore.

The behavior is specified in openspec/specs/monitors. This page covers monitor files, schedules, one-shot runs and their safety policy, alerts and notification channels, the daemon and external scheduler recipes, the status and history views (CLI and TUI), and the result store with its retention.

Monitor files

Each file monitors/<name>.rman-monitor.yaml defines one monitor:

# monitors/api-health.rman-monitor.yaml
version: 1
name: api-health
targets: [health/]
environment: prod
schedule: {every: 5m}
timeout: 60s
FieldMeaning
versionAlways 1.
nameThe monitor’s name: letters, digits, - and _, the same as the file name without .rman-monitor.yaml. The result store is named after it.
targetsRequest files or collection folders, relative to the workspace root, run in workspace order (like rustman run). At least one.
environmentThe environment the requests resolve with.
scheduleExactly one of cron or every; see Schedules.
timeoutThe deadline of a whole run (default 60s); every request’s own timeout still applies.
allow_mutationstrue lets POST, PUT and PATCH requests be sent; see Read-only by default.
alertsAlert rules and notification channels; see Alerts.

Durations are a whole number followed by ms, s, m, h or d: 500ms, 30s, 5m, 1h, 30d.

An invalid file stops every monitor command with exit code 2 and the file, line and reason:

error: monitors/api-health.rman-monitor.yaml:5: schedule must set exactly one of cron or every

rustman monitor list lists the monitors (--json for a JSON array):

NAME        SCHEDULE  ENVIRONMENT  TARGETS
api-health  every 5m  prod         health/

Schedules

schedule: {every: 5m}

every takes an interval from 30s to 24h; every: 5s fails with every must be at least 30s.

schedule:
  cron: "*/15 * * * *"
  tz: Europe/Lisbon

cron takes a standard 5-field expression (minute, hour, day of month, month, day of week) or @hourly, @daily or @weekly. It is evaluated in tz, an IANA timezone name, and in the machine’s local timezone without one. tz applies to cron only.

Daylight saving time follows the usual cron rules:

  • On the spring-forward day, a fixed time inside the skipped hour (30 2 * * * in New York) runs right after the gap, at 03:00, once.
  • On the fall-back day, a fixed time inside the repeated hour runs once, on the first pass.
  • Wildcard and step fields (0 * * * *, */15 * * * *) run in real time: an hourly monitor runs every 60 minutes through both transitions, so it skips the missing hour and runs twice in the repeated one.

One-shot runs

rustman monitor run <name> runs a monitor once; --all runs every monitor of the workspace, one after the other. It is the command external schedulers call:

*/5 * * * * cd /srv/ws && rustman monitor run api-health

A run uses the same engine as rustman run: the same request loading, variable resolution, assertions and captures. Monitor runs do not write history. Each run prints one line, then one line per failure:

api-health: fail in 123 ms
  health/status: status: expected 200, got 503
Exit codeOutcome storedWhen
0passEvery request passed.
1failAn assertion failed and no request errored.
2(none)An invalid monitor file, an unknown monitor, a missing target or environment, or a target that is not an HTTP request.
3errorA request errored (network, TLS, timeout, unresolved variable) or the run passed its timeout.
4errorA request was blocked by the monitor policy.
130skippedInterrupted by Ctrl+C (message interrupted).

With --all the exit code is the most severe one: 130, then 4, 3, 1 and 0.

The timeout is a deadline for the whole run: when it passes, the requests in flight are cancelled, the rest are skipped, and the result is error with the message run exceeded its timeout of 60s.

Monitors run HTTP requests (kind: http). A target that holds another kind fails with exit code 2.

Read-only by default

Every monitor request goes through the safety policy with a GovernedSender:

  • Allowlist. Requests may go only to the hosts of the monitor’s environment: the origins of its URL-valued variables (such as base_url) and of the monitor’s requests as they resolve with it. A redirect to another host, or a URL built from a capture that points elsewhere, is not sent: blocked: host not allowed (https://other.example.com:443). [safety].allowed_hosts does not widen it. Because the origins of the requests count, a target request file with a hard-coded URL (not built from an environment variable) allows that URL’s host: review the request files a monitor targets as part of its boundary.
  • Methods. GET, HEAD and OPTIONS are allowed. POST, PUT and PATCH need allow_mutations: true in the monitor file: blocked: method POST requires allow_mutations. DELETE is never sent, whatever the file says: blocked: method DELETE is never allowed for monitors. Other methods are refused too. A request of a plugin kind is never run either (its plugin would send its own requests outside these rules): blocked: plugin request kinds are not allowed for monitors.
  • Rate. [safety].rate and concurrency apply.

A blocked request makes the run an error and the exit code 4. The production guard does not ask for --production: the environment named in the monitor file is the confirmation, and the method rules hold on every host.

Alerts

alerts:
  cooldown: 1h
  rules:
    - consecutive_failures: 3
    - failures_in_window: {count: 5, window: 1h}
    - latency_p95_gt: 800
      window: 15m
    - assertion_failed: health/status
    - status_not: 2xx
  notify:
    - desktop: true
    - webhook: {url: "{{slack_hook}}", template: slack}
    - email: {host: smtp.example.com, port: 587, from: monitor@example.com, to: [ops@example.com], username: "{{smtp_user}}", password: "{{smtp_password}}", tls: starttls}

Each rule sets exactly one of consecutive_failures (default rule: consecutive_failures: 2), failures_in_window, latency_p95_gt (with an optional window, default 15m), assertion_failed (a request id) or status_not (a code such as 200 or a class such as 2xx). cooldown defaults to 1h.

Notifier credentials never live in monitor files: a webhook url and an email password must be exactly one {{name}} reference to an environment variable or secret, and a literal value is refused when the file loads (without echoing it). Declare them as secrets of the environment (rustman secret set slack_hook --env prod), so they stay in the keychain or .rustman/secrets.yaml.

Rules

Rules are evaluated after every run, one-shot or daemon, against the stored results. Skipped runs are ignored.

RuleFires when
consecutive_failures: NThe last N executed runs failed or errored. With N: 3, it fires after the third failing run and not before.
failures_in_window: {count, window}At least count runs failed or errored within window before the latest run.
latency_p95_gt: <ms>The p95 latency of the runs within window (default 15m) is above the threshold.
assertion_failed: <request>The assertions of that request (its id, such as health/status) failed in the latest run.
status_not: <code or class>A response of the latest run has another status (200, or a class such as 2xx).

A rule fires when its condition holds after a run and resolves when it no longer does:

  • Deduplication. A firing rule notifies once, not after every failing run.
  • Cooldown. While it keeps firing, it sends a reminder ([STILL FIRING]) once cooldown (default 1h) has passed since its last notification.
  • Recovery. When it resolves, a [RESOLVED] notice says how long the outage lasted: a rule firing since 10:00 and resolved by a passing run at 10:42 reports the outage lasted 42 minutes.

The alert state lives in state.json, under the same lock the daemon and one-shot runs share, so a rule fires once whichever of them runs the monitor, and restarts do not resend it.

Notification channels

Every alert goes to every channel of notify, all at once. Each channel gets 10 seconds per attempt and one retry; a channel that fails is reported (on stdout after rustman monitor run, in the daemon’s log) and never stops the others or later runs.

  • desktop shows an OS notification with the system’s own tool: osascript on macOS, notify-send on Linux and the BSDs, and the Windows toast API through PowerShell (under Windows PowerShell’s registered app id). Nothing is linked or installed. A tool that hangs is killed after 10 seconds.
  • webhook POSTs JSON through the same HTTP engine as requests (proxies and [http] ca_bundle apply). A response outside 2xx is a failure, and redirects are not followed. The URL must be https://; plain http:// is accepted only to localhost or a loopback address. The slack template sends text plus an attachment naming the monitor, the environment, the rule and the latest failure; discord sends an embed with the same fields; generic sends a flat object.
  • email sends a plain-text mail over SMTP with lettre on rustls: STARTTLS (tls: starttls, port 587) or TLS from the first byte (tls: tls, port 465). Plain-text SMTP is never used: a server that does not offer STARTTLS fails the delivery before any credential is sent. Certificates are checked against the OS roots plus [http] ca_bundle. Email needs a build with the smtp feature, which release binaries have (from source: cargo install --path crates/rustman-cli --features smtp); without it the channel fails with email notifications need rustman built with the smtp feature.

Notifications are titled [FIRING] api-health: consecutive_failures: 3, [STILL FIRING] …, [RESOLVED] … or [TEST] api-health.

A workspace can replace a built-in webhook template with monitors/templates/<slack|discord|generic>.json.j2, a minijinja template that must render JSON. It sees monitor, environment, status (firing, reminder, resolved or test), rule, title, text, failure, at (RFC 3339), timestamp (Unix seconds), duration_seconds, color (#rrggbb) and color_int, and a tojson filter:

{"summary": {{ title | tojson }}, "env": {{ environment | tojson }}, "details": {{ text | tojson }}}

Redaction

Payloads, emails, desktop notifications, stored results, logs and status output go through the same redaction as every other output: the values of the environment’s secrets and of the channel’s credentials are replaced with «redacted:name», even when a server echoed one into an assertion message. A webhook URL is never printed: channels are named webhook (slack) or email (smtp.example.com), and an error such as an unreachable host shows the URL redacted.

Testing the channels

rustman monitor test-alert <name> sends [TEST] <name> through every channel and prints each outcome:

webhook (slack): ok
email (smtp.example.com): error: smtp: permanent error (535): authentication failed

It exits 0 only when every channel succeeded, 3 otherwise, and 2 when the monitor has no channels.

The result store

Each run appends one JSON line to .rustman/monitors/<name>/:

.rustman/monitors/api-health/
  raw/2026-03-01.jsonl   one result per line, one file per UTC day
  hourly.jsonl           hourly aggregates of compacted days
  state.json             the last run, the last compaction and the alert state

A result holds the time, the outcome (pass, fail, error or skipped), the total latency, the run’s counts (the summary fields of a run report), each request’s id, status, response code and latency, and the failure messages, redacted like every other output: a secret in an assertion message is stored as «redacted:name».

{"at":"2026-03-01T10:00:00Z","outcome":"fail","duration_ms":123.4,"summary":{"total":1,"passed":0,"failed":1,"errored":0,"skipped":0},"requests":[{"id":"health/status","status":"failed","code":503,"duration_ms":123.1}],"failures":["health/status: status: expected 200, got 503"]}

Writes are safe with concurrent writers, such as the daemon and a one-shot run under cron: an append holds an exclusive lock on the day file and writes its line in one write, and state.json and hourly.jsonl are replaced atomically (a temporary file renamed over them) under a lock file. A line that does not parse is skipped when reading.

The store must not be committed. When .rustman/ is not git-ignored (Git decides inside a repository; otherwise the workspace’s .gitignore must list it), storing a result prints:

warning: .rustman/ is not git-ignored

rustman init adds .rustman/ to .gitignore.

Retention and compaction

Raw results are kept for 7 days. After that, compaction replaces each whole UTC day older than 7 days with hourly aggregates: the number of runs, passes, failures, errors and skipped runs, and the p50, p95 and maximum latency of the runs that executed. The counts stay the same. Aggregates are kept for [monitors].retention, 30 days by default, and deleted after that:

[monitors]
retention = "90d"   # at least 7d

Compaction runs when the daemon starts, then after runs (one-shot or daemon) when the last one was a day ago or more. A compaction cut short is safe to run again: the aggregates of a day replace any earlier ones for the same hours.

The daemon

rustman monitor daemon runs every monitor of the workspace on its schedule until it is stopped. It logs one line per run, skip and reload to stderr:

2026-03-01T10:00:00Z monitor daemon started: 2 monitor(s), no listening port
2026-03-01T10:00:00Z api-health: pass in 87 ms
2026-03-01T10:00:30Z api-health: skipped: previous run still in progress
2026-03-01T10:01:00Z api-health: fail in 120 ms (health/status: status: expected 200, got 503)
2026-03-01T10:01:00Z api-health: alert: [FIRING] api-health: consecutive_failures: 2
2026-03-01T10:01:00Z api-health: webhook (slack): ok
  • Schedule. An every monitor runs at start, then every interval; a cron monitor at its next occurrence. A daemon that wakes up late (the laptop slept) runs once and carries on from now: missed runs leave a gap, not a burst, and status shows it as coverage.
  • No overlap. A run that comes due while the monitor’s previous run is still going is skipped and stored as skipped; the next run starts on its own due time.
  • Reload. Monitor files are re-read every 2 seconds. A changed schedule applies at once without a restart (every: 5m to every: 1m runs a minute later), new monitors start, removed ones stop. An edit that does not load is logged and the previous monitors keep running.
  • One per workspace. The daemon holds .rustman/monitors/daemon.lock (its pid is in daemon.pid). A second one fails with monitor daemon already running (pid <n>) and exit code 2.
  • Stopping. Ctrl+C or SIGTERM starts no new run and gives the runs in flight up to 10 seconds to finish; then they are cancelled and stored as skipped (interrupted), so a restart counts toward neither uptime nor the alert rules and sends no notice. A second Ctrl+C cancels them at once. The daemon exits 0.
  • No port. The daemon opens no listening socket; it only sends.

External schedulers

The daemon is optional: rustman monitor run <name> does the same work once, so cron, systemd timers, launchd or CI schedules can drive monitors, sharing the store and the alert state. rustman monitor schedule-recipe <name> --for cron|systemd|launchd|github-actions prints a ready-to-use configuration on the monitor’s schedule; it writes nothing unless --write <path> is given, and never installs anything. There is no Windows Task Scheduler recipe: on Windows, use rustman monitor daemon, github-actions, or a scheduled task that runs rustman monitor run <name> in the workspace folder.

Schedulereverycron
cronMapped to cron when the interval divides an hour or a day (5m is */5 * * * *, 6h is 0 */6 * * *)As written, with CRON_TZ for tz
systemdOnUnitActiveSecOnCalendar, with tz
launchdStartIntervalStartCalendarInterval (the Mac’s timezone)
github-actionsMapped to cron as aboveAs written, macros expanded (GitHub uses UTC)

An interval with no cron equivalent (every: 45s), or a cron expression a calendar cannot express (a day of month and a day of week together, a stepped range), is refused with a hint. For monitors/api-health.rman-monitor.yaml with schedule: {cron: "*/15 * * * *", tz: UTC}, --for github-actions prints:

# .github/workflows/monitor-api-health.yml: runs the api-health monitor (cron */15 * * * * (UTC)).
# GitHub runs scheduled workflows at most every 5 minutes, sometimes late.
name: monitor api-health
on:
  schedule:
    - cron: "*/15 * * * *"
  workflow_dispatch: {}
jobs:
  monitor:
    runs-on: ubuntu-latest
    timeout-minutes: 16
    env:
      # Secrets come from .rustman/secrets.yaml: add a step that runs
      # printf '%s' "${{ secrets.NAME }}" | rustman secret set NAME --env prod
      RUSTMAN_SECRET_STORE: file
    steps:
      - uses: actions/checkout@v4
      - name: Install rustman
        run: cargo install --git https://github.com/CyberdyneCorp/rustman rustman-cli --locked
      - name: Run the monitor
        run: rustman monitor run api-health

Runs from a scheduled workflow keep their store in the job’s checkout, so alert deduplication only holds across runs that share .rustman/ (a self-hosted runner, or a cache step).

Status and history

rustman monitor status reads the store only (no network) and shows, for every monitor, its last outcome, uptime over 24 hours, 7 days and 30 days, the p95 latency of the last 24 hours with a sparkline of the 24 hourly p95 values, coverage, and the firing rules:

api-health (prod, every 5m)
  last      fail 3 minutes ago (2026-03-01T10:00:00Z)
  uptime    98.95% 24h · 99.71% 7d · 99.90% 30d
  p95 24h   123 ms  ▁▂▂▃▃▂▁▁▂▃▅▇█▆▄▃▂▂▁▁▂▂▃▃
  coverage  99.65%
  firing    consecutive_failures: 2 (since 2026-03-01T09:55:00Z)
  • Uptime is passes over executed runs: skipped runs do not count. 288 runs in a day with 3 failures and 1 skipped is 98.95% (284/287). Older periods count the hourly aggregates of compacted days.
  • Coverage is executed runs over the runs the schedule expected in the last 24 hours (or since the first run): gaps from a sleeping laptop or a stopped daemon lower it, not the uptime.
  • --json prints the same data: {"monitors": [{"name", "environment", "schedule", "last", "uptime": {"24h", "7d", "30d"}, "p95_24h_ms", "hourly_p95_ms", "sparkline", "firing", "coverage_24h"}]}.
  • --viz also opens the trend view in the viz companion: uptime gauges, the hourly p95 latency over the last 30 days, and a heatmap of outcomes by UTC hour of day (the monitor_trend message of the viz protocol), and prints monitor trends opened in <companion> on stderr. Without a companion, or with one that has no monitor_trend view (the current rustman-viz does not draw it yet), it prints note: the viz companion is unavailable for monitor trends (<why>); showing the text status on stderr. The text status is printed either way, and the exit code is 0.

rustman monitor history <name> lists the stored results, newest first, with their outcome, latency and failure messages. --since 24h keeps recent ones, --outcome pass|fail|error|skipped one outcome, and --json prints JSON lines ("kind": "run" or "hour"). Compacted days show as hourly aggregates:

2026-03-01T10:00:00Z  fail       123 ms
    health/status: status: expected 200, got 503
2026-02-20T10:00:00Z  hourly  12 runs: 11 pass, 1 fail, 0 error, 0 skipped; p95 120 ms

The TUI Monitors view

In the TUI, Monitors in the command palette (monitors.open) lists each monitor with its last outcome, 24-hour uptime, latency sparkline and whether a rule is firing, with the selected monitor’s firing rules and latest results below. j/k select, r runs the selected monitor now, and Esc closes. The run goes through the same cycle as rustman monitor run (the monitor policy, the store, alerts and notifications) in the background: the UI keeps responding, the row shows running, and the list refreshes when it finishes. v opens the same trend view as rustman monitor status --viz in the background, or says why the companion cannot show it.

API docs

rustman docs build turns a workspace into a static documentation site: collections become sections, requests become endpoint pages. The site is plain HTML, CSS and a small script, works offline and over file://, and is deterministic, so it can be committed and reviewed in Git. --format markdown writes the same content as GitHub-flavored Markdown instead, and --format both writes both side by side.

$ rustman docs build
wrote 12 files to site/

The behavior is specified in openspec/specs/api-docs-generation.

The generated site

  • index.html lists every section (a collection, or a nested folder as a subsection) in workspace order, with its description and its endpoints. Requests at the workspace root form a section named after the workspace.
  • endpoints/<slug>.html is one page per request. The slug comes from the request’s path (users/create.rman.yaml → users-create), with -2, -3… on collisions, assigned in workspace order.
  • assets/app.<hash>.css, assets/app.<hash>.js and assets/search-index.<hash>.js are named after their content, so browsers never keep a stale copy.
  • search-index.json is the search index (endpoint names, methods, paths, descriptions and parameter names).
  • reference/<slug>.html holds the GraphQL schema and JSON-RPC method pages (see Protocol references).
  • .rustman-docs-manifest lists the files the build wrote.

An http endpoint page shows:

PartContent
Request lineThe method and URL template, with variables kept as {{name}}
DescriptionThe request’s description, then its docs.description, rendered as CommonMark
AuthThe scheme name (basic, bearer, api_key, oauth2, digest, aws_sigv4, jwt), never credentials
Query parameters, HeadersTables with the enabled rows; headers include the ones inherited from collections
BodyThe body type, then one row per field (top-level JSON keys, form fields, multipart parts) or the raw text
Expected behaviorOne Expected: ... line per assertion, such as Expected: status 201
ProducesOne Produces: {{var}} from ... line per capture
Example responseOnly for requests that opted in (see Examples)
Code samplesOne tab per language (see Code samples)

Requests of other kinds (graphql, jsonrpc, grpc, mcp, ws, sse, and kinds this build does not know, which are read as opaque requests instead of failing the build) get a page listing their request-file fields as a table, with the same redaction: header and metadata values of Authorization, Cookie, Set-Cookie, Proxy-Authorization and X-Api-Key are masked, and auth shows its type only.

Navigation and content are plain HTML and readable with JavaScript disabled; only the search box and the theme toggle need JavaScript. Raw HTML in descriptions is shown as text, links other than http(s), mailto, fragments and relative paths become #, and Markdown images become links, so a page never loads anything from the network.

The search box filters the prebuilt index in the browser: every word typed must match a name, method, path, kind, description or parameter name, as a word prefix, a substring, or (three letters or more) the letters of one word in order (lgn finds login). Redaction placeholders are never indexed. A page opened with ?q=users starts with that search.

Themes

The site follows the browser’s prefers-color-scheme. The toggle in the header stores the choice in local storage; when storage is unavailable (private windows, file:// restrictions), the system preference is used. Both themes meet WCAG AA contrast for text, checked by a test over the CSS tokens.

OpenAPI enrichment

For a collection imported with rustman import openapi, the import snapshot under .rustman/openapi/ adds to each request generated from an operation (matched by its openapi:operationId= or openapi:path= tag): the operation’s summary, its description (only when the request file has none: the request file wins), parameter descriptions in the query and header tables, request and response schemas, and a deprecated badge on the page and in the navigation.

The [docs] table

All keys are optional:

[docs]
title = "Shop API"                      # default: the workspace name
logo = "brand/logo.png"                 # a PNG/JPEG/GIF/WebP/ICO file inside the workspace, copied into assets/
examples = ["users/list", "Get user"]   # requests (ids or names) that publish an example
example_redact_paths = ["$.users[*].email"]
publish_variables = ["base_url"]
samples = ["curl", "httpie", "fetch", "python", "rust"]
template_dirs = ["docs-templates"]

samples and template_dirs are described in Code samples.

Request file docs key

version: 1
kind: http
name: List users
docs:
  example: true        # publish the latest recorded exchange
  hidden: true         # leave the request out: no page, navigation or search entry
  description: |
    Extra **Markdown** shown after the request's description.
url: "{{base_url}}/users"

Examples

A request shows a recorded response only when it opts in, with docs: {example: true} or by being listed in [docs].examples; other requests show none. The example is the latest exchange with a 2xx status from request history, labeled with its recording date, or with --examples snapshot the request’s stored default snapshot. It shows the status, the response headers (without Date, Server, Connection, Keep-Alive, Transfer-Encoding and Content-Length) and the body, pretty-printed when it is JSON. Bodies longer than 64 KB are cut with a note. The build prints published example: <id> for each one on stderr.

Personal data that is not a declared secret can be masked with example_redact_paths: every value a JSONPath selects becomes «redacted:<path>».

Redaction

Every value written to the site passes the environments redaction step: the secret values of every environment, read from the secret store, appear as «redacted:<name>», and so do literal credentials written in request and collection files. Authorization, Cookie, Set-Cookie, Proxy-Authorization and X-Api-Key values are always masked in examples, and so are the values of headers whose name has a credential word (token, secret, password, passwd, apikey, auth, credential, or api followed by key, split on - and _: X-Auth-Token, X-Client-Secret); on endpoint pages they are shown only when they are a variable reference such as Bearer {{token}}. A literal value of such a header, or of api_key auth, is masked in every code sample as «redacted:<Header-Name>». Literal credentials elsewhere in a request file are masked the same way in pages, code samples, examples and the search index: the user:password part of a URL (as «redacted:userinfo», and the password alone as «redacted:password»), and the values of query parameters and body fields (JSON at any depth, form and multipart fields, GraphQL variables, JSON-RPC, MCP and gRPC params) whose name reads like a credential: one containing password, token, secret or api_key, or one of the header credential words above (?api_key=… becomes ?api_key=«redacted:api_key»). Values that are {{variable}} references, and values shorter than 6 characters, are left as written.

After rendering, a leak scan looks for every known secret value in every output file, as is and in its JSON-escaped, HTML-escaped, URL-encoded, base64 and hex forms. A file with a hit is not written (a previous copy is deleted) and the build fails:

error: secret value found in site/endpoints/users-list.html

Variables

Variables appear by name only: {{base_url}}/users. A value is published only when the variable is listed in [docs].publish_variables and --env <name> selects the environment to take it from; the index page then has a Variables table. A secret cannot be published:

error: token is a secret and cannot be published

Code samples

Each http page, and each graphql and jsonrpc (over HTTP) page, which are sent as a POST, shows code samples made by the same snippet engine as rustman export snippet --placeholders, so with no environment selected the two print the same code, byte for byte, for requests without secret or dynamic variables (the differences are listed below). The default tabs are curl, httpie, fetch (JavaScript), python (Requests) and rust (reqwest), in that order; the tabs work without JavaScript. JSON, form, multipart and file bodies use each language’s own API.

Samples never read an environment or the secret store:

  • Variables stay as {{name}} in curl and HTTPie, and become constants declared at the top of code (BASE_URL = "{{base_url}}"). Values from rustman.toml [variables], collection and request variables are workspace content and fill those constants.
  • A variable declared as a secret in any environment is «redacted:name».
  • Dynamic values ({{$uuid}}, {{$timestamp}}, {{$env NAME}}) are kept as written, so builds are reproducible and nothing is read from the machine that builds.

[docs].samples selects and orders the languages, with any id rustman export snippet --list prints or the aliases fetch, python and rust:

[docs]
samples = ["curl", "go"]
template_dirs = ["templates"]

An unknown id fails the build with exit code 2.

Custom sample templates

A file <id>.tmpl in a [docs].template_dirs folder (the first folder that has one wins) replaces the built-in template of that language, for docs only: rustman export snippet keeps the built-in templates. The template is minijinja and sees the same redacted view and filters as the built-in ones (method, url, headers, body, constants, the q, qp, lit and hv quoting filters, and comment). Its first line declares the context version it was written for:

{# docs_context_version = 1 #}
{{ comment }} {{ method }} {{ url }}
http.NewRequest({{ method|q }}, {{ url|q }}, nil)

A template that declares another version, or none, is skipped with a warning and the built-in template is used:

warning: docs: template templates/go.tmpl targets docs_context_version 0, this rustman provides 1; using the built-in go template

A template that fails to render stops the build with exit code 2. Its output passes the redaction step and the leak scan like every other page.

Markdown output

--format markdown writes README.md (the index: published variables, then a link to every section file in workspace order, nested sections indented, then the protocol references), sections/<slug>.md, endpoints/<slug>.md and reference/<slug>.md. Tables are GitHub-flavored, code samples are fenced code blocks under one ### heading per language, and bodies, schemas and examples longer than 20 lines are folded in a <details> block so the tables stay readable on GitHub. User text is escaped (Markdown punctuation with backslashes, <, > and & as entities), and descriptions are the same sanitized HTML as the site’s, written as one HTML block with no blank line (raw HTML in a description becomes a paragraph of text), so no Markdown renderer parses links or images out of them. Redaction, the leak scan, ordering and determinism are the same as for HTML.

$ rustman docs build --format markdown --out docs/api
wrote 14 files to docs/api/

Protocol references

When the workspace has visible graphql requests and a schema for their endpoint, the site gets a GraphQL schema section: one page per type (objects, interfaces, unions, enums, input objects and custom scalars, sorted by name), listing fields with their types, arguments and defaults, deprecation reasons and descriptions. The schema is the one rustman validates the request against: its schema_file, the schema_file of its [[graphql.endpoints]] entry, or the cached introspection result under .rustman/graphql/schemas/ (filled by rustman graphql introspect).

When it has visible jsonrpc requests with an OpenRPC document, from [jsonrpc.catalogs] or the rustman rpc discover cache under .rustman/cache/openrpc/, the site gets a JSON-RPC methods section: one page per method with its summary and description, params (name, required, schema), result schema, documented errors and a deprecation badge.

To find a cached schema or document, the request’s endpoint is resolved with no environment and then with each environment in turn, without the secret store or the process environment; the resolved URL is only a lookup key and is never written, the pages show the endpoint as the request file writes it. Without such requests, or without a schema or document, no section is generated. Each distinct schema or document gets one section.

Layout templates

The pages are rendered with minijinja templates: layout.html, index.html, endpoint.html and reference.html. A file with one of these names in a [docs].template_dirs folder replaces the built-in one. Templates see the page model only (site, endpoint, reference and its set, assets, root, version), whose values are already redacted and are HTML-escaped when printed; descriptions are HTML made from Markdown and are printed with |safe. Templates are rendered with trim_blocks and lstrip_blocks: a block tag ({% if %}, {% for %}) on a line of its own writes nothing, not even the line break. The leak scan also checks the output of custom templates.

The output folder

--out defaults to site/. A build replaces only the files listed in the folder’s .rustman-docs-manifest and removes the ones it no longer produces, so files you add (a CNAME, say) stay. A non-empty folder without a manifest is refused:

error: site/ is not empty and was not generated by rustman docs; use --force

Two builds of the same workspace, history and options are byte-identical, in both formats: files and navigation are sorted (workspace order, then byte-wise), GraphQL types and JSON-RPC methods are sorted by name, there are no build timestamps (the version is in the footer; example dates come from the recorded exchange), files are UTF-8 without a BOM with \n line endings on every platform, anchors are stable slugs, and assets are named after their content hash. A golden test checks the hash of every file on Linux, macOS and Windows.

Publishing to GitHub Pages

The site needs no server: publish the folder as is. A workflow that builds the docs on every push to main and deploys them with GitHub’s Pages actions (set Settings → Pages → Source to GitHub Actions):

name: docs
on:
  push:
    branches: [main]
permissions:
  contents: read
  pages: write
  id-token: write
jobs:
  deploy:
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - uses: actions/checkout@v4
      - name: Install rustman
        run: cargo install --git https://github.com/CyberdyneCorp/rustman rustman-cli --locked
      - run: rustman docs build --out site
      - uses: actions/upload-pages-artifact@v3
        with:
          path: site
      - id: deployment
        uses: actions/deploy-pages@v4

The runner has no secret store, so secret values are unknown there: requests show {{token}} references as usual, and a literal credential written in a request file is still redacted. Builds that publish examples need the history, which lives in .rustman/ and is not committed; build those locally instead. Because the output is deterministic, committing site/ and reviewing git diff site/ also works, and --format markdown --out docs/api gives pages GitHub renders directly.

Preview

rustman docs serve builds the HTML site into a temporary folder and serves it on 127.0.0.1 only (never on other interfaces; a request whose Host is not localhost, 127.0.0.1 or [::1] gets 421, so a DNS-rebinding page cannot read it), on --port (default 4000; 0 picks a free port). It takes --env and --examples like docs build, writes nothing into the workspace, and runs until Ctrl+C:

$ rustman docs serve
docs: built 12 files
docs: serving on http://127.0.0.1:4000

Every change under the workspace folder (except .git/) rebuilds the site once changes stop for 200 ms, into a fresh folder that replaces the served one at once, and open pages reload, typically within half a second of saving. Pages get a small inline reload script that listens on /__rustman/reload (server-sent events); it is added as pages are served and is never part of docs build output.

Every response carries X-Content-Type-Options: nosniff, and files other than pages (stylesheets, scripts, the logo) are also served with Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox, so a file opened on its own runs no script. The logo is a raster image only (PNG, JPEG, GIF, WebP or ICO): an SVG logo is refused with exit code 2, because a static host would serve it without such a policy and its scripts would run on the docs origin.

When a build fails, the error is printed on stderr and shown in an overlay at the bottom of every page, over the last good build, and the server keeps running; the next successful build removes it. Build messages pass the same redaction as the site. A port that is already taken exits 2:

$ rustman docs serve --port 4000
error: docs: cannot bind 127.0.0.1:4000: address in use

Exit codes

CodeMeaning
0The site was written.
1The leak scan found a secret value in an output file; that file was not written.
2Usage or configuration error: a non-empty --out without a manifest (without --force), a secret in publish_variables, an unknown --env, an invalid example_redact_paths JSONPath or template, an unknown samples language, a custom sample template that fails to render, a logo outside the workspace or not a PNG, JPEG, GIF, WebP or ICO image; for docs serve, a port that cannot be bound.

docs serve exits 0 when stopped with Ctrl+C; build errors while it runs do not stop it.

Viz companion (rustman-viz)

rustman-viz is an optional graphical companion that shows runs, explorations, load tests and large responses as native dashboards. It is a separate program built on the Raven GUI library (Apache-2.0). rustman works the same without it: nothing in rustman links Raven or needs a GPU, and when the companion is missing every command still runs. How rustman finds and starts it is described in Viz companion, and the messages they exchange in the viz protocol.

The companion is read-only. It sends no request, runs no request file and writes no workspace file. What it shows was redacted by rustman before it was sent: secrets appear as «redacted:name», and the companion has no way to reveal them.

Opening it

rustman run api/ --viz                       # live run dashboard while the run executes
rustman explore run --spec api.yaml --target https://staging.example.com --viz
rustman viz out/run.json                     # a saved run report
rustman viz .rustman/explorations/<id>/report.json              # exploration dashboard
rustman viz .rustman/explorations/<id>/report.json --view graph # API graph
rustman bench checkout/ --target https://staging.example.com --viz   # live bench dashboard
rustman viz out/bench.json                   # a saved bench report (--report json=out/bench.json)

In the TUI, v in the response viewer opens the current response in the inspector.

Views

Run dashboard

  • KPI tiles: requests, assertion pass rate, p50 and p95 latency, and errors (requests that got no response). Each tile has a sparkline of its history. While a run is in progress the requests tile reads done / planned.
  • Outcomes: a donut of 2xx, 3xx, 4xx, 5xx, transport errors and cancelled requests.
  • Latency over time and a latency histogram with a logarithmic axis. Each histogram bucket is labelled by its upper bound in milliseconds.
  • Requests: one row per request file, with its count, pass rate, p50, p95 and latency trend.

The state badge reads Running, Completed, Aborted or, if rustman went away before the end, Producer disconnected. The dashboard keeps the last state it received. Live dashboards are redrawn at most 10 times a second. When updates arrive faster than that, progress updates are merged, but findings and final summaries are always kept.

Exploration dashboard

  • Heatmap: one row per operation and one column per status class (2xx, 3xx, 4xx, 5xx, no response). During a live exploration each cell counts probes. For a saved report it counts the documented statuses that were observed, because a report keeps no status for each probe.
  • Gauges: operation coverage (operations that answered at least once) and documented-status coverage.
  • Findings: sorted by severity, then by operation. Click a heatmap row to show only that operation’s findings, and click it again to show them all.

API graph

There is one node per operation and one link per data dependency, meaning a value from one operation’s response used as a parameter of another (for example, the id that POST /users returns feeds GET /users/{id}). Producers sit on the left. Each node is coloured by its worst finding: red for critical, orange for high, yellow for medium, blue for low, and grey for none. Select a node to list its findings. The links come from the dependencies field of exploration reports, which rustman explore run writes from version 0.1.

Bench dashboard

rustman bench --viz opens it and sends one update per second; rustman viz <report.json> opens a saved bench report in it.

  • KPI tiles: requests, requests per second, p95 latency, error rate and active VUs, each with a sparkline of its last 120 seconds. While the bench runs, requests per second and p95 are those of the last second; once it ends, those of the whole bench.
  • Throughput per second (requests per second and errors), latency percentiles per second (p50, p95 and p99) and active VUs, one point per second.
  • Totals: duration, iterations, requests, errors, requests per second and the p50, p95 and p99 latency of the whole bench. While it runs, the duration, requests and errors so far.
  • Thresholds: each threshold as written, whether it passed, and the measured value. They are known when the bench ends.

The subtitle shows the target, environment and load profile (for a saved report), the time elapsed and, while a bench with a fixed duration runs, the time left. The state badge reads Running, Completed, Aborted (threshold) or Aborted (interrupted), or Producer disconnected when rustman went away before the end. A slow companion misses some seconds rather than slowing the bench, so a live plot may have gaps; the totals come from the end of the bench and are exact.

Response inspector

A JSON array becomes a table. The array is either the top level of the body or the one a JSONPath selector picks. The columns are the union of the keys of the first 1,000 elements, and a missing key leaves an empty cell. Rows are read on demand, so arrays of millions of rows scroll smoothly. Click a column header to sort: numbers sort by value and missing values sort last. The JSON tab shows the body as read-only, highlighted text, limited to its first MiB. A body without an array shows only the JSON view.

Bodies larger than 16 MiB arrive as a temporary file (blob_ref) that rustman deletes once the companion exits. The whole body is parsed into memory: a 200 MiB array takes a few seconds and a few GiB of memory.

Installing

Prebuilt rustman-viz packages are not published yet. Until they are, build the companion from source with the Raven library:

  1. Download the Raven 0.3.0 package for your platform from the releases, for example raven-macos-universal-static.tar.gz, raven-linux-x64-static.tar.gz or raven-windows-msvc-x64-static.zip. Check it against SHA256SUMS.txt, then extract it.

  2. Build the companion and put it next to rustman or on PATH:

    cd crates/rustman-viz
    RAVEN_LIB_DIR=/path/to/raven/lib RAVEN_STATIC=1 cargo build --release --features raven
    cp target/release/rustman-viz ~/.local/bin/    # or anywhere on PATH
    

    Without RAVEN_LIB_DIR, the build stops and says where to get the library. Without --features raven, no rustman-viz binary is built.

  3. Check it: rustman-viz --protocol-check prints rustman-viz/1.

Graphics by platform:

PlatformBackendNeeds
macOSMetalnothing (MoltenVK is not needed with Raven 0.3)
LinuxVulkana Vulkan driver and loader (libvulkan1), X11 or Wayland
WindowsVulkana GPU driver with Vulkan (current NVIDIA, AMD and Intel drivers include it)

The companion lives in crates/rustman-viz, in a workspace of its own. Building rustman never fetches or builds Raven.

Troubleshooting

What you seeWhyWhat to do
Viz companion not foundNo rustman-viz on PATH, next to rustman, or in RUSTMAN_VIZInstall it (above), or set RUSTMAN_VIZ=/path/to/rustman-viz
RUSTMAN_VIZ=… is not an executable fileThe override points at nothing usableFix or unset RUSTMAN_VIZ
Viz companion speaks rustman-viz/2, rustman needs rustman-viz/1The companion and rustman come from different releasesUpgrade the older one
Graphics unavailable (Vulkan)The companion exited with code 3: no GPU backend could start (no Vulkan driver, a remote session or a VM)Install the GPU driver, or use rustman report render <report> --format html
Viz companion exitedThe window was closed, or the companion crashedThe run goes on. The companion’s stderr is in .rustman/viz.log
Viz companion stopped reading for 5 s; detached from itThe companion frozeThe run goes on without visuals

Exit codes of rustman-viz: 0 when its windows are closed or --protocol-check succeeds, 2 for bad arguments, 3 when graphics cannot start (after an error line vulkan_unavailable), and anything else for a crash.

Development

  • RUSTMAN_VIZ_DEV_LAYOUTS=<dir> makes the companion read the window layouts from <dir> instead of the copies built into the binary. The originals are in crates/rustman-viz/layouts/.
  • RUSTMAN_VIZ_HEADLESS=1 runs it with no window system and no GPU (Raven’s null backend). The integration tests use it.
  • scripts/check_viz_e2e.py <rustman> <rustman-viz> checks rustman run --viz end to end with the real companion drawing a real window: it runs the demo collection (examples/demo) against the demo API, records what crosses the pipe, and asserts the handshake, the full event stream (with the API token never sent) and the companion’s clean exit after it captured the run dashboard. CI runs it on Linux under Xvfb with Mesa’s software Vulkan driver (lavapipe), in the viz-e2e job.
  • rustman-viz --capture <dir> waits for its input to end, then saves every window as a PNG and exits. The screenshots on this page were made with --capture from crates/rustman-viz/tests/fixtures, which hold sample data rather than a real API.
  • All unsafe code is in src/raven_adapter/. The rest of the crate denies unsafe_code, and the view models in src/model/ are tested without Raven.

EVM toolkit

Rustman’s EVM layer sits on top of the JSON-RPC client: every node call goes through it, so its transport settings, method guards and redaction apply. The rustman-evm crate knows chains, units and ABIs; it never signs or sends a transaction.

This page covers what is available today: the [evm] table, chain pinning with chain_id in environments, the known-chain registry, node client detection, quantities and units, the evm-call and evm-tx request files and their load-time checks, ABI sources (built-in token standards, JSON ABIs, Foundry and Hardhat artifacts, opt-in explorer fetch), decoding of calls, outputs, reverts, transactions, receipts and logs, running calls (with state overrides, gas estimates and traces), evm assertions and captures, head and log streams, ENS names, local Anvil forks, the send-method guard, the rustman evm commands, the TUI pane and the read-only agent tools. Signing and sending evm-tx requests with rustman evm send is covered in EVM signing.

[evm] in rustman.toml

Every key is optional. Workspaces without [evm] keep working.

[workspace]
name = "defi"
version = 1

[evm]
# Verified ABIs from a block explorer: off unless set.
allow_explorer_fetch = true
# A mainnet endpoint for ENS names (a URL or a {{variable}}).
ens_rpc = "{{mainnet_rpc}}"

# Add a chain, or change a built-in one.
[evm.chains.999]
name = "My L2"
symbol = "MYL"
decimals = 18
explorer = "https://explorer.myl2.example"

# An Etherscan-compatible API per chain id. The key is a secret.
[evm.explorers.1]
api_url = "https://api.etherscan.io/v2/api"
api_key = "{{etherscan_key}}"
KeyDefaultMeaning
allow_explorer_fetchfalseAllow abi: {explorer: true} to fetch verified ABIs.
ens_rpcunsetThe mainnet endpoint used for ENS names.
[evm.chains.<id>]nonename, symbol, decimals and explorer for a chain id; absent fields keep the built-in values.
[evm.explorers.<id>]noneapi_url and api_key of an Etherscan-compatible API (the V2 multichain shape, with a chainid parameter).
allow_raw_send_localfalseReserved: would let jsonrpc files send raw transactions to chain 31337. Not honored in this build; see Send methods.
allow_signing, signersunsetRead by the signing gate: see EVM signing.
protected_chains, headless_signing_chains, max_costunsetRead by the signing confirmation: see EVM signing.

A key Rustman does not know under [evm] is a warning when the workspace loads (rustman.toml: unknown key 'evm.<key>' ignored); rustman-evm rejects misspelled keys inside [evm.chains.*] and [evm.explorers.*], and table keys that are not integer chain ids.

Chain pinning

An environment may pin the chain its endpoints must be on:

chain_id: 11155111
variables:
  rpc: https://sepolia.example/rpc
secrets: [etherscan_key]

Before the first EVM request to an endpoint in a session, Rustman calls eth_chainId. When the environment sets chain_id and the endpoint reports another chain, the request stops there, with exit code 4 and nothing else sent:

chain mismatch: environment 'sepolia' expects 11155111 (Sepolia), endpoint reports 1 (Ethereum Mainnet)

Without chain_id, the detected chain is shown and used. The chain and the node client are asked once per endpoint per session.

Node client detection

After the chain check, Rustman reads web3_clientVersion and classifies the node as geth, reth, erigon, nethermind, besu, anvil, hardhat or unknown, with its version: Geth/v1.14.11-stable/linux-amd64/go1.23.2 is shown as geth 1.14.11. A node without web3_clientVersion (JSON-RPC error -32601) is unknown, with no error; Rustman then asks net_version for the network id. EVM command JSON output carries chain_id, chain, client, client_version and network.

Known chains

IdNameNative currencyExplorer
1Ethereum MainnetETHhttps://etherscan.io
10OP MainnetETHhttps://optimistic.etherscan.io
137Polygon PoSPOLhttps://polygonscan.com
8453BaseETHhttps://basescan.org
17000HoleskyETHhttps://holesky.etherscan.io
31337Anvil/Hardhat localETHnone
42161Arbitrum OneETHhttps://arbiscan.io
11155111SepoliaETHhttps://sepolia.etherscan.io

Every native currency has 18 decimals. Chains are shown as Name (id), such as Base (8453). An id neither built in nor configured is shown as chain <id> with symbol ETH. With [evm.chains.999] name = "My L2" and symbol = "MYL", chain 999 is shown as My L2 (999) and native values in MYL. Chains can also be named by alias: mainnet, optimism, arbitrum, polygon, anvil.

Quantities and units

Every quantity is a 256-bit integer; parsing and display use integer arithmetic only, so conversions are exact.

InputMeaning
0x0de0b6b3a7640000Hex.
1000000000000000000A decimal integer, in wei.
1.5 ether, 2 eth, 2 ETHEther (18 decimals).
30 gweiGwei (9 decimals).
5 weiWei.
2 MYLThe chain’s native symbol, with its decimals.

0.000000000000000001 ether is 0x1. An amount with more decimals than its unit (1.5 wei) and an unknown unit (1 finney) are errors naming the value. Nodes receive the minimal hex form (0x1).

Native values (value, balance, gas prices and fees) are shown in the native currency first, with toggles for wei, gwei and hex: a balance of 0x0de0b6b3a7640000 is 1 ETH, 1000000000000000000 wei, 1000000000 gwei or 0x0de0b6b3a7640000 (the hex the node sent). Other quantities (block numbers, nonces) toggle between decimal and hex. ERC-20 amounts are shown with the token’s decimals and symbol, with at least two decimals: 250.00 USDC.

Request files

kind: evm-call

A read-only eth_call. It never produces a signed transaction.

version: 1
kind: evm-call
name: USDC balance
rpc: "{{rpc}}"
to: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
abi: erc20
function: balanceOf
args: ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"]
block: latest
FieldRequiredMeaning
rpcyesThe node URL or a {{variable}}.
toyesA contract address or an ENS name.
abiyesA built-in name, a path, or {explorer: true} (see ABI sources).
functionyesA function name, or a full signature such as transfer(address,uint256) for overloaded functions.
argsnoThe arguments, in order: strings, numbers, booleans, and lists for arrays and tuples. Integers accept unit forms ("1.5 ether"). Mixed-case addresses must have a valid EIP-55 checksum.
from, valuenoThe caller and the value sent with the call.
blocknolatest (default), earliest, pending, safe, finalized, a number, or a block hash.
state_overridesnoPer address: balance, nonce, code and storage (slot to value).
variables, assertions, captures, tags, description, docsnoAs for other kinds.

A simulation at a historical block with an override:

version: 1
kind: evm-call
name: Vault balance at a block
rpc: "{{rpc}}"
to: "0x5FbDB2315678afecb367f032d93F642f64180aa3"
abi: ../out/Vault.sol/Vault.json
function: balance
block: 19000000
state_overrides:
  "0x5FbDB2315678afecb367f032d93F642f64180aa3":
    balance: 100 ether
    storage:
      "0x0": "0x1"

kind: evm-tx

A transaction to sign and send, only through the signing gate (EVM signing): rustman evm send --sign or rustman run --sign. A plain rustman run reports it as skipped (signing not requested) without counting it as a failure, and rustman send refuses it with evm-tx: sign and send it with `rustman evm send --sign` or `rustman run --sign`; nothing was signed or sent (exit code 4, like every signing refusal). Loading never calls a node or touches a signer.

rustman evm send checks an evm-tx request against the signing gate (workspace opt-in, approved signers, --sign, the chain_id pin, simulation); see EVM signing.

version: 1
kind: evm-tx
name: Pay Bob
rpc: "{{rpc}}"
to: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
abi: erc20
function: transfer
args: ["0x5e3D81ECeb0c7D9bA1E6cfDAcE631B165a149d3F", "10"]
gas: 100000
max_fee: 30 gwei
max_priority_fee: 1 gwei
type: eip1559
signer: deployer

to is required: a file without it fails to load with contract deployment is out of scope; use Foundry or Hardhat. The other fields are value, gas, max_fee, max_priority_fee, gas_price (legacy), nonce, type (eip1559 or legacy) and signer.

Load-time checks

When a workspace loads, each EVM file is checked against its schema: unknown fields (such as gas in an evm-call), a missing to, abi or function, a bad abi value, negative numbers. Its local ABI (a built-in name or a file) is read and the function is looked up too, still without calling a node; a problem fails the load (exit code 2), so nothing is sent:

requests/transfer.rman.yaml:7: function 'transfer' is overloaded; use a full signature such as 'transfer(address,uint256)'

The argument count, literal quantities (value, the fee fields), block and state_overrides are checked as well. Values that come from {{variables}} are checked when the request runs.

ABI sources

abi:Source
erc20, erc721, erc1155The built-in token standards.
../abi/Token.jsonA JSON ABI (an array).
../out/Vault.sol/Vault.jsonA Foundry artifact: its abi array is used.
../artifacts/contracts/Vault.sol/Vault.jsonA Hardhat artifact: its abi array is used.
{explorer: true}The verified ABI from the chain’s explorer (opt-in).

Paths are relative to the request file and must stay inside the workspace: abi path '../../outside.json' resolves outside the workspace. Parsed ABIs are cached for the session by the SHA-256 of their bytes, so the same file used by many requests is parsed once.

Explorer fetch

abi: {explorer: true} fetches the verified ABI from the API in [evm.explorers.<chain id>], only when [evm] allow_explorer_fetch = true. Otherwise the request fails, before any network access, with:

explorer ABI fetch is disabled; set [evm] allow_explorer_fetch = true

Rustman first reads the EIP-1967 implementation slot (eth_getStorageAt at 0x3608…2bbc). For a proxy, the implementation’s ABI is used and Rustman says so: proxy → implementation 0x…. Fetched ABIs are kept in .rustman/abi-cache/<chain id>/<address>.json (git-ignored with the rest of .rustman/) and read from there next time. The API key is a secret: it is redacted from every message, even when the explorer echoes it back.

Decoding

  • Calls and outputs: arguments are encoded with the ABI; return values are decoded with their names. Addresses are shown checksummed, integers in decimal, bytes as hex, strings quoted; JSON output keeps integers as decimal strings.
  • Reverts: Error(string) is shown as reverted: <reason>; Panic(uint256) with its Solidity meaning, such as reverted: Panic(0x12) division or modulo by zero or reverted: Panic(0x11) arithmetic overflow; custom errors of the loaded ABI as reverted: InsufficientBalance(available=5, required=10). Other revert data is shown as hex with its 4-byte selector.
  • Transactions and receipts: from, to, value, nonce, block, status, gas used, effective gas price and the fee paid, with the input decoded by the ABI known for the target (else the built-in token standards).
  • Logs: decoded with the ABI known for their address, else the built-in token standards (ERC-20 and ERC-721 Transfer are told apart by their indexed fields). A USDC transfer reads Transfer(from=0x…, to=0x…, value=250.00 USDC). Undecodable logs show their topics and data as hex.
  • Token metadata: decimals() and symbol() are asked once per token per session. When decimals() fails, the raw amount is shown with the warning decimals() unavailable; showing raw amount. An unknown transaction is transaction not found (exit code 1).

Running calls

An evm-call runs as one eth_call through the JSON-RPC client, at block (a tag, a number sent as hex, or a block hash sent as {"blockHash": ...}), with state_overrides as the call’s third parameter:

{"method": "eth_call", "params": [{"to": "0x…", "data": "0x70a08231…"}, "0x121eac0",
  {"0x5FbDB2315678afecb367f032d93F642f64180aa3": {"balance": "0x56bc75e2d63100000", "stateDiff": {"0x00…00": "0x00…01"}}}]}

Override quantities accept unit forms (100 ether); storage slots and values are padded to 32-byte words. A node that rejects the third parameter fails the request with node does not support state overrides (exit code 3).

ENS names are accepted for to, from and every address argument; they are resolved first (see ENS names). The decoded outputs are shown one per line, by name (or index when unnamed). The amounts of ERC-20 balanceOf, totalSupply and allowance are shown in token units, with the raw integer:

balance = 250.00 USDC (250000000)

A revert is shown decoded (see Decoding) and is not an RPC error. With --estimate, Rustman also sends eth_estimateGas for the same call (same block and overrides) and adds gas estimate: 21000; an estimate that fails is reported on that line, without failing the call.

Assertions

evm-call files take evm assertions besides the generic ones (latency, and json over the result document below). Each - evm: item has exactly one of output, emits, reverts, reverts_with or gas_lt:

AssertionPasses when
{output: <name or index>, equals: v}The decoded output equals v. Integers compare as 256-bit values and accept every quantity form (0x1, "1 ether", "30 gwei", and the token’s symbol for ERC-20 amounts: "250 USDC"); addresses compare case-insensitively; booleans, strings and bytes (hex) as written.
{output: ..., gt | gte | lt | lte: v}The integer output compares so with v (signed integers too).
{output: ..., contains: v}A string or bytes output contains v, or an array output has an item equal to v.
{emits: "<Event(sig)>", where: {field: value}}An event with that signature was decoded, with those fields (where is optional). eth_call returns no logs, so a file with emits (or an evm_event capture) simulates the call once more with debug_traceCall (callTracer with withLog) and decodes the logs it would emit; logs of reverted sub-calls are dropped. A node without debug_traceCall gives a warning and no events.
{reverts: true} / {reverts: false}The call reverted, or did not.
{reverts_with: "<reason or ErrorName>"}The revert’s Error(string) reason, custom error name or Panic matches; "Panic(0x12)" matches a panic code too.
{gas_lt: n}The gas estimate is below n. A gas_lt assertion asks eth_estimateGas even without --estimate.
version: 1
kind: evm-call
name: Treasury balance
rpc: "{{rpc}}"
to: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
abi: erc20
function: balanceOf
args: ["{{treasury}}"]
assertions:
  - evm: {output: balance, gte: "250 USDC"}
  - evm: {reverts: false}
  - evm: {gas_lt: 60000}
captures:
  - {var: treasury_balance, from: evm_output, output: balance}

Failures name the output and, when the expected value has a unit, show both sides in the output’s own units: the token’s for an ERC-20 amount (expected >= 1000000000000 USDC, got 250 USDC for gte: "1 ether"; the raw integers, with the unit as written, when the token’s decimals are unknown), else the native currency’s. A value without a unit is compared and shown as a plain integer:

evm output 'balance': expected >= 1 ETH, got 0.5 ETH
evm reverts_with: expected InsufficientBalance, got reverted: Panic(0x12) division or modulo by zero
evm gas_lt: expected < 21000, got 21000

An output assertion on a call that reverted is an error that quotes the revert (evm output 'balance': the call reverted: Panic(0x12) division or modulo by zero). A revert without an assertion about it does not fail the request: the result shows it. Expected values are taken as written; {{variables}} are not interpolated in them yet.

Captures

CaptureValue
{var, from: evm_output, output: <name or index>}A decoded output.
{var, from: evm_event, event: "<sig>", field: <name>}A field of the first decoded event with that signature (reorged logs are skipped).
{var, from: evm_receipt, field: contractAddress | blockNumber | status | gasUsed}A receipt field.

Quantities are stored as decimal strings and addresses as EIP-55 checksummed strings, so {{owner}} can be passed to the next call as is:

version: 1
kind: evm-call
name: Owner
rpc: "{{rpc}}"
to: "0x5FbDB2315678afecb367f032d93F642f64180aa3"
abi: ../out/Vault.sol/Vault.json
function: owner
captures:
  - {var: owner, from: evm_output, output: 0}

Captures follow the usual rules: available to every later request of the run, persist: true to keep them in .rustman/state/, and a capture named in the environment’s secrets is a secret. evm_event reads the events of the simulated call (see emits above). evm_receipt has nothing to read in a read-only call (there is no receipt); it reports no receipt field ... there, and reads the receipt of an evm-tx sent with rustman evm send (see EVM signing).

In rustman run

rustman run sends evm-call requests like any other: variables (including {{rpc}} and secrets) are resolved, the environment’s chain_id is checked before the first call to each endpoint, evm and generic assertions are evaluated, and captures feed later requests. The JSON report has an evm object per request:

{"endpoint": {"chain_id": 1, "chain": "Ethereum Mainnet", "client": "geth", "client_version": "1.14.11", "network": null},
 "status": "Ethereum Mainnet (1) · geth 1.14.11", "to": "0xA0b8…eB48", "block": "latest",
 "result": {"function": "balanceOf(address)", "outputs": {"balance": "250000000"}, "reverted": null,
            "gas_estimate": null, "token": {"decimals": 6, "symbol": "USDC"}}}

A request that could not run has {"error": {"kind": "config" | "rpc" | "refused" | "not_found", "message": ...}}; a run with a refused request (a chain mismatch) exits with code 4, like rustman evm call. An evm-tx request is skipped as signing not requested and does not fail the run. Like every report, the evm object is redacted: an endpoint URL kept in a secret never appears.

Call traces

With --trace, Rustman asks debug_traceCall with the callTracer; when the node does not have it, trace_call with ["trace"] (Erigon and Nethermind style). Both become one call tree, one frame per line, indented by depth, with each frame’s type, from and to, decoded function, value, gas and revert reason:

CALL 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -> 0x5FbDB2315678afecb367f032d93F642f64180aa3 balanceViaSelf(who=0xf39F…2266) gas=… used=…
  STATICCALL 0x5FbDB2315678afecb367f032d93F642f64180aa3 -> 0x5FbDB2315678afecb367f032d93F642f64180aa3 balanceOf(0xf39F…2266) gas=… used=…

The tree keeps 256 levels of nesting; frames below that are counted, not kept, and shown as one … N deeper frames omitted line under the deepest frame kept, so a broken or hostile node cannot exhaust memory or the stack.

When the node has neither method, the call result is still printed, followed by tracing not supported by geth (with the detected client), and the exit code is unaffected. Which method works is remembered per endpoint for the session.

Head and log streams

A stream follows new block headers or logs. Logs are filtered by one or more addresses and by topics; an event signature such as Transfer(address,address,uint256) stands for its topic hash, and * matches any value at that position.

  • Over a ws:// or wss:// endpoint, Rustman subscribes with eth_subscribe (newHeads, or logs with the filter) and unsubscribes when the stream ends.
  • Over HTTP it creates a filter (eth_newFilter, or eth_newBlockFilter for heads), polls eth_getFilterChanges every 2 seconds (configurable), and says so: polling every 2s (no WebSocket). A node that forgets the filter (filter not found) gets a new one; the filter is removed with eth_uninstallFilter at the end.

Each log is decoded like a receipt log, one per line. A log the node sends again with removed: true (a reorg) is shown as REORGED and is not counted as a new event:

REORGED [7] 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 Transfer(from=0x…, to=0x…, value=250.00 USDC)

A stream stops at its event or time bound, when it is stopped, or when the node closes the connection. At most 256 items wait for the printer: when it falls behind, the stream stops reading the node until it catches up, so memory stays bounded.

ENS names

Names are resolved through Ethereum Mainnet’s ENS registry (0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e): the name’s resolver, then its address, shown checksummed (vitalik.eth is 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045). Reverse lookups read the <address>.addr.reverse record and are shown only when the name resolves back to the same address.

The registry is read from [evm] ens_rpc when set, else from the current endpoint when it is chain 1. The ens_rpc endpoint’s eth_chainId is checked before its first read: the registry has the same address on every chain, so an ens_rpc on another chain is refused (exit code 4) with [evm] ens_rpc reports chain <id>, not Ethereum Mainnet (1); ENS is read on mainnet only. On any other chain, without ens_rpc, a name fails with ENS needs a mainnet RPC; set [evm] ens_rpc. A name without a resolver or an address is not found (exit code 1). Names are lowercased; full ENSIP-15 normalization of non-ASCII names is not done.

Local forks with Anvil

Rustman runs Foundry’s anvil (found on PATH) to fork a chain: anvil --host 127.0.0.1 --port 8545 --fork-url <rpc> --fork-block-number <N>. With --chain, the upstream endpoint is the rpc variable of the environment of that name (--chain local), else of the first environment pinned to the chain it names (mainnet, 8453); --env or --rpc name the endpoint directly. Rustman waits for Anvil’s own Listening on line, so another process on the port is never taken for the fork. The rest of the fork’s output is discarded: its banner lists development keys, and its errors could quote the upstream URL.

Anvil takes the upstream URL on its command line only (it has no environment variable or file for it), so while the fork runs, other users of the same machine can see that URL, API key included, in the process list (ps). rustman evm fork prints a note saying so when it starts. On a shared machine, fork from an endpoint without a key in its URL, such as a local node or a local proxy that adds the key.

While the fork runs, a temporary environment fork-<chain> (such as fork-mainnet) points at it, with chain_id set to the id the fork reports:

# Temporary: written by `rustman evm fork`, removed when it exits.
# anvil pid: 48213
chain_id: 1
variables:
  rpc: http://127.0.0.1:8545

--port 0 lets Anvil pick a free port, read back from its Listening on line. The file is removed and Anvil stopped when the command exits, on Ctrl+C or when Anvil exits on its own (then with exit code 3 and anvil exited (...); the fork and environment '<name>' are gone); an existing environment of that name that Rustman did not write is never replaced. Cleanup runs on Ctrl+C, SIGTERM and SIGHUP (a second one while stopping still kills Anvil); a rustman killed outright (SIGKILL) can leave Anvil running, with the upstream URL in its arguments, and the file behind. Stop such a node by its pid, recorded in the file. On Unix, the next rustman evm fork removes temporary environments whose recorded Anvil no longer runs and says so. Without anvil on PATH, the command fails with exit code 2 and anvil not found; install Foundry (https://getfoundry.sh).

The toolkit’s tests against a real Anvil are opt-in, so a plain cargo test never starts one: run them with RUSTMAN_ANVIL=1 cargo test -p rustman-evm --test anvil (Foundry on PATH). The jsonrpc-anvil CI job sets RUSTMAN_REQUIRE_ANVIL=1, which also turns a missing anvil into a failure.

Send methods

Signing and sending belong to the signing gate (evm-tx), which is not available in this build. Methods are refused by family, not by exact name, so new sending methods stay out. Every jsonrpc request, evm-call and agent call, and every kind: http request whose body is a JSON-RPC call or batch (an object with a method, or an array of them; rustman send, rustman run and the agent’s send_request), is refused before anything is sent, with exit code 4, when its method (in any case):

  • is in the personal_*, wallet_* (EIP-5792 and wallet RPCs), account_* (Clef) or signer_* namespace;
  • or has a name that, after its namespace, starts with send, sign, submitTransaction or postTransaction: eth_sendRawTransaction, eth_sendTransaction, eth_sendTransactionSync and eth_sendRawTransactionSync (EIP-7966), eth_sendRawTransactionConditional, eth_sendBundle, eth_sendPrivateTransaction, flashbots_sendBundle, eth_sign, eth_signTransaction, eth_signTypedData*.

The refusal reads:

signing and sending go through 'evm-tx' (signing gate)

The guard applies to rustman rpc, rustman run, the TUI and the MCP server. [evm] allow_raw_send_local is not honored in this build: a transaction can only be signed and sent through the signing gate (an evm-tx request with rustman evm send --sign or rustman run --sign, see EVM signing), so raw sends with these methods are refused on every chain, including 31337.

Typed JSON-RPC methods

Rustman knows the standard eth_*, net_* and web3_* read methods and the type of each param: address, quantity, data, block tag, hash, filter object, transaction object, bool. rustman rpc call builds the params from --param name=value, in the method’s order:

$ rustman rpc call {{rpc}} eth_getBalance --param address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --param block=latest
1 ETH
= 1000000000000000000 wei = 1000000000 gwei = 0x0de0b6b3a7640000

sends {"method":"eth_getBalance","params":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","latest"]}. Quantities take the unit forms above (--param position=10, 30 gwei), a block takes a decimal number, objects and lists are JSON, and an omitted block is latest. A native amount (eth_getBalance, eth_gasPrice, eth_maxPriorityFeePerGas, eth_blobBaseFee) is shown in the native currency of the environment’s pinned chain or, when it pins none, of the chain the node reports (rustman rpc call with an endpoint then sends eth_chainId, kept out of history), its other forms on stderr; --raw and --json keep the hex.

The params of a catalog method are checked before they are sent, however they were written (--param, PARAMS_JSON, a jsonrpc file, the TUI, an agent): a mixed-case address with a wrong EIP-55 checksum, non-hex data and an unknown block tag are refused, naming the param:

param 'address': invalid EIP-55 checksum

rustman rpc call with an endpoint exits 2, whether the params came from --param or PARAMS_JSON; elsewhere (a jsonrpc file, the TUI, an agent) the check is a method guard, with exit code 4 like the send methods. All-lowercase addresses carry no checksum and pass. Params given by name (an object) and methods outside the catalog are not checked. The TUI’s JSON-RPC pane shows a catalog method’s typed params next to its params, and the same check under them.

The @evm-read preset can be used in [jsonrpc] agent_read_only_methods to let agents call the read-only methods: eth_chainId, eth_blockNumber, eth_call, eth_estimateGas, eth_getBalance, eth_getCode, eth_getStorageAt, eth_getBlockBy*, eth_getTransaction*, eth_getLogs, eth_feeHistory, eth_gasPrice, net_version and web3_clientVersion.

Commands

Every command that calls a node takes --rpc <url or {{variable}}> (default: the environment’s {{rpc}}), --env, --var k=v, --timeout, --insecure and --json. The endpoint is identified first (eth_chainId, then web3_clientVersion): a pinned environment on the wrong chain is refused with exit code 4, and the JSON output carries an endpoint object with the chain and the node client. Output and errors are redacted.

rustman evm call

rustman evm call requests/token/balance.rman.yaml --env mainnet
rustman evm call --to 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --abi erc20 --function balanceOf vitalik.eth
rustman evm call --to 0x5FbDB2315678afecb367f032d93F642f64180aa3 --abi out/Vault.sol/Vault.json --function balance --block 19000000 --estimate --trace

A request file (path, id or name) runs with its assertions and captures; an ad-hoc call takes --to, --abi (a built-in name or a path from the workspace root), --function and the arguments as positional values (JSON lists and booleans as JSON, anything else as text), with --block, --from and --value. The node status line goes to stderr; the outputs, the gas estimate and the trace (or tracing not supported by geth) to stdout:

balance = 250.00 USDC (250000000)
gas estimate: 21000
tracing not supported by geth

Exit codes: 0 when every assertion passed, 1 when one failed, 2, 3 or 4 when the call could not run (see Exit codes). --json prints the evm record with passed, assertions and captures.

rustman evm decode

Offline: no node, no workspace needed.

$ rustman evm decode --abi erc20 0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045000000000000000000000000000000000000000000000000000000000000000a
transfer(to=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045, amount=10)
$ rustman evm decode --abi erc20 0x4e487b710000000000000000000000000000000000000000000000000000000000000012
reverted: Panic(0x12) division or modulo by zero
$ rustman evm decode --abi erc20 --topic "Transfer(address,address,uint256)" --topic 0x…from --topic 0x…to 0x…amount
Transfer(from=0x…, to=0x…, value=7)

Call data is decoded when its selector names a function of the ABI, else as revert data; with --topic (topic 0 first) the data is a log. Data no function or error of the ABI decodes is an error with exit code 2.

rustman evm logs

rustman evm logs --address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --event "Transfer(address,address,uint256)" --max-events 5
rustman evm logs --heads --duration 1m
rustman evm logs --address 0xA0b8… --event "Transfer(address,address,uint256)" --from-block 20000000 --to-block 20000100

Without --from-block the command streams (see Head and log streams) until --max-events, --duration or Ctrl+C, then prints <n> event(s), <m> reorged on stderr; --poll-interval changes the 2 s HTTP polling. With --from-block (and --to-block, default latest) it runs one eth_getLogs over that range (a range that ends before it starts is exit code 2). The range is not capped here, as you chose it; the node may still refuse a range it finds too wide. Agents are capped at 10,000 blocks (evm_logs_query). --json prints one JSON object per log.

rustman evm tx

rustman evm tx 0xdeed52ec1e92d0ca8834284f39ed5e37ff6106b6bb09a9dc37fb6d1c01b0a8f6 --env mainnet

The transaction and its receipt (see Decoding); transaction not found with exit code 1 for an unknown or pending hash.

rustman evm block

rustman evm block            # latest
rustman evm block finalized --json
rustman evm block 20000000

Number, hash, parent, timestamp, miner, gas used and limit, base fee and transaction count. An unknown block is block not found (exit code 1); an unknown tag is a usage error (exit code 2).

rustman evm ens

$ rustman evm ens vitalik.eth --env mainnet
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
$ rustman evm ens 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --env mainnet
vitalik.eth

A reverse name is printed only when it resolves back to the address; otherwise <address> has no verified primary ENS name.

rustman evm fork

rustman evm fork --chain mainnet --block 20000000
rustman evm fork --chain 8453 --port 8546
rustman evm fork --env staging --json

--chain takes an environment name, a chain name or a chain id; --env and --rpc choose the endpoint as for the other commands. Prints the local URL (with --json, one object with url, ws_url, environment, chain_id and fork_block), writes the temporary fork-<chain> environment (see Local forks with Anvil) and waits for Ctrl+C, then stops Anvil and removes the environment. The upstream endpoint is never printed.

TUI

evm-call and evm-tx files open in an EVM pane with the tabs Function, Args, Block, Result, Trace and Events:

  • Function: a picker of the ABI’s functions (a built-in ABI, or a file ABI read from the workspace). Only view and pure functions are listed; a (or the mode key) shows every function, as read-only eth_call simulations. Enter chooses one: its name, or its full signature when the name is overloaded.
  • Args: one field per input, labelled with its name and Solidity type. Values may use {{variables}}.
  • Block: ←/→ cycle latest, finalized, safe, pending and earliest; a number or hash can be typed in the file.
  • Result: the status line (Ethereum Mainnet (1) · geth 1.14.11), the decoded outputs, the revert, and the gas estimate. u cycles the unit form of quantities: native units, wei, gwei and hex for balance-like outputs, token units for ERC-20 amounts, decimal and hex otherwise.
  • Trace: the call tree, or why there is none. Events: the decoded event timeline (the events each send’s simulated call emits, when the file reads events; the latest 1,000 lines), reorged logs marked REORGED.

Edits change only the top-level function, args and block lines of the file; comments and the other fields are kept. An evm-tx opens read-only with evm-tx: sign and send it with `rustman evm send --sign` or `rustman run --sign`; nothing was signed or sent. After a send, the status bar shows the chain and the node client of the endpoint, such as Base (8453) · geth 1.14.11.

Blockchain GraphQL presets

GraphQL endpoints that serve chain data get presets on top of the GraphQL client. A preset never changes what is sent: it formats what is shown, pages through subgraph lists, measures a subgraph’s freshness and links results into the toolkit.

PresetForDetected when the schema has
gethgeth’s EIP-1767 endpoint, usually <rpc>/graphqlQuery.block and Query.logs, and the Long and Bytes32 scalars
subgraphThe Graph and compatible indexersQuery._meta

The preset is detected from the active schema (schema_file or the schema cache) and shown in the TUI’s schema line (preset subgraph) and in rustman graphql query’s status line. A request file can name it with preset:; an explicit preset wins, and on a schema without its markers a warning is shown: schema does not look like geth EIP-1767 (or schema does not look like a subgraph).

version: 1
kind: graphql
name: Latest block
endpoint: '{{rpc}}/graphql'
preset: geth
schema_file: geth.graphql
document: '{ block { number hash gasUsed baseFeePerGas miner { address balance } } }'

Scalar display

With a preset active, BigInt, BigDecimal and Long values are shown as exact decimals (geth’s hex BigInt and Long included), Bytes and Bytes32 as 0x hex, and addresses in EIP-55 checksummed form: fields typed Address, and any other 20-byte 0x value, whatever its field name or type (Bytes, ID or String; a subgraph’s usual account { id }), as the TUI’s result links take them. A BigInt in an object that also has a decimals field can be shown in token units: "1000000000000000000000" with decimals: 18 is 1000 (18 decimals).

This is display only. Assertions, captures, history and --json output read the raw JSON as the server sent it, so a data assertion compares the lowercase address the subgraph returned:

assertions:
  - data: {path: $.token.owner, equals: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'}

rustman graphql query prints formatted values; --raw prints them as received and --units adds the token-unit form. In the TUI, u in the response cycles formatted, units and raw, named at the end of the summary line. A formatted value is redacted again before it is shown, so a checksummed address that is a secret never appears.

Pagination

For subgraph lists, rustman graphql query <request> --paginate (and Alt+G in the TUI) sends the operation again and again, concatenating the pages into one array per paginated field. A paginated field is a top-level field with a first argument:

  • id_gt (the default) follows where: {id_gt: $var}: the variable starts at "" (unless the request sets it) and is set to the last item’s id;
  • --paginate skip follows skip: $var, starting at 0 and moved on by first.
query Transfers($last: ID) {
  transfers(first: 1000, where: {id_gt: $last}) { id from to value transactionHash }
}

Paging stops when a page returns fewer than first items, after --max-pages pages (default 20, at most 1000) with the warning stopped at --max-pages 20, or once the page bodies read reach 64 MiB in all, with the warning stopped after N pages: they reached the 64 MiB pagination limit. A later page that fails (a transport error, a result with errors, or a body that is not a GraphQL result) ends paging: the pages read before it are kept as the result, followed by the failing page’s own errors and the error --paginate: page N failed (<why>); keeping the N-1 pages read before it, and the exit code is non-zero. A failing first page is the result as it is. An operation without a field taking first, or without the cursor variable, fails before anything is sent, with an error starting graphql: --paginate: and exit code 3. Pagination applies to HTTP operations, not subscriptions.

Subgraph freshness

For the subgraph preset, Rustman sends { _meta { block { number } hasIndexingErrors } } to the subgraph and reads the chain head (eth_blockNumber) from the environment’s EVM node, the rpc variable. The node gets none of the GraphQL request’s headers or auth: a subgraph API key never reaches it. The lag is shown in the TUI and on rustman graphql query’s status line as lag 12 blocks; without an rpc variable it is unknown (no rpc). rustman run reads freshness only for requests with a subgraph assertion:

version: 1
kind: graphql
name: Indexer is fresh
endpoint: '{{subgraph}}'
schema_file: subgraph.graphql
document: '{ tokens(first: 1) { id totalSupply decimals } }'
assertions:
  - subgraph: {max_lag_blocks: 50}

The assertion fails when the lag exceeds the bound (subgraph lag 120 blocks exceeds 50), when hasIndexingErrors is true (subgraph has indexing errors), and without an rpc variable (cannot compute lag: no rpc configured). On a request without the subgraph preset it is an error.

In the TUI, L in the response lists the addresses (20-byte values) and transaction hashes (32-byte values in fields named hash, transactionHash, txHash, …) of a result with a preset. Choosing one offers:

  • Decode transaction: the transaction and its receipt decoded, as rustman evm tx shows them;
  • Show balance: the address’s balance in the native currency;
  • Call contract: a new evm-call tab to the address (ERC-20 ABI, totalSupply) to edit;
  • Open in explorer: the explorer page from the known-chain registry, when the environment pins chain_id.

Lookups read the environment’s rpc, check its chain_id pin first, use read-only methods only and are redacted. Links whose value is a secret are left out.

Agent tools

rustman mcp serve registers six read-only tools (see the tool reference):

ToolDoes
evm_callA saved evm-call request (path) or an ad-hoc call (rpc, to, abi, function, args, block, from, estimate), with its assertions.
evm_decodeOffline decoding of call data, revert data or a log.
evm_txA transaction and its receipt, decoded.
evm_blockA block by number, tag or hash.
evm_logs_queryLogs over a block range of at most 10,000 blocks: wider is range too large (max 10000 blocks), before anything is sent.
evm_ensForward and verified reverse ENS resolution.

Every node call goes through the session’s rpc_call sender, so the safety policy’s host allowlist and rate limit apply (a host outside it is blocked), and through the JSON-RPC method guards. Results are redacted. No tool accepts a signed transaction, and none can call eth_sendRawTransaction, eth_sendTransaction or a signing method.

Exit codes

CodeWhen
1An evm assertion (or another assertion) failed; not found (an unknown transaction or block, an ENS name without an address).
2A bad file, setting, argument or ABI; explorer fetch disabled; an agent log range over 10,000 blocks; anvil not found.
3The node or the explorer could not be reached, or answered with an error; a node without state overrides.
4Refused: a chain mismatch, an evm-tx given to rustman send (only the signing gate sends one), an ens_rpc that is not mainnet, a call a method guard refuses (a send method, or catalog params of the wrong type), or a host the safety policy blocks.

EVM signing

kind: evm-tx requests are the only way Rustman signs or sends a transaction. Every one goes through the signing gate of the rustman-evm-signing crate; the agent interface (rustman-mcp) does not depend on that crate, so agents can never reach a signer.

This page covers signer configuration (keystore and OS keychain; hardware wallets are not available yet), the refusal of raw private keys, the gate preconditions, fees, gas and nonces, the confirmation prompt, sending, the receipt wait and the audit record that rustman evm send produces, and signing in rustman run --sign. A plain rustman run skips evm-tx files as skipped (signing not requested), which is not a failure.

Signing happens on the command line only (--sign). The TUI does not sign in this release: an evm-tx file opens read-only there, with a notice pointing to rustman evm send --sign and rustman run --sign. TUI signing is tracked in #112.

Opting in

Signing is off by default. A workspace opts in in rustman.toml:

[evm]
allow_signing = true

Without it, rustman evm send refuses before reading anything else:

error: signing is disabled for this workspace; set [evm] allow_signing = true

Signers

Signers are configured in [evm.signers.<id>]. Each is exactly one of:

[evm.signers.deployer]
keystore = "~/.foundry/keystores/deployer"   # Web3 Secret Storage JSON (Foundry, geth, MetaMask exports)
password = "{{secret:deployer_pw}}"          # optional; prompted (no echo) on a terminal otherwise

[evm.signers.ci]
keychain = true                              # stored by `rustman evm signer import ci`

A signer id is 1 to 64 letters, digits, - and _, and not hex-like (no 0x prefix, not 32 or more hex digits). A request picks its signer with signer: <id>; --signer <id> (or the RUSTMAN_EVM_SIGNER environment variable) overrides it. An unknown id is a configuration error (exit code 2) listing the configured ones, and an invalid one is refused the same way; neither error repeats the value given, since a mistyped key could be in it:

error: unknown signer (configured: ci, deployer)

Keystore signers

The keystore is decrypted in memory only when the gate needs the signer, after the chain check. The file is read once (at most 64 KiB) and its key derivation is checked before it runs: kdf must be scrypt (n <= 2^18, r <= 8, p <= 4, n × r × p <= 2^21: geth’s standard n = 2^18, r = 8, p = 1 is the ceiling) or pbkdf2 (c <= 10 000 000) with matching parameters and dklen 32, so a hostile keystore cannot hang the process; standard Foundry, geth and MetaMask keystores are well inside. Anything else is refused as a configuration error (exit code 2). The cipher is checked the same way: cipher must be aes-128-ctr, cipherparams.iv exactly 32 hex digits, ciphertext 64 and mac 64, every field valid hex (malformed keystore otherwise, exit code 2); after decryption, a keystore with an address must decrypt to that address. ~/ is the home directory; a relative path starts at the workspace root. The password is resolved like any variable, so keep it in a secret (a {{secret:provider/path}} reference or a variable listed in the environment’s secrets); its value is redacted from every output. Without password, the password is asked on the terminal with no echo (a terminal that cannot be read is reported with its I/O error, exit code 2); without a terminal, the gate refuses:

error: signer 'deployer': the keystore password is needed; set password = "{{secret:...}}" in [evm.signers.deployer] or run in a terminal

A wrong password is refused with signer '<id>': wrong keystore password (exit code 4).

Keychain signers

rustman evm signer import ci          # no-echo prompt
rustman evm signer import ci < ci.key # or the first line of stdin

The key (64 hex digits, 0x optional) is stored in the OS keychain (macOS Keychain, Windows Credential Manager, the Secret Service on Linux) under the rustman service as evm-signer/<id>, and the command prints the address and the [evm.signers.<id>] keychain = true lines to add. The key is never printed or written to a file: with RUSTMAN_SECRET_STORE=file, or where there is no keychain, the import fails with no OS keychain is available; signer keys are never stored in files.

Hardware wallets

Hardware-wallet signers (Ledger, Trezor) are not available yet. A ledger = "m/44'/60'/0'/0/0" or trezor = "..." signer is read from rustman.toml but refused when used, in every build (the hw-wallet cargo feature is reserved for the drivers and links none yet), with a configuration error (exit code 2) and nothing signed or sent:

error: signer 'cold': Ledger signing is not available yet; use a keystore or keychain signer

Hardware-wallet support is tracked in #111.

Raw private keys are refused

Anything that looks like key material is refused wherever a signer value can come from: a run of 60 or more hex digits (with or without 0x, so a key with a digit missing or extra padding too) and a seed phrase (12, 15, 18, 21 or 24 lowercase words). The places checked are the request’s signer, an environment variable, a --var, --signer, RUSTMAN_EVM_SIGNER, any value in [evm.signers] (and any private_key, key, secret_key, mnemonic or seed field there), and the id given to rustman evm signer import. The refusal never echoes the key:

error: raw private keys are not accepted; import the key with 'rustman evm signer import'

Key material only lives in memory inside Secret holders and is zeroized when dropped: decrypted keystore bytes, keychain entries, passwords and the signing key itself.

The gate

rustman evm send <request> (and rustman run --sign for each evm-tx file) checks, in this order, and stops at the first refusal (exit code 4 unless noted):

  1. [evm] allow_signing = true.

  2. No key material as the request’s signer, --signer or RUSTMAN_EVM_SIGNER.

  3. --sign. Without it, the decoded preview is printed and the command refuses with add --sign to sign and send, before any signer is looked up. The preview names the signer only when it is a configured id ((not a configured signer) otherwise), and every value stays on its line (newlines and control characters show as \u{…}):

    evm-tx transfer
      to      0x5FbDB2315678afecb367f032d93F642f64180aa3
      call    transfer(0x70997970C51812dc3A010C7d01b50e0d17dc79C8, 10)
      value   0
      signer  deployer
    error: add --sign to sign and send
    
  4. No transaction field (to, args, value, gas, the fees, nonce) comes from a secret: the confirmation must show what is signed, so evm-tx: 'args' comes from a secret; a transaction field must be shown in the confirmation, so it cannot hold a secret; nothing was signed or sent.

  5. A valid signer id configured in [evm.signers] (exit code 2 when missing, invalid or unknown).

  6. The environment pins chain_id: signing requires 'chain_id' in environment '<env>' otherwise (or signing requires an environment with 'chain_id'; select one with --env without an environment).

  7. The node’s eth_chainId, asked again right before signing, equals the pin: chain mismatch: environment 'dev' expects 31337 (Anvil/Hardhat local), endpoint reports 11155111 (Sepolia) otherwise.

  8. The transaction can be confirmed: a terminal, or --yes-local on a local chain (see Confirmation). Without one the gate refuses here, before the key is unlocked or anything simulated.

  9. The signer unlocks.

  10. The simulation, eth_call from the signer at pending and eth_estimateGas, succeeds. A revert is shown decoded and refused:

error: simulation reverted: InsufficientBalance(available=5, required=10); nothing was signed or sent (add --force-revert to sign anyway)

With --force-revert the gate goes on, prints warning: SIMULATION REVERTED: ..., and the confirmation starts with the same warning. A reverting call has no gas estimate, so a forced transaction needs gas in the request.

  1. The confirmation (see below).
  2. eth_chainId once more, immediately before signing.

Nothing is signed or sent by a refusal, and loading a workspace with evm-tx files never calls a node or touches a signer. Ctrl+C at any prompt, or anywhere before the transaction is signed, stops with interrupted; nothing was signed or sent and exit code 130; the gate checks once more right after the confirmation and right before signing. Once the transaction is signed, Ctrl+C no longer drops it: the send is awaited, and Ctrl+C during the receipt wait ends it with the audit record ("status": "pending", or broadcast-unknown when the send failed), error: interrupted; transaction 0x… was sent and its receipt was not awaited; check the explorer for 0x…, the explorer link, and exit code 3.

Fees, gas and nonces

Values set in the request win; the rest are suggested by the node and labelled (suggested) in the confirmation. Fees take every quantity form (30 gwei, 0x6fc23ac00, wei as a decimal integer).

  • EIP-1559 (the default, type: eip1559): eth_feeHistory(10, "latest", [50]). max_priority_fee is the median of the 50th-percentile rewards of those blocks; max_fee is 2 × the latest base fee + the priority fee. A node that reports no base fee is an error asking for type: legacy. gas_price is refused on an EIP-1559 transaction, and a max_priority_fee above max_fee is refused.
  • Legacy (type: legacy): gas_price, by default eth_gasPrice; EIP-155 replay protection embeds the chain id. max_fee and max_priority_fee are refused.
  • Gas limit: gas, by default the simulation’s eth_estimateGas × 1.2, rounded up.
  • Ceilings: a node cannot inflate what is signed. A suggested max_fee, max_priority_fee or gas_price above 10 000 gwei, or a gas limit from the estimate above 30 000 000, is refused (exit code 4) with a message asking to set the value in the request; values set in the request are not capped.
  • Max cost: --yes-local never signs a transaction whose max cost (gas limit × max fee, plus the value) is above [evm] max_cost, a decimal amount of the chain’s native unit (default "1", 1 ETH): max cost 300 ETH is above [evm] max_cost (1 ETH); --yes-local does not sign above it (confirm on a terminal, or raise [evm] max_cost); nothing was signed or sent (exit code 4). On a terminal the summary starts with WARNING: max cost … is above [evm] max_cost (…) and the user decides.
  • Nonce: nonce, by default eth_getTransactionCount(signer, "pending"). Within one process (one rustman evm send, or a whole rustman run --sign), later transactions of the same signer on the same chain count up from the last one sent instead of asking again; a transaction whose send failed counts too, since it may be out. A nonce too low or replacement underpriced answer is reported as the node sent it (exit code 3, see unknown broadcast) and nothing is retried.

Confirmation

Before signing, the decoded summary is printed:

  chain        Sepolia (11155111)
  signer       0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 (deployer)
  to           0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 (usdc.eth)
  call         transfer(to=0x70997970C51812dc3A010C7d01b50e0d17dc79C8, amount=10.00 USDC (10000000))
  value        0 ETH
  gas          55317
  max fee      16.5 gwei (suggested)
  priority fee 1.5 gwei (suggested)
  nonce        4
  max cost     0.0009127305 ETH
sign and send this transaction? [y/N]

The amount of an ERC-20 transfer, approve or transferFrom is shown in token units with the token’s decimals() and symbol() when the token answers them, and the raw integer stays in parentheses (the decimals come from the node). max cost is the value plus the gas limit at the max fee (or gas price). Only y or yes goes on; anything else cancels with cancelled; nothing was signed or sent (exit code 4). Input typed before a question is discarded when it is asked, so an answer typed ahead never confirms a summary not yet shown (on Unix; on Windows the console’s pending input is not discarded).

  • Chain 1 and [evm] protected_chains: after y, the chain name must be typed exactly (type the chain name (Ethereum Mainnet) to confirm:). Anything else cancels with the chain name did not match 'Ethereum Mainnet'; cancelled; nothing was signed or sent. Chain 1 and the other built-in chains always use their built-in name; a protected chain configured in [evm.chains.<id>] without a name is never confirmed (protected chain <id> has no name to type; set [evm.chains.<id>] name).

  • No terminal (CI, a pipe): signing is allowed only on chain 31337 and the chain ids of [evm] headless_signing_chains (test and private chains only: a built-in mainnet such as Base, OP Mainnet, Arbitrum One or Polygon PoS there is a configuration error), and only with --yes-local, which confirms without a prompt (confirmed by --yes-local on Anvil/Hardhat local (31337)). Elsewhere:

    error: signing on Sepolia (11155111) needs an interactive confirmation; without a terminal only chain 31337 and [evm] headless_signing_chains can be signed on, with --yes-local
    

    On a local chain without --yes-local: no terminal to confirm on; add --yes-local to sign on Anvil/Hardhat local (31337) without a prompt.

  • --yes-local never skips the prompt of another chain: on a terminal it prints a note and asks as usual.

[evm]
allow_signing = true
protected_chains = [8453]            # Base: type its name too
headless_signing_chains = [1337]     # another local devnet CI may sign on
max_cost = "0.5"                     # --yes-local signs up to 0.5 of the native unit (default 1)

Every value of the summary, and the chain name in the typed-name question, is kept on one line: newlines, tabs, control, bidi and zero-width characters show as \u{…}. The summary is never passed through secret redaction (a short secret would hide part of an address); it holds no secret: no password, and no transaction field from a secret (refused at step 4).

Sending and the receipt

The signed transaction is sent with eth_sendRawTransaction, the one place that method is allowed (every jsonrpc request, evm-call, agent call, and kind: http request whose body is a JSON-RPC call or batch is refused it, and every other sending method). The hash is printed (sent 0x…), then the receipt is awaited:

  • --confirmations N (default 1, the block that includes it) blocks must be on top of the head;
  • --receipt-timeout (default 120s): when it passes, the command prints error: transaction 0x… was sent but not mined within 120s and the explorer link (when the chain has an explorer), and exits with code 3. The transaction may still be mined later: check it with rustman evm tx <hash>.
  • A receipt poll that fails (the node is down, rate-limited, …) is tried again, waiting twice as long after each failure in a row (up to 5 s), until the receipt timeout. When the last poll still failed, the command prints error: transaction 0x… was sent but its receipt could not be read within 120s: <the node's error> and the explorer link, and exits with code 3; the same happens when the mined transaction cannot be decoded. The audit record is written either way, with "status": "receipt-unknown".

Unknown broadcast

When eth_sendRawTransaction itself fails (the connection drops or times out, the node answers a 5xx or an RPC error such as nonce too low, or it answers something other than the transaction’s hash), the transaction may have been broadcast all the same. The hash is computed locally from the signed bytes (keccak-256 of the EIP-2718 encoding), the failure is printed as a warning (warning: eth_sendRawTransaction: …; transaction 0x… may have been sent; waiting for its receipt; a mismatch names both hashes: the node answered hash 0x…, expected 0x…), and the receipt of the local hash is awaited as usual. If it comes, the transaction is checked like any other, with the failure kept as a warning. If it does not, the command prints error: transaction 0x… may have been sent (<the failure>) but no receipt came within 120s; check the explorer for 0x… before sending it again, the explorer link (when the chain has one), and exits with code 3; the audit record keeps the local hash with "status": "broadcast-unknown". Check the hash (explorer or rustman evm tx <hash>) before signing the transaction again.

The mined transaction is printed decoded, as rustman evm tx shows it, with explorer: https://…/tx/0x…. A transaction that reverted on chain exits with code 1.

Receipt assertions and captures

The request’s assertions and captures run on the receipt:

assertions:
  - evm: {emits: "Transfer(address,address,uint256)", where: {to: "{{bob}}"}}
  - evm: {gas_lt: 80000}
  - json: {path: $.receipt.status, equals: success}
captures:
  - {var: mined_in, from: evm_receipt, field: blockNumber}
  - {var: moved, from: evm_event, event: "Transfer(address,address,uint256)", field: value}

emits and evm_event read the receipt’s logs decoded with the request’s ABI; gas_lt reads the gas used; evm_receipt reads contractAddress, blockNumber, status (success or reverted) and gasUsed. A failed assertion prints fail: ... and exits with code 1.

Audit record

Every sent transaction is recorded in request-history (unless --no-history or [history] enabled = false), also when the receipt timed out ("status": "pending"), could not be read ("status": "receipt-unknown"), or the send itself failed ("status": "broadcast-unknown", with the locally computed hash). The entry’s record.evm holds:

{
  "kind": "evm-tx", "chain_id": 31337, "chain": "Anvil/Hardhat local",
  "signer": {"id": "deployer", "address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"},
  "hash": "0x…", "to": "0x…", "to_name": null, "call": "add(amount=2)",
  "value": "0", "nonce": 0, "gas_limit": "55317",
  "fees": {"type": "eip1559", "max_fee": "…", "max_priority_fee": "…", "suggested": true},
  "forced_revert": false, "status": "success", "block": 1,
  "gas_used": "…", "effective_gas_price": "…", "fee": "…", "explorer": null
}

The signed bytes, the signature, the password and the key are never stored or shown, and the entry cannot be replayed (rustman history replay would not sign again).

Exit codeMeaning
0Sent, mined, and every assertion passed.
1Mined, but it reverted on chain or an assertion failed.
2A configuration error: an unknown or invalid signer, a missing keystore, a keystore above the key-derivation limits or malformed, a mainnet in [evm] headless_signing_chains, an invalid [evm] max_cost, an unreadable password prompt, no keychain, a hardware-wallet signer.
3The node could not be reached, or the transaction’s send failed and no receipt came for its local hash (broadcast-unknown: it may have been sent), or the transaction was sent but its receipt did not come within --receipt-timeout or could not be read.
4A gate refusal: signing disabled, key material as a signer, no --sign, no chain_id pin, a chain mismatch, no way to confirm (no terminal on a non-local chain), a wrong or missing keystore password, a transaction field from a secret, a max cost above [evm] max_cost under --yes-local, a reverting simulation, a declined confirmation or a wrong chain name.
130Ctrl+C before the transaction was signed; nothing was signed or sent. Ctrl+C after it exits with code 3, its audit record kept.

In rustman run

rustman run skips evm-tx files unless --sign is passed; they are reported as skipped (signing not requested) and are not failures. With --sign, each evm-tx file of the run goes through the same gate as rustman evm send, one at a time and in run order:

rustman run . --env anvil --sign --yes-local
  • The signer is the request’s signer, or RUSTMAN_EVM_SIGNER.
  • The preview, the summary and the receipt go to stderr; stdout is the run’s report.
  • --yes-local (which requires --sign) confirms without a prompt on chain 31337 and [evm] headless_signing_chains only. Without a terminal, every evm-tx file on another chain is refused, and the run exits with code 4. On a terminal, each transaction is confirmed as with rustman evm send.
  • Nonces count up across the run: two transactions of one signer use the pending count, then that count + 1, without asking the node again.
  • A refusal is the request’s error and makes the run exit with code 4; a receipt timeout, an unreadable receipt or an unknown broadcast is an error (exit code 3), with the audit record kept; Ctrl+C before a transaction is signed skips it as interrupted (exit code 130), and Ctrl+C during its receipt wait keeps its audit record (pending) and makes the interrupted run exit with code 3; a failed receipt assertion or a transaction that reverted on chain fails the request (exit code 1). The receipt timeout is 120 s and one confirmation is awaited.

Agents can never sign

The agent interface (rustman mcp serve) has no tool that signs, sends a transaction, imports a key or changes signing configuration, and rustman-mcp does not link the rustman-evm-signing crate at all: a test walks Cargo.lock and fails if anything the agent crate depends on reaches it. An agent that names a saved evm-tx file in send_request is refused before anything is resolved or sent:

evm-tx requests cannot be sent through the agent interface

run_collection skips evm-tx files like rustman run does, and rpc_call refuses eth_sendRawTransaction and the other sending methods (see send methods).

CI on Anvil

A pipeline can sign on a local Anvil chain without a terminal: chain 31337 with --yes-local, a keystore of one of Anvil’s dev accounts, and its password from the CI’s secrets through the env provider (secret providers). The files below are the ones Rustman’s own CI runs (crates/rustman-cli/tests/docs_evm_signing.rs, in the jsonrpc-anvil job).

# rustman.toml
[workspace]
name = "counter"
version = 1

[secret_providers.ci]
type = "env"

[evm]
allow_signing = true

[evm.signers.deployer]
keystore = "keys/anvil0.json"
password = "{{secret:ci/DEPLOYER_PW}}"
# environments/anvil.yaml
chain_id: 31337
variables:
  rpc: http://127.0.0.1:8545
# add.rman.yaml
version: 1
kind: evm-tx
name: add
rpc: "{{rpc}}"
to: "0x5FbDB2315678afecb367f032d93F642f64180aa3"
abi: Counter.abi.json
function: add
args: ["2"]
signer: deployer
assertions:
  - evm: {emits: "Added(address,uint256,uint256)", where: {amount: "2"}}
  - evm: {gas_lt: 100000}
captures:
  - {var: mined_in, from: evm_receipt, field: blockNumber}

keys/anvil0.json is Anvil’s first dev account (0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266) encrypted with the password in DEPLOYER_PW, made once with cast wallet import anvil0 --interactive (it lands in ~/.foundry/keystores/anvil0). That key is public: use it on a local chain only, and never a real key in CI. Counter.abi.json is the ABI of a contract with add(uint256) that emits Added(address indexed by, uint256 amount, uint256 number); 0x5FbDB2315678afecb367f032d93F642f64180aa3 is where the first deployment of that account lands on a fresh Anvil. Deploy with Foundry or Hardhat (deployment is out of Rustman’s scope); Rustman’s own test installs the contract’s runtime code there with anvil_setCode instead.

The CI steps, with DEPLOYER_PW from the CI’s secrets:

anvil --port 8545 &
rustman evm send add --env anvil
rustman evm send add --env anvil --sign --yes-local
rustman evm send add --env anvil --sign --yes-local --confirmations 1
rustman run . --env anvil --sign --yes-local

The first send prints the decoded preview and exits with code 4 (no --sign); the next two sign without a prompt (confirmed by --yes-local on Anvil/Hardhat local (31337)), with nonces 0 and 1, wait for the receipt, check the Added event and the gas, and exit with code 0. The run signs the workspace’s evm-tx files the same way (nonce 2) and exits with code 0. Each sent transaction is in the history’s audit record; the password, the key and the signed bytes are in none of the output or files. The same files with an environment whose chain_id is not 31337 (or in [evm] headless_signing_chains) are refused without a terminal, so a CI job cannot sign on a real network by accident.

Probing EVM providers

rustman evm probe checks one or more EVM JSON-RPC providers and compares them: which methods each one supports, whether it keeps historical state (archive), how fast each method answers, whether WebSocket subscriptions work, where its rate limit is, and whether the providers agree with each other. The result is a standard exploration report (rustman.report/v1, kind: exploration, subject: evm-rpc), so every report format, rustman report diff and --fail-on work as for rustman explore run.

A probe only reads. It sends methods from a fixed read-only catalog; eth_sendRawTransaction, eth_sendTransaction and every signing method are refused before anything is sent (exit code 4), and the send-method guard applies on top.

rustman evm probe https://rpc-a.example https://rpc-b.example

Providers

Each argument is a provider:

  • a URL: https://, http://, wss:// or ws://;
  • a {{variable}}, resolved with the active environment (--env), such as {{rpc}};
  • the name of an environment of the workspace: its {{rpc}} variable is probed, with that environment’s secrets and chain_id pin.
rustman evm probe mainnet-a mainnet-b --methods all --report html=probe.html

API keys in URLs are secrets: keep them in environment secrets (https://eth-mainnet.example/v2/{{alchemy_key}}). Output, reports and viz events show «redacted:alchemy_key». Credentials typed into a literal URL are hidden too, as «redacted:url-key», in errors, output and the report’s endpoints: the userinfo (user:password@), the values of key-like query parameters (apikey, api_key, key, token, access_token, auth, secret, or any name containing one of those words), and path segments of 20 or more letters, digits, - and _ that mix letters and digits (not 0x hex values such as block hashes and addresses). The probe then warns once that the URL holds what looks like an API key and suggests storing it as a secret, written {{NAME}} or {{secret:<provider>/<path>}}.

All providers must be on one chain. When they are not, the probe stops before any other request, with exit code 2:

error: providers report different chains (1, 11155111)

An environment that pins chain_id must match its provider, as for every EVM command (exit code 4 otherwise).

Checks

CheckWhat it does
Method matrixCalls each --methods method with valid minimal parameters (built from the provider’s head block) and classifies it supported, unsupported (-32601 or “method not found”), restricted (an auth or plan error, HTTP 401/403) or error.
Archiveeth_getBalance of --address at block 1,000,000 (or --block), never closer than 10,000 blocks to the head: archive when it answers, full on a pruned-state error (missing trie node), unknown otherwise.
Latencyp50, p95 and max per method per provider, over every request of the probe. HTTP latency is the time on the wire (request sent to last response byte), so the wait for --rate pacing is never counted; WebSocket latency is timed from the paced send.
BlocksThe last 8 blocks: block times and gas used, for the viz plots.
SubscriptionsFor ws:// and wss:// providers: eth_subscribe to newHeads (supported once a head arrives within 30 s, timeout when none does) and to logs (supported once the subscription is accepted, since matching logs can be rare: when none arrives within the timeout the detail says subscribed; no log arrived before the timeout instead of reporting timeout); unsupported when the subscription is refused.
TraceWith --call <address>:<calldata>, the call is traced (debug_traceCall, then trace_call) for the call-trace graph.
ConsistencyWith two or more providers, see below.
Rate limitOnly with --rate-discovery, see below.

--methods takes standard (the default), all, or a list:

rustman evm probe https://rpc-a.example --methods eth_call,eth_getBalance,debug_traceCall

standard holds eth_chainId, web3_clientVersion, net_version, eth_blockNumber, eth_getBlockByNumber, eth_getBlockByHash, eth_syncing, eth_gasPrice, eth_maxPriorityFeePerGas, eth_feeHistory, eth_getBalance, eth_getCode, eth_getTransactionCount, eth_getStorageAt, eth_call, eth_estimateGas, eth_getLogs, eth_getTransactionByHash, eth_getTransactionReceipt, debug_traceCall and trace_call. all adds eth_getBlockReceipts, eth_getBlockTransactionCountByNumber, eth_getUncleCountByBlockNumber, eth_createAccessList, eth_getProof, eth_simulateV1, eth_blobBaseFee, debug_traceTransaction, trace_transaction, trace_block, txpool_status, net_listening and net_peerCount.

Consistency between providers

With two or more providers, the probe compares:

  • the head: eth_blockNumber on every provider, 5 samples over 10 s (--drift-interval sets the time between samples). A provider behind the highest head by more than --max-drift blocks (default 3) on every sample is a medium finding, head drift 8 blocks;
  • at one fixed block, 10 below the lowest head (so reorgs near the head cannot cause false alarms): the block hash (eth_getBlockByNumber), the balance of --address (eth_getBalance) and, with --call, the eth_call result. A provider that disagrees with the first one is a high finding whose evidence holds both answers.
rustman evm probe https://rpc-a.example https://rpc-b.example --call 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48:0x18160ddd

Rate-limit discovery

--rate-discovery sends eth_blockNumber at 5, 10, 20 and 40 req/s, one second per step, never above --max-rate (default 40). It stops at the first HTTP 429 or JSON-RPC rate-limit error (-32005), waits out its Retry-After, and reports the last rate that passed: rate limit ≈ 20 req/s (an info finding). Without the flag no rate discovery runs.

rustman evm probe https://rpc-a.example --rate-discovery --max-rate 20

Safety and budgets

Every request passes the safety policy: each provider’s host only, 10 req/s and 4 requests in flight per provider (--rate, --concurrency, or [safety] in rustman.toml), and a budget of 500 requests per provider (--budget, at least 1). A provider that reaches its budget is not probed further: its remaining checks are skipped (budget), and the report says so with an info finding. A host listed in [safety].production_hosts, or an environment marked production: true, needs --production <host>.

Reports and exit codes

The probe prints a summary per provider (archive state, subscriptions, rate limit, and each method with its support and latency). --report <format>=<path> (repeatable) writes the report as json, junit, markdown, html or sarif; the method matrix is the report’s coverage section (methods × providers; each cell’s class is supported, unsupported, restricted, error or skipped (budget)), and the EVM details are in its evm section. Provider error messages are cut to 2 KiB in the report, and finding evidence to 16 KiB; the call-trace graph keeps at most 1000 frames (a final … N more frames omitted node counts the rest), and a frame’s error text is cut to 256 bytes.

rustman evm probe https://rpc-a.example https://rpc-b.example --report json=probe.json --report sarif=probe.sarif
CodeMeaning
0No finding at or above --fail-on (default high).
1A finding at or above --fail-on, such as providers disagreeing on state.
2Bad flags, or providers on different chains.
3A provider could not be reached.
4A refusal: a write method in --methods, a chain pin mismatch, an unconfirmed production host.
130Interrupted (Ctrl+C).

Dashboards

--viz sends the results as viz protocol chain_probe events when the probe finishes (they are not streamed while it runs): the data of a provider × method latency heatmap, block-time and gas plots, and a call-trace graph for --call. The bundled viz companion has no chain_probe view yet, so today it does not draw them: the probe completes normally, warns that the companion has no such view and suggests --report html=… instead. A companion that advertises the chain_probe view receives the events.

Plugins

Plugins extend Rustman with WebAssembly components: in-house auth schemes, domain-specific assertions, value generators, body transformers, importers, request kinds and report formats. Workspaces travel through Git, so a plugin is treated as untrusted code. It runs in a sandbox, gets nothing the workspace does not grant it in rustman.toml, and is pinned by the sha256 of its bytes.

The behavior is specified in openspec/specs/plugins. This page covers the plugin package and manifest, the rustman plugin commands, declaring and pinning plugins, URL sources, the grant vocabulary, the sandbox and its limits, trust, the extension points wired so far, the plugin API, and writing and testing plugins with the SDK, its templates and the test harness.

Plugin support is the default cargo feature plugins of rustman-cli; cargo build --no-default-features builds Rustman without wasmtime.

The plugin package

A plugin is a WebAssembly component (.wasm) built against the rustman:plugin@1.0.0 WIT package, plus a manifest, rustman-plugin.toml:

# plugins/hmac/rustman-plugin.toml
name = "hmac"
version = "0.2.0"
api = 1
extension_points = ["auth"]
capabilities = ["clock", "secrets:read", "net:auth.example.com"]
description = "HMAC request signing for the Acme API"
component = "hmac.wasm"
FieldRequiredMeaning
nameyeskebab-case (aws-sigv4, faker)
versionyessemver (0.3.1)
apiyesthe plugin API major the component was built against
extension_pointsyesone or more of auth, assertion, generator, transformer, importer, kind, report
capabilitiesyes (may be empty)what the plugin may be granted: a class (clock, random, env, fs:read, net, secrets:read) or one exact grant (env:HOME, net:auth.example.com)
descriptionnoshown with the plugin
componentnofor a folder source: the component, relative to the manifest (default plugin.wasm)

A missing field fails with an error naming it, for example plugin hmac: rustman-plugin.toml: missing field 'version'. An unknown extension point fails with plugin hmac: unknown extension point 'telemetry'.

The manifest can also be embedded in the component, as a custom section named rustman-plugin.toml. A URL source must embed it, since only the .wasm file is downloaded; embedded, the manifest is covered by the sha256 pin. For a .wasm file source, an embedded manifest is used over a rustman-plugin.toml next to the file; a folder source always uses the folder’s manifest.

Plugin files are read before the set is trusted (by plugin list, the trust prompt and the pin check of every headless command), so they are read defensively: a component, a rustman-plugin.toml, a cached download or rustman.lock must be a regular file, and a symbolic link is followed only when it resolves to a regular file inside the workspace. A FIFO, a device (such as a committed plugins/evil.wasm -> /dev/zero), a socket or a link out of the workspace is refused at once with exit code 2, for example plugin evil: <path>: resolves outside the workspace or plugin evil: <path>: not a regular file. A component or cached download may be at most 20 MiB and a rustman-plugin.toml at most 256 KiB (plugin <name>: <path>: larger than 262144 bytes); rustman.lock at most 1 MiB.

Each extension point is a world of the WIT package (auth, assertion, generator, transformer, importer, kind, report), and the component must export the interface of every extension point its manifest declares (rustman:plugin/auth-scheme for auth, and so on). The WIT source ships with the rustman-plugin-sdk crate in crates/rustman-plugin-sdk/wit/plugin.wit.

Declaring plugins in rustman.toml

Only plugins declared in rustman.toml are loaded. A plugin’s files sitting in the workspace (say plugins/hmac/) do nothing until a [plugins.hmac] table names them.

# rustman.toml
[workspace]
name = "shop"
version = 1

[plugins.hmac]
source = "plugins/hmac"
sha256 = "4f9c1b0e7a3d5c2e8b6a9f0d1c3e5a7b9d2f4a6c8e0b1d3f5a7c9e1b3d5f7a90"
grants = ["clock", "secrets:read:hmac_key"]
limits = { cpu_ms = 200 }

[plugins.faker]
source = "https://plugins.example.com/faker-1.4.0.wasm"
sha256 = "0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9"
grants = ["random"]
KeyMeaning
sourcea workspace-relative path (a .wasm file with rustman-plugin.toml next to it, or a folder holding the manifest), or an https URL
sha256the sha256 of the .wasm file, 64 hex digits
grantswhat the plugin may do (see Grants); default []
limits{ cpu_ms, memory_mib }, per call (cpu_ms is execution time: wall time minus host calls); defaults 100 ms and 64 MiB, at most 10000 ms and 1024 MiB

The table name is the workspace’s name for the plugin and must be kebab-case. A path source must stay inside the workspace. Keys other than these are refused.

Managing plugins

rustman plugin add ./plugins/hmac                     # a folder or .wasm file inside the workspace
rustman plugin add https://plugins.example.com/hmac-0.2.0.wasm --name hmac
rustman plugin list
rustman plugin verify                                 # in CI: exit 0, or 2 on a mismatch
rustman plugin remove hmac

rustman plugin add <path|url> reads the plugin (a URL source is downloaded and cached), checks its manifest and compiles its component (it must import only the host interfaces and export its extension points; no plugin code runs), and prints the manifest and the capabilities it requests:

plugin hmac 0.2.0 (API 1)
  HMAC request signing for the Acme API
  extension points: auth
  requested capabilities: clock, secrets:read
  sha256: 4f9c1b0e7a3d5c2e8b6a9f0d1c3e5a7b9d2f4a6c8e0b1d3f5a7c9e1b3d5f7a90
added [plugins.hmac] to rustman.toml with grants = [] and updated rustman.lock

It then appends a [plugins.<name>] table with source, sha256 and grants = [] to rustman.toml (the rest of the file is kept as written) and records the plugin in rustman.lock. The name is the manifest’s, or --name. A path source is stored relative to the workspace root, whatever the current directory; a path outside the workspace is refused. A name or source the workspace already declares is refused before anything is downloaded: plugins are never upgraded in place, so changing one is plugin remove then plugin add, and its grants are written again by hand. plugin add never grants anything; grants are edited in rustman.toml, where they show up in code review, and the changed set must be trusted again.

rustman plugin list shows each declared plugin with its version and API major (from its manifest on disk, else from rustman.lock), source and grants, and whether this machine trusts the set (trusted, not trusted, changed since trusted). It reads files only.

rustman plugin verify re-hashes every plugin against its pin, downloads the URL sources that are not cached yet (verified against the pin before they are kept), checks every manifest and grant, and brings rustman.lock in line with rustman.toml. It exits with 0 when everything matches and 2 otherwise, which makes it the CI check of a workspace’s plugins.

rustman plugin remove <name> removes the table (and its sub-tables such as [plugins.<name>.limits]) from rustman.toml and the entry from rustman.lock. A plugin declared in another form, such as an inline table under [plugins], is left for the user to edit.

No rustman plugin command trusts a plugin set, and the agent interface has none of them.

Pinning and rustman.lock

Every plugin is pinned by the sha256 of its .wasm file. A file whose hash does not match is refused with

plugin hmac: sha256 mismatch (expected 4f9c…, got 9e1d…)

and rustman run exits with code 2 before any request is sent. Plugins never update on their own: changing a plugin means changing its pin.

rustman.lock (tracked in Git, written by Rustman when plugins are added or verified) records the version, source, sha256 and API major each pin resolved to, so a review shows them next to a changed hash:

# rustman.lock
# Written by rustman (plugin add, plugin verify). Do not edit by hand.
version = 1

[[plugin]]
name = "faker"
version = "1.4.0"
source = "https://plugins.example.com/faker-1.4.0.wasm"
sha256 = "0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9"
api = 1

[[plugin]]
name = "hmac"
version = "0.2.0"
source = "plugins/hmac"
sha256 = "4f9c1b0e7a3d5c2e8b6a9f0d1c3e5a7b9d2f4a6c8e0b1d3f5a7c9e1b3d5f7a90"
api = 1

URL sources

A URL source is downloaded over https only, with TLS verification always on (a workspace ca_bundle can add trusted CAs, but verification cannot be turned off), at most 20 MiB, through the http-requests engine (without a proxy). It runs before the plugin set is trusted, so a URL committed to a repository cannot reach this machine or a private network: a host name that resolves to an address that is not public (see the network rules under The sandbox) is refused when the connection opens, with <host> resolves to the non-public address <ip> (download from the address itself to reach it), unless the URL names that address or localhost itself. Redirects are followed only while they stay on https and on the same host and port; a redirect elsewhere fails with redirect to another host refused. An http:// source fails with plugin sources must use https (exit code 2).

The download is verified against the pin and cached as .rustman/plugins/<sha256>.wasm (git-ignored with the rest of .rustman/). Later loads use the cache and never download again, even if the URL now serves a newer build. When the cache is missing, the pinned URL is downloaded again and verified before use; a different build is refused with the mismatch error. A cached file that no longer matches its pin is refused the same way.

Grants

A plugin starts with no access to the filesystem, network, environment variables, clock, randomness or secrets. Each access needs a grant in grants, which the manifest must also request:

GrantAllows
clockthe wall clock
randomrandom bytes (at most 64 KiB per call)
env:<NAME>one environment variable
fs:read:<dir>reading files under a workspace-relative folder (fs:read:. is the whole workspace)
net:<host>[:port]HTTP requests to one host; without a port, only ports 80 and 443
secrets:read:<name>the value of one secret: a secret name, or a provider reference <provider>/<path>[#field]

Wildcards are refused for every grant (plugin hmac: wildcard grants are not allowed). An fs:read folder may not leave the workspace (plugin hmac: grant 'fs:read:../' escapes the workspace) or point into .rustman/. A grant the manifest does not request is refused: plugin hmac: grant 'env:HOME' not requested by the plugin.

The sandbox

Plugins run in wasmtime with the component model and Cranelift. The host links only the rustman:plugin host interfaces, http, clock, random, env, fs-read, secrets and log; no WASI interface is linked, so a component that imports one (filesystem, sockets, environment, clocks) fails to load. Each host function checks the grant when it is called and returns capability-denied without doing anything otherwise. The refusal reads capability_denied: <what>, for example capability_denied: fs or capability_denied: net evil.example.net.

  • Files. fs-read resolves the path against the workspace root, then canonically: neither .. nor a symbolic link can reach outside the granted folder, outside the workspace, or into .rustman/. Listings never show .rustman. Only regular files are read (a FIFO or device fails with not a regular file instead of blocking), opened without following a symbolic link, and the opened file must still be the file at the checked path (same device and inode on Unix): a path swapped for a symbolic link between the check and the read fails with the path changed while it was read.
  • Network. http.fetch sends through the http-requests engine and the session’s safety policy (GovernedSender). In rustman run, send, import and report render the policy allows the hosts of the set’s net: grants (https or http, on the granted port or else 443 and 80) and [safety].allowed_hosts, under the workspace’s [safety] settings: a host of [safety].production_hosts is refused, and so are destructive methods (DELETE). A host the plugin holds no net: grant for fails with capability-denied; a request the policy refuses fails with policy-denied (for example host not allowed). Redirects are not followed: the plugin sees the redirect response, and a new request is checked again. Every exchange is recorded in history, redacted, as request plugin:<name>. Plugins have no raw sockets. A net: grant matches the host name the plugin asks for, and when the connection is opened every address that name resolves to is checked: a granted name that resolves to an address that is not public fails with policy_denied: <host> resolves to the private address <ip> (grant the address itself to reach it). To reach such a host, grant it literally: net:localhost (or a .localhost name) or the IP address, such as net:10.0.0.5:8080. The check runs on the addresses actually connected to, so re-pointing DNS after the check does not get around it; behind an HTTP proxy the proxy resolves the name, and it is not checked. The trust prompt marks grants naming this machine or a private network, such as net:localhost or net:169.254.169.254. “Not public” is deny-by-default: any address that is not globally routable unicast. For IPv4 that is 0.0.0.0/8, private 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, shared (CGNAT) 100.64.0.0/10, loopback 127.0.0.0/8, link-local 169.254.0.0/16 (cloud metadata), 192.0.0.0/24, documentation 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, 192.88.99.0/24, benchmarking 198.18.0.0/15, multicast 224.0.0.0/4, reserved 240.0.0.0/4 and broadcast. For IPv6, everything outside global unicast 2000::/3 (loopback, unspecified, unique-local fc00::/7, link-local fe80::/10, site-local fec0::/10, multicast, discard), plus 2001::/23 (Teredo and IETF assignments) and documentation 2001:db8::/32 and 3fff::/20. An IPv6 address wrapping an IPv4 one is judged as that IPv4 address: IPv4-mapped ::ffff:a.b.c.d, IPv4-compatible ::a.b.c.d, NAT64 64:ff9b::/96 and 6to4 2002::/16.
  • Host-call sizes. One host call can copy at most about the plugin’s memory limit out of the guest (wasmtime’s hostcall fuel, at least 1 MiB), however its strings and lists alias each other; beyond that the call traps. http.fetch also takes at most 100 request headers, 64 KiB of header names and values, and a URL of 16 KiB (at most 100 request headers, and so on).
  • Secrets. secrets.lookup(name) returns a handle; reveal() returns the value only with secrets:read:<name>. Without that grant, lookup returns a handle for any name, set or not, so a plugin cannot learn which secrets the session has. Values handed to a plugin without the grant carry the placeholder «redacted:<name>»; this holds for values a send resolves after the plugins load too (provider values, captured secrets, secret data columns), named by their variable or, for a direct {{secret:...}} reference, by the reference text. Everything a plugin logs, and every error it returns, is redacted of all the session’s secrets, granted or not.
  • Logs. log.write lines are redacted, kept (at most 1000 per instance, 8 KiB each) and logged at debug level (-v).

Limits and faults

Every call has an execution time budget, cpu_ms (default 100 ms, enforced by wasmtime epoch interruption on a 10 ms tick). It is wall-clock time spent running the plugin, minus the time the host spends on its network or file requests; it is not CPU time measured by the OS, so a busy machine can make a call use its budget sooner and a memory limit (default 64 MiB, across all of the plugin’s memories). Raise them per plugin with limits = { cpu_ms, memory_mib }, up to 10000 ms and 1024 MiB; a higher value fails with plugin <name>: memory limit exceeds maximum (1024 MiB) (or execution time limit exceeds maximum (10000 ms)).

Exceeding a limit aborts the call with plugin <name>: execution time limit exceeded or plugin <name>: memory limit exceeded. Time spent in host calls (network, files) does not count against the execution time limit, but a call may take at most that limit plus 60 seconds of wall time, host calls included; past that it stops with plugin <name>: time limit exceeded when the plugin runs again (a host call in progress is not interrupted); a trap fails it with plugin <name> trapped: <message>. Only that call fails: Rustman does not crash or hang, and the plugin’s instance is recreated before its next call. Calls into one plugin are serialized.

Trust

A plugin is code that came with the workspace, so a machine runs a workspace’s plugin set only once it has been trusted there. The set is identified by a hash over the sorted (name, sha256, grants, limits) of every [plugins.<name>] table, plus the hash of a path source’s rustman-plugin.toml when it sits next to the component rather than inside it (the sha256 pin covers only the .wasm file): adding a plugin, repinning one, changing any grant or limit, or editing such a manifest makes it a new set. The approval is kept in .rustman/trust.yaml (git-ignored) under the subject plugins, sealed with this machine’s key like the MCP client’s stdio approvals, so an approval copied from another machine or committed to the repository matches nothing. Checking trust reads files only: no plugin code runs, and nothing is downloaded, before the answer. The fingerprint is computed again from the files a load actually reads (the declarations and the manifest file bytes, with every component checked against its pin), and a load whose fingerprint is not the approved one is refused with the workspace plugins changed while they were loading; review them again, so a file changed between the trust check and the load never runs unapproved.

  • TUI. When rustman tui opens a workspace whose set is not trusted, a dialog lists each plugin with its version, source and grants in plain language (may read the secret hmac_key, may send HTTP requests to api.example.com). y trusts the set; n or Esc leaves every plugin unloaded. The dialog says when a trusted set changed. Once trusted, a request sent from the TUI uses the plugins like a headless command does (auth schemes, generators, transformers, assertions and request kinds, with the environment’s secrets and the network of their grants; a URL source must already be cached, see rustman plugin verify); while the set is untrusted, a request that needs a plugin fails with a message such as plugin faker is not loaded or auth scheme hmac/v1: workspace plugins are not loaded.
  • Headless commands. rustman run, send, bench, history replay, import <format> and report render refuse an untrusted set with workspace plugins are not trusted (run interactively or pass --trust-plugins) and exit code 2, before any request is sent. --trust-plugins records the approval and loads the plugins with exactly their grants, which is what a CI job passes. A plugin whose bytes do not match their pin is refused first (exit code 2), with or without the flag.
  • Agents. rustman mcp serve loads the plugins only when their set is already trusted on this machine; otherwise it starts without them and logs plugins not loaded: workspace not trusted. The agent interface has no tool to add, remove, trust or grant plugins; plugins reach agents only through the requests their tools send. In an agent session a plugin’s network is read-only: an agent’s mutations need the human’s confirmation, which a plugin call cannot ask for, so a plugin’s POST, PUT, PATCH or DELETE is refused with policy-denied. On top of its net: grants, every request a plugin sends in an agent session (from an auth scheme, a generator, an assertion or a request kind) must reach an origin the agent may reach ([agent] allowed_hosts, or the hosts of the server’s environment) and is refused with policy-denied (host not allowed) otherwise; each request, sent or refused, gets an audit line with tool plugin:<name>, session plugins, its method and its redacted URL, and a request whose line cannot be written is not sent. A request of a plugin kind (send_request, run_collection) passes the agent gate like an HTTP request: it runs only when [agent] plugin_kinds lists its kind, it counts as a mutation (allow_mutations and the human’s confirmation), and it is audited with the kind as its method and <kind>:<request id> as its URL (in a background job, as a line of its own). Otherwise it fails with plugin kind '<kind>' not allowed for agents (list it in [agent] plugin_kinds) before the plugin runs.

Extension points

A plugin implements the extension points its manifest lists in extension_points. Each is used by its workspace name and the item’s name, <plugin>/<name> (request kinds and import formats by their own name). A fault in a plugin (a trap, a limit, an invalid result) fails only the operation that called it: an auth scheme’s, a transformer’s or a request kind’s fault is a request error (exit code 3) and the request is not sent (or its response not checked); an assertion function’s fault is an assertion error; an importer’s fault writes nothing (exit code 2).

Whatever a plugin returns may hold a secret it was granted, so every sink of a run (history, reports, logs, stdout) redacts every secret of the plugin session, whether or not a request references it. Each extension point has a working example: the project rustman plugin new <name> --kind <extension point> scaffolds (see Writing plugins), which CI builds, tests and adds for every extension point.

Auth schemes

auth: {type: plugin, scheme: hmac/v1, key_var: hmac_key}

Every key besides type and scheme is a parameter for the plugin, with {{variables}} resolved. The plugin signs the request as it is sent: method, full URL, headers and body. It returns headers to set (replacing those of the same name), query parameters to add, and optionally a new URL whose path or query differ. A result that moves the request to another host, or that sets a header choosing the host or framing the body (Host, Content-Length, Transfer-Encoding, Content-Encoding, Connection, Upgrade, TE, Trailer, Expect), fails with plugin <name>: auth plugins may not change method, host or body. With grants = ["secrets:read:hmac_key", "clock"] the plugin above reads the secret named by key_var and the clock, and sets X-Signature and X-Timestamp; like the headers of built-in auth, the headers it sets are not recorded in history or reports, and a secret value that shows up anywhere else (for example echoed in a response) is redacted, whatever the header’s name.

Assertion functions

assertions:
  - plugin: {fn: shop/price-consistent, tolerance: 0}

The function receives the exchange (method, URL and headers of the request; status, headers, body and duration of the response), redacted of the secrets the plugin may not read, and the other keys as a JSON object. It returns pass, fail or error with a message, reported like a built-in assertion: fail: shop/price-consistent: total 99.0 != sum 98.5. A plugin that loops or traps reports error: plugin shop: execution time limit exceeded (or trapped: <message>), and the run continues.

Value generators

body: {type: text, content: "{{$faker.email}} {{$faker.name en}}"}

{{$<plugin>.<name> args...}} calls the plugin’s generator with the words after the name, once for each occurrence, like the built-in dynamic variables. It returns a string. A generator that fails leaves the variable unresolved, and nothing is sent: unresolved variable(s): $faker.email (plugin faker: random). A generator without the random or clock grant has no source of randomness or time: what it returns depends only on its arguments (and on what it kept from earlier calls).

Report renderers

rustman run . --env ci --trust-plugins --reporter acme/xlsx:out/report.xlsx
rustman report render out/report.json --format acme/xlsx -o report.xlsx

The plugin receives the redacted rustman.report/v1 JSON document and returns the bytes to write; the host writes them to the file as they are. A plugin format always writes a file (-o, or :<path> after --reporter).

Transformers

transform:
  request: [acme/encrypt]
  response: [acme/decrypt]

A transformer plugin registers request transformers and response transformers, applied in the listed order. A request transformer runs after interpolation and before auth (an auth plugin signs what it returns): it gets the URL, the headers and the body as sent, and returns the headers and body to send. It cannot pick the host or the framing: Host stays the request’s and Content-Length is set from the new body. A response transformer runs before assertions and captures, which see what it returns, headers and body; it needs the whole body in memory (a spilled body fails the request). History and the JSON report keep both: the exchange holds the transformed response and transform.original_body the body as received.

A transformer without secrets:read:<name> sees «redacted:<name>» in place of the secret, in the URL, the headers and the body, and what it returns is sent as is: grant the secret to a request transformer that must keep it in the request. A transformer that fails, or that names a plugin that is not loaded, fails the request (exit code 3). The transformer template is a stamp request transformer (adds a header) and a strip-xssi response transformer (drops a )]}', prefix).

Importers

rustman import soapui specs/project.xml --into soap --trust-plugins

An importer plugin registers formats for rustman import <format> <src> (a built-in subcommand such as postman wins over a plugin format of the same name). The source must be inside the workspace, and the plugin reads it only through its fs:read grants: without one covering it, the import fails with plugin <name>: capability_denied: fs <src>. The plugin returns request files and environments as text; it writes nothing. The host checks every one before writing any: a request file must load (a built-in kind, or a plugin kind whose schema it matches), an environment must parse, and paths stay relative (*.rman.yaml files under --into, environments under environments/). The first invalid file stops the import with nothing written, naming the plugin and the file: plugin soapui: two.rman.yaml: unknown request kind 'soap' (expected one of: ...). --dry-run lists the files, and --on-conflict skip|overwrite|rename decides about files that exist. What the plugin returns is redacted of the session’s secrets before it is written. A source cannot name your secrets: a live secret reference ({{secret:...}}) in a returned file is written escaped, as \{{secret:...}} (literal text that never resolves), and printed as review: <file>: secret reference {{secret:...}} from the source neutralized: ..., as for the built-in importers. A file where the escape cannot be made in the YAML text (a double-quoted value, or a reference spelled with YAML escapes) stops the import with nothing written: plugin soapui: two.rman.yaml: holds a secret reference ({{secret:...}}) that cannot be neutralized; .... The importer template converts METHOD URL lines.

Request kinds

# orders/get-order.rman.yaml
version: 1
kind: soap
name: get-order
endpoint: '{{base_url}}/soap'
action: GetOrder

A kind plugin registers request kinds, each with a JSON Schema for its fields and a declarative TUI pane. A kind cannot take a built-in name: plugin <name>: kind 'http' is reserved. In a workspace that declares plugins, request files of other kinds load as opaque requests; once the set is loaded, rustman run and send check each one before anything is sent (exit code 2): its kind must be one a plugin registers (unknown request kind 'soapp' (expected one of: http, ..., soap)), and its fields (without version, kind, name, description, tags and variables) must match the kind’s schema (plugin soapy: kind 'soap': /: "action" is a required property). To run one, the host substitutes the {{variables}} of every field and hands the request to the plugin as JSON (redacted of the secrets it holds no grant for); the plugin executes it through its granted host functions (http.fetch for a network protocol) and returns what it sent and received. The JSON report and history record it as plugin_kind (kind, summary, status, headers, body); it is never replayed.

The pane lists fields, each with an editor (text, code with a language, key-value, or select with options), and response views (raw, json-tree, table). The TUI loads a trusted set’s kinds when it opens the workspace and draws a request of a plugin kind with that pane (each field with its editor and value, then the response views); plugins never draw. The fields are edited in the request file. Agents see plugin kinds only through the requests their tools run. The kind template is an echo kind.

Secret providers

Secret providers have no extension point in API 1. They are planned as an additive interface within major 1 once the built-in providers land; the SDK would then gain a matching world feature.

Plugin API versions

The plugin API major is the version of the WIT package, rustman:plugin@1.x; this build supports API 1. A plugin whose api is another major does not load (plugin next targets plugin API 2; this rustman supports 1), and the rest of the workspace still runs. Within a major the package only grows: new functions, types, interfaces and worlds may be added, and nothing that exists changes, so components built against an older minor keep working. A test compares the package with its frozen surface (crates/rustman-plugin-sdk/wit/frozen/1.0.0.txt) and fails on any non-additive edit. rustman plugin api prints the package version and the supported majors:

rustman:plugin@1.0.0
supported plugin API majors: 1

Writing plugins

rustman-plugin-sdk is the guest SDK: the WIT package, its version, and Rust bindings generated with wit-bindgen for each extension point. Each world is a cargo feature (auth, assertion, generator, transformer, importer, kind, report) that adds a module of the same name with the Guest trait to implement and an export! macro; the host imports are rustman_plugin_sdk::{http, clock, random, env, fs_read, secrets, log}, and rustman_plugin_sdk::describe words a host error like the host does (capability_denied: clock). The runtime feature gives a no_std plugin its allocator, cabi_realloc and panic handler, so the component imports nothing but the Rustman host interfaces: the host links no WASI at all, and a component that imports a WASI interface does not load.

Until rustman-plugin-sdk is published on crates.io, scaffold with --sdk <path>. The default dependency is a git dependency on the Rustman repository, which only builds once the SDK is available from there at a matching version; point --sdk at the crates/rustman-plugin-sdk folder of a Rustman checkout instead, as below, and commit the Cargo.lock of the first build.

git clone https://github.com/CyberdyneCorp/rustman
rustman plugin new my-auth --kind auth --sdk rustman/crates/rustman-plugin-sdk
cd my-auth
rustup target add wasm32-wasip2
cargo build --target wasm32-wasip2 --release
rustman plugin test .

rustman plugin new <name> --kind <extension point> writes a project into ./<name> (or --dir):

FileWhat it holds
Cargo.tomla cdylib depending on rustman-plugin-sdk with the world’s feature and runtime, its own [workspace], panic = "abort" and a size-optimized release profile. Until the SDK is published on crates.io it comes from the Rustman repository (git = "https://github.com/CyberdyneCorp/rustman", version = "1", which keeps it on API major 1; the first build pins the commit in Cargo.lock, which the README says to commit and build --locked); --sdk <path> uses a local copy instead, such as crates/rustman-plugin-sdk of a checkout
rustman-plugin.tomlthe manifest, with component = "target/wasm32-wasip2/release/<crate>.wasm"
src/lib.rsa no_std sample implementation
rustman-plugin-tests.tomltest cases for rustman plugin test
README.mdthe build, test and use recipe

The samples are an HMAC-SHA256 auth scheme (v1, needs clock and secrets:read:<key_var>), a status-2xx assertion function, a slug generator, a stamp request transformer and a strip-xssi response transformer, a lines importer, an echo request kind with its pane, and a text report renderer. CI scaffolds, builds (--locked, against the committed lockfiles in scripts/plugin-template-locks/, regenerated with --update-locks after a template’s dependencies change), tests and adds every one of them (scripts/check_plugin_templates.py), so each template is also a working example of its extension point. The built project is a folder source: from the workspace root, rustman plugin add ./my-auth pins it.

Test plugins in this repository’s own test suite are written in WebAssembly text against the canonical ABI and wrapped into components in-process (the test-fixtures feature of rustman-plugin), so the main test suite needs no wasm32-wasip2 toolchain.

Testing plugins

rustman plugin test [path] runs a plugin’s test cases with the host test harness: the real sandbox, with exactly the grants each case lists, against a fake clock, fake randomness, a fake environment, a fake network and fake secrets. Nothing real is reachable, so the same cases give byte-identical output on every run and platform. path is a plugin folder (default .) or a .wasm file; the cases are rustman-plugin-tests.toml next to the manifest, or --cases <file>.

# my-auth/rustman-plugin-tests.toml
[fakes]
clock = 2026-01-01T00:00:00Z
random_seed = 7
env = { REGION = "eu-west-1" }
secrets = { hmac_key = "test-secret" }

[[fakes.http]]
method = "POST"
url = "https://auth.example.com/token"
status = 200
headers = { "content-type" = "application/json" }
body = '{"token":"t"}'

[[case]]
name = "signs with the fixed clock and the fake secret"
grants = ["clock", "secrets:read:hmac_key"]
sign = { scheme = "v1", method = "POST", url = "https://api.example.com/orders", params = { key_var = "hmac_key" } }
expect = { "header.X-Timestamp" = "1767225600", "header.X-Signature" = "0278871e60295553e9588cd1ee773721a033c7ea9e7114d87148c9897f1abf71" }

[[case]]
name = "cannot read the secret without its grant"
grants = ["clock"]
sign = { scheme = "v1", url = "https://api.example.com/orders", params = { key_var = "hmac_key" } }
expect_error = "secrets hmac_key"

[fakes] holds what every case runs against, and a case’s own fakes table adds to it (its clock and seed win, its maps add and replace entries, its responses are matched first):

FakeMeaning
clockthe time clock.now returns: a UTC datetime (2026-01-01T00:00:00Z, as a TOML datetime or a string) or Unix seconds; 1970-01-01T00:00:00Z when unset
random_seedthe seed of the bytes random.bytes returns (SplitMix64); 0 when unset
envthe variables env.get sees; the process environment is never read
secretsthe session’s secrets: revealed only with secrets:read:<name>, and redacted from everything shown
httpcanned responses (method, default GET; url, matched exactly; status, default 200; headers; body). A granted request without one fails with no fake response for <method> <url>

Each [[case]] has a name, its grants (default none; checked against the manifest like a workspace’s), optional limits, and exactly one call:

CallFieldsOutput lines
signscheme, method (GET), url, headers, body, paramsheader.<name>, query.<name>, url
checkfunction, method, url, request_headers, request_body, status (200), headers, body, duration_ms, args (a JSON object)verdict (pass, fail, error), message
generatename, argsvalue
transform_requestname, url, headers, bodyheader.<name>, body
transform_responsename, status (200), headers, bodyheader.<name>, body
convertformat, source_path, sourcerequest.<path>, environment.<path>
executekind, request (JSON)summary, status, header.<name>, body
renderformat, report (JSON)output

expect maps output lines to the exact values they must have; expect_error instead requires the call to fail with a message containing its text. A case without either passes when the call succeeds. The command prints every case with its output lines, the plugin’s log lines and the host calls it was refused, then a count:

plugin my-auth 0.1.0
ok   signs with the fixed clock and the fake secret
       header.X-Signature: 0278871e60295553e9588cd1ee773721a033c7ea9e7114d87148c9897f1abf71
       header.X-Timestamp: 1767225600
ok   cannot read the secret without its grant
       capability_denied: secrets hmac_key
2 passed, 0 failed

It exits with 0 when every case passes, 1 when one fails (with a ! line saying what differed), and 2 when the plugin or its cases cannot be read. Everything shown is redacted of the fake secrets, like plugin output in a real session (value: «redacted:api_token»); expectations are compared with the real values. The fake services only replace what a granted call reaches: a call without its grant is refused by the sandbox first, exactly as in a run.

Stability and compatibility

From v1.0, Rustman keeps a small set of public contracts stable: the file formats you commit, the documents and protocols other tools read, and the exit codes scripts branch on. This page lists them, says what “stable” means for each, and names the test that fails CI when one of them changes by accident.

The promise

  • Within a major version, changes are additive only. A frozen contract can gain new optional fields, new message types, new report kinds, new enum values, new functions on imported interfaces and new commands. Nothing that exists is renamed, removed, retyped or given a new meaning, and no new field becomes required where older writers would not send it.
  • Readers ignore what they don’t know. Readers of the report and the viz protocol must accept unknown fields, kinds and enum values; Rustman’s own readers do. Files written by an older 1.x release stay valid in every later 1.x release.
  • Breaking changes bump the contract’s major version (version: 2, rustman.report/v2, rustman-viz/2, rustman:plugin@2.0.0) and ship in a new major Rustman release. Rustman refuses a major version it does not support with a clear error, instead of guessing.
  • Deprecation before removal. A field, flag, value or command that is going away is first marked deprecated in its documentation and in the release notes, keeps working for the rest of the major version, and, where there is human-readable output, makes Rustman print a warning when it is used. It is removed only in the next major version.

Frozen contracts

ContractWhere it is definedWhat is frozenGuard tests
Request files, version: 1Request files, the *.rman.yaml kinds in each protocol’s page, openspec/specs/workspaceThe version: 1 header and every documented field of every built-in kind. Any other version, or none, is refused with exit code 2 before the kind’s fields are read.request_file_version_1_is_frozen_for_every_kind, future_version_is_rejected and a_quoted_version_is_rejected in crates/rustman-core/tests/request_files.rs
Workspace settings, rustman.toml version = 1Request filesThe [workspace] version = 1 key and the documented tables. A newer version is refused.newer_settings_version_fails_to_load in crates/rustman-core/tests/workspace.rs
Reports, rustman.report/v1Reports, JSON Schema docs/schemas/report.schema.json (also printed by rustman report schema)Every property, required field, type and enum value of each report kind (run, exploration, contract, bench, stress).The checked-in schema must equal the one generated from the report types (report_schema_prints_the_published_schema in crates/rustman-cli/tests/report.rs); its surface must contain every line of crates/rustman-report/tests/frozen/report-v1.txt (crates/rustman-report/tests/frozen.rs); v0.1 run reports still validate (reports_without_data_keep_the_v0_1_shape); other majors are refused (an_unknown_major_version_exits_2_naming_it)
Viz protocol, rustman-viz/1Viz protocol, JSON Schema crates/rustman-viz-protocol/schema/rustman-viz-1.schema.jsonThe protocol name, the line limit, every message type with its fields, types and required fields, and the views, report kinds, outcomes, severities and run states.crates/rustman-viz-protocol/tests/frozen.rs against crates/rustman-viz-protocol/schema/frozen/rustman-viz-1.txt; every message type decodes from its example in the protocol doc; crates/rustman-viz-protocol/tests/messages.rs (round trips, schema, unknown fields and types)
Plugin API, rustman:plugin@1Plugins, WIT package crates/rustman-plugin-sdk/wit/plugin.witEvery type, function, world import and world export of the package. Exported interfaces get no new functions (existing plugins would lack them).crates/rustman-plugin/tests/wit_api.rs against crates/rustman-plugin-sdk/wit/frozen/1.0.0.txt
CLI exit codesCLI reference, crates/rustman-cli/src/exit.rs (CODES)The codes below and their meanings. A code is never reused for another meaning. Command-specific uses documented on each command’s page (for example rustman import) are frozen too.the_exit_codes_are_frozen_and_documented in crates/rustman-cli/src/exit.rs, which also checks this table and the one in the CLI reference

CLI exit codes

CodeMeaning
0Success: every executed request passed.
1At least one assertion (or threshold, or finding at the --fail-on level) failed, and nothing errored.
2Usage or configuration error: a bad flag, no workspace, an invalid or unsupported file.
3At least one request errored (network, TLS, timeout, auth, unresolved variable). It wins over 1.
4Refused by the safety policy, the stress gate or the monitor policy.
130Interrupted by Ctrl+C (SIGINT), or on Unix by SIGTERM or SIGHUP.

Changing a frozen contract

An additive change updates the contract’s definition and its documentation, then refreshes the frozen surface file in the same pull request, so the review shows exactly what was added:

RUSTMAN_FREEZE_REPORT=1 cargo test -p rustman-report --test frozen
RUSTMAN_FREEZE_VIZ=1 cargo test -p rustman-viz-protocol --test frozen
RUSTMAN_FREEZE_WIT=1 cargo test -p rustman-plugin --test wit_api

A refresh only ever adds lines. A diff that removes a line from a frozen file is a breaking change: it needs a new major version of that contract, not a refresh. A new exit code is added to CODES, to the table above and to the CLI reference.

Not covered

These can change in any release, including minor ones:

  • The terminal UI: layout, colours, panes, toasts and the default key bindings.
  • Human-readable output: the pretty reporter, progress lines, dashboards, warnings and error messages. Scripts should read reports, --json output and exit codes instead.
  • The --json output of individual commands other than reports (for example rustman kafka consume --json): it is documented with each command and changes additively in practice, but it is not frozen yet.
  • The agent (MCP server) tool set and the HTML, Markdown and SARIF renderings of reports. SARIF follows the SARIF 2.1.0 schema; its rule ids and messages may change.
  • The Rust APIs of the workspace’s crates (rustman-core, rustman-http, rustman-report and the others). They are internal and unpublished; only the plugin SDK’s WIT package is a public API.
  • Files under .rustman/ (history, caches, journals, monitor results): their format belongs to Rustman, not to you.
  • Behaviour that is a bug: fixing it is not a breaking change, even if something relied on it. Security fixes may tighten defaults (for example refusing a request that was allowed) within a major version; the release notes say so.

JSON schemas

Machine-readable outputs carry a schema field naming their format and major version, and are described by JSON Schemas kept in this repository:

SchemaDescribesProduced by
rustman.report/v1The canonical report of runs, explorations, contract checks, load and stress tests (kind: run, exploration, contract, bench, stress)rustman run --reporter json, --report json, rustman explore run; rustman report schema prints the schema; see Reports
rustman.import-report/v1The report of an import: files, conflicts, moved secrets, notes and script migration countsrustman import --report <file>; see Importing collections
rustman-viz/1The JSON-lines protocol between rustman and the viz companionrustman run --viz, rustman viz; see Viz protocol

Exit codes are listed in the CLI reference, with the import-specific ones in Importing collections.

Viz protocol (rustman-viz/1)

The viz protocol connects rustman (the producer: the CLI or the TUI) to the optional graphical companion rustman-viz. It is specified by the visual-dashboards capability. The message types live in the rustman-viz-protocol crate (serde types only, no I/O), and the JSON Schema of every message is crates/rustman-viz-protocol/schema/rustman-viz-1.schema.json.

Transport

  • The producer spawns the companion and writes to its stdin: UTF-8 JSON, one message per line, each an object with a type field.
  • A line is at most 16 MiB (16,777,216 bytes, newline excluded). A body that does not fit is written to a temp file and sent as a blob_ref instead of inline text. The producer owns that file: it keeps it while the companion runs and removes it once the companion has exited, so the companion must not delete it. (A producer that exits first leaves the file to the companion.)
  • The companion’s stdout carries only the handshake reply and error lines. Its stderr goes to a log file in the Rustman state directory.
  • End of stdin means the producer is gone. Open windows stay usable and show Producer disconnected.

Versioning

  • The protocol is named rustman-viz/<major>. The major version changes only on breaking changes.
  • Minor additions are new optional fields and new message types. Readers ignore unknown fields and unknown message types (the crate decodes an unknown type as Message::Unknown), and unknown values of open enumerations (views, outcomes, severities, states) decode as unknown.
  • Writers never send a field or type the peer has not agreed to by version.

Handshake

The producer opens every session with hello. The companion answers with hello_ack (and its views) or hello_reject (and the versions it speaks). After a rejection the producer sends nothing more and reports both versions, e.g. Viz companion speaks rustman-viz/1, rustman needs rustman-viz/2.

{"type":"hello","protocol":"rustman-viz/1","producer":"rustman 0.2.0"}
{"type":"hello_ack","protocol":"rustman-viz/1","viewer":"rustman-viz 0.2.0","views":["run_dashboard","exploration_dashboard","api_graph","response_inspector"]}
{"type":"hello_reject","supported":["rustman-viz/1"]}

Messages

Opening a view, and loading a saved report (kind is run, exploration, bench or stress; view is optional, e.g. api_graph for --view graph):

{"type":"open_view","view":"run_dashboard","title":"smoke/"}
{"type":"load_report","path":"reports/run-2026-11-17.json","kind":"run"}

A run as it happens. outcome is passed, failed, errored (no response: error says why, redacted, and there is no status), cancelled or skipped. A run ends completed or aborted:

{"type":"run_started","started_at":"2026-11-17T10:00:00Z","environment":"staging","total":200}
{"type":"exchange_completed","request":"users/get-user","method":"GET","url":"https://api.test/users/42","outcome":"passed","status":200,"duration_ms":84,"assertions":{"passed":3,"failed":0},"iteration":1}
{"type":"exchange_completed","request":"users/get-user","method":"GET","url":"https://nope.invalid/users/42","outcome":"errored","duration_ms":3,"assertions":{"passed":0,"failed":0},"error":"dns"}
{"type":"run_finished","state":"completed","summary":{"total":200,"passed":180,"failed":15,"errored":5,"skipped":0,"duration_ms":9000}}

An exploration. Severities are critical, high, medium, low and info:

{"type":"exploration_started","started_at":"2026-11-17T10:00:00Z","operations":24,"base_url":"https://api.test"}
{"type":"probe_completed","operation":"POST /users","outcome":"passed","status":201,"duration_ms":12}
{"type":"finding","severity":"high","operation":"POST /users","title":"500 on empty body","detail":"POST /users with {} returned 500"}
{"type":"exploration_finished","state":"completed","operations_total":24,"operations_exercised":18,"status_codes_documented":40,"status_codes_seen":31}

A bench (rustman bench --viz, see Load testing) opens the bench view, then sends one bench_tick per second with that second’s requests, errors, rate, latency percentiles (milliseconds) and active VUs, and a final bench_finished with the totals and thresholds. remaining_ms is left out when the bench has no fixed duration, and aborted (threshold or interrupted) when it ran to its end. Bench events hold counts, timings and threshold expressions only, never request or response content:

{"type":"open_view","view":"bench","title":"rustman bench https://staging.example.com"}
{"type":"bench_tick","second":3,"elapsed_ms":3000,"remaining_ms":27000,"active_vus":10,"requests":412,"errors":2,"rps":412.0,"p50_ms":18.2,"p95_ms":61.0,"p99_ms":120.4}
{"type":"bench_finished","state":"completed","duration_ms":30000,"iterations":4100,"requests":12300,"errors":41,"rps":410.0,"p50_ms":18.0,"p95_ms":64.3,"p99_ms":130.1,"thresholds":[{"expression":"p95<300ms","passed":true,"actual":"64.3ms"}]}

A stress run (rustman stress --viz, see Stress testing) opens the stress view and streams the same bench_tick per second for valid traffic, then close. A companion whose hello_ack lacks stress gets no stream, and the run warns viz companion has no stress view once.

Monitor trends (rustman monitor status --viz and v in the TUI’s Monitors view, see Monitors) open the monitor_trend view and send one monitor_trend per monitor, then close: the uptime gauges (24 hours, 7 and 30 days, left out without runs), the p95 latency of each hour with runs, oldest first, and the outcomes by UTC hour of day for the heatmap. They hold counts, timings and outcomes only, never request or response content. A companion whose hello_ack lacks monitor_trend gets nothing, and Rustman shows the text status with a note:

{"type":"open_view","view":"monitor_trend","title":"rustman monitor status"}
{"type":"monitor_trend","monitor":"api-health","environment":"prod","schedule":"every 5m","uptime_24h":98.95,"uptime_7d":99.5,"uptime_30d":99.9,"latency":[{"hour":"2026-11-17T09:00:00Z","p95_ms":123.0}],"hour_of_day":[{"hour":9,"passed":11,"failed":1,"errored":0,"skipped":0}]}

Chain probes (rustman evm probe --viz, see Probing EVM providers) open the chain_probe view and send exploration_started, then per provider one probe_latency per method (the provider × method latency heatmap), one chain_block per recent block (block-time and gas plots) and, for a traced --call, one call_trace node graph; then the findings, exploration_finished and close. Endpoints are redacted. A companion whose hello_ack lacks chain_probe gets nothing, and the probe warns and suggests --report html=…:

{"type":"open_view","view":"chain_probe","title":"rustman evm probe"}
{"type":"probe_latency","provider":"https://rpc-a.example/","method":"eth_call","samples":3,"p50_ms":12.5,"p95_ms":30.0,"max_ms":31.2}
{"type":"chain_block","provider":"https://rpc-a.example/","number":20000000,"timestamp":1717000000,"gas_used":15000000,"gas_limit":30000000}
{"type":"call_trace","provider":"https://rpc-a.example/","nodes":[{"id":0,"kind":"CALL","to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","gas_used":30000},{"id":1,"parent":0,"kind":"DELEGATECALL","error":"execution reverted"}]}

A response for the inspector, inline or by reference. Header values and bodies are redacted by the producer before they are written (secrets appear as «redacted:name»); the companion has no reveal function:

{"type":"inspect_response","request":"users/list","status":200,"content_type":"application/json","headers":[{"name":"Authorization","value":"Bearer «redacted:token»"}],"selector":"$.items","body":{"type":"inline","text":"{\"items\":[{\"id\":1,\"name\":\"a\"},{\"id\":2,\"email\":\"b@x\"}]}"}}
{"type":"inspect_response","request":"exports/all","status":200,"body":{"type":"blob_ref","path":"/tmp/rustman-viz/body-01.json","bytes":209715200,"media_type":"application/json"}}
{"type":"blob_ref","path":"/tmp/rustman-viz/report-01.json","bytes":20971520,"media_type":"application/json"}

Errors and the end of a session:

{"type":"error","code":"vulkan_unavailable","message":"Graphics unavailable (Vulkan)"}
{"type":"close"}

Priorities

A companion whose queue is full may coalesce progress messages (exchange_completed, probe_completed), but never drops finding, run_finished, exploration_finished or bench_finished. Producers apply the same rule to their own queue: rustman bench --viz drops a bench_tick rather than wait for a slow companion, never the bench_finished.

Exit codes of the companion

CodeMeaning
0The user closed the windows (or --protocol-check succeeded)
2Bad arguments, or a report file that is not a Rustman report
3Graphics unavailable: an error line vulkan_unavailable is written first
otherA crash; the producer shows Viz companion exited and keeps running

rustman-viz --protocol-check prints the protocol names it speaks, one per line, and exits 0.

Load testing internals

How rustman bench (Load testing) is built on the rest of Rustman, for contributors and for the changes that extend it (stress testing, thresholds, reports, live dashboards).

One execution path

A VU is a rustman_http::runner::Runner of its own and sends every request through Runner::send, the executor of rustman run: the same resolution, auth helpers, assertions, captures and redaction. A runner per VU gives each VU its own capture scope, cookie jar and connection pool. Runners are built with in_workspace: false, so VUs never write to the workspace, and with SnapshotMode::Ci.

Every request goes through RunOptions::gate: each VU has a BenchGate wrapping a GovernedSender (its own connection pool) created with GovernedSender::with_policy, so all VUs share one Governor built from the [bench] caps (max_rps as the rate, the VU pool as the concurrency, no probe budget) rather than from [safety].

The crate rustman-bench holds everything but the flags and the printing:

ModuleRole
profileProfile (one variant per executor), ProfileSpec (flags to a profile), stages and think time
capsthe [bench] caps check and the run time
safetythe pinned policy, the static preflight check, BenchGate
dataFeeder: the row of each iteration per --data-mode and --data-exhaust
metricsMetrics: per-second windows of HDR histograms and counters, the time series, error samples, BenchSummary
thresholdThreshold: parsing <metric><op><value>[!] and evaluating it against a BenchSummary
lagLagProbe: the generator’s scheduling lag and the generator-bound warning
reportbench_report: the kind: bench report of a BenchOutcome
summarythe plain-text end-of-run summary
closed, openthe schedulers of the closed models and the open model
benchBench::prepare (checks, nothing sent) and Bench::run: the executor, the run controller, the monitor and the lag probe

A new executor (such as a stress profile) is a new Profile variant, its flags in ProfileSpec, and a scheduler beside closed and open that runs Vu::iteration.

Metrics

Each finished request becomes a Sample (latency, error class, assertion checks, phase timings, bytes) recorded into the current one-second window: an hdrhistogram latency histogram in microseconds (1 µs to 10 minutes, 3 significant digits) per request file plus one overall, with counters and phase sums beside it. Once a second, Metrics::tick turns the window into a BenchSecond of the time series, adds it into the totals (histograms merge exactly) and resets it, keeping its memory. The summary is the totals plus the current window, so percentiles are within 0.1 % of the exact ones whatever the request count (a unit test checks this on uniform, exponential and bimodal distributions).

Memory is bounded: two histograms (window and totals, about 170 KB each) per request file plus two overall, a time series of one small point per second (capped at 24 hours), and at most 20 error samples per class. No latency sample is kept.

The latency of a request is its transport time (timings.total), which excludes the time spent waiting for the rate limiter. In the open model it also includes the wait between the iteration’s scheduled start and the start of its first request (coordinated-omission correction). Bytes sent are estimated from the recorded request (request line, headers and text body); bytes received are the response body.

Error samples are described from the request’s record (its error, else its first failed assertion, else METHOD url -> status), all of which the runner already redacted, and redacted once more with the exchange’s own Redactor before they are kept. In METHOD url -> status the values of query parameters named like a secret (password, token, secret, api_key, the names that make a data column secret, rustman_core::data_rows::secret_by_name) are also replaced with «redacted:<name>», since a plain --var there is not a known secret.

Run control

Bench::run races four futures: the executor, the controller, the monitor and the lag probe. The controller stops new iterations (the stop token) at the end of the profile, on a first Ctrl+C (BenchInput::interrupt) or on an abort-on-fail breach, then waits a drain period (the graceful stop of 30 s, 10 s after Ctrl+C, 1 s after a breach) before it cancels the iterations still in flight (the hard token, also cancelled at once by BenchInput::cancel, the second Ctrl+C). The monitor ticks the metrics every second and, after the warm-up (10 s, Bench::with_abort_warmup in tests), evaluates the abort-on-fail thresholds against the summary so far. The lag probe yields to the runtime every 20 ms and records how long it waits to be polled again, which does not depend on the timer resolution of the operating system.

The outcome carries the summary, the series, the threshold results, the error samples, aborted (threshold or interrupted) and the warnings; rustman_bench::report::bench_report turns it into the report, and the CLI maps it to its exit code.

Live view

Bench::live (taken before Bench::run) returns a rustman_bench::Live: the shared Metrics, the thresholds and the planned duration. Live::snapshot copies the totals and the current second under the metrics lock and merges them, computes percentiles and evaluates the thresholds after releasing it, so a VU recording a request waits at most for that copy (a few hundred KB per request file); iteration durations have a lock of their own. One lock for every VU is ample under the default max_rps caps; a change raising them by orders of magnitude (add-stress-testing) should shard the current window per VU. The front ends live in rustman-tui:

  • bench_view::render draws a Snapshot with ratatui (pure; snapshot-tested on a TestBackend);
  • bench_live::spawn runs a thread that, until LiveHandle::finish, draws the dashboard every 250 ms on the alternate screen (no raw mode, so SIGINT still reaches the bench) or prints live::progress_line every 10 s, and forwards each newly closed second to the viz stream;
  • bench_viz opens the stream after the shared companion handshake (companion::connect, also used by the TUI’s response hand-off), and writes through a bounded queue on a writer thread: ticks are dropped when it is full, bench_finished and close wait at most 5 s, then the companion is killed.

A stress executor gets all of this for free as long as it records into the same Metrics.

Threading

Every VU runs on the thread that calls Bench::run. The executor is one future: Closed::run drives all VUs with join_all, and Open::run keeps the in-flight iterations in a FuturesUnordered polled from its own select! loop; both are raced against the controller, the monitor and the lag probe in one tokio::select!, which the CLI drives with Runtime::block_on. Nothing is tokio::spawned, so request resolution, assertions and metrics recording for every VU share that thread, and the multi-thread runtime’s workers only run the I/O the engine hands them. This is ample under the default caps (50 VUs, 200 rps), and the lag probe warns when the generator falls behind. It is the main scaling limit, though: add-stress-testing should spawn each VU (or each open-model iteration) as its own task, with Arc-shared Shared state instead of borrows, before sharding the metrics lock.

Executor overhead

cargo bench -p rustman-bench --bench executor measures what the VU path adds per request: one GET to a local hyper server sent by the bare HttpEngine, against the same request sent as a VU sends it (Runner::send through a BenchGate and its governor, then classified and recorded in the metrics). It reports both with criterion, then times 3000 interleaved samples of each and fails when the VU path’s p50 exceeds the engine’s by more than 50 µs (design D1: optimize only beyond that). The failure message names the measured overhead and both p50s. CI runs it in the bench-overhead job, so a regression fails the build.

Last recorded result (release build, macOS on Apple silicon, loopback):

Pathcriterion meanp50
HttpEngine::send55.6 µs39 µs
VU (Runner::send + gate + metrics)56.6 µs48 µs
Overhead9 µs (limit 50 µs)