Docs / Quickstart
Quickstart
The fastest way to understand Firstpass is to watch it prove one decision. In about a minute, with no API keys, you'll run a real routing loop — cheap model first, gate the output, escalate on failure — and read the tamper-evident receipt it seals. Then you'll point your own agent at it, safely.
1 · See it prove one decision#
The demo needs no keys and talks to no provider. It stands up a mock upstream, drives one request through the full loop — open the cheap rung, gate the output, escalate one rung when the gate fails, serve the passing answer — and prints the receipt to your terminal. All you need is git and a Rust toolchain (rustup.rs).
git clone https://github.com/dshakes/firstpass && cd firstpass
cargo run -p firstpass-proxy --example demoYou don't have to install anything or read the config first. The point is to see the shape of a decision before you learn the parts — everything after this is that same loop, made real.
2 · Read the receipt#
The demo prints a receipt like the one below. It is the whole decision, in one record: which rungs were tried, how each gate voted, what it cost against the always-expensive counterfactual, and the hash link that makes the log tamper-evident. This artifact — not a prediction, not a log line — is what Firstpass produces for every request.
{
"seq": 1,
"mode": "balanced",
"attempts": [
{ "rung": 0, "model": "mock/cheap", "gate": "json-valid", "verdict": "fail" },
{ "rung": 1, "model": "mock/strong", "gate": "json-valid", "verdict": "pass", "served": true }
],
"served_rung": 1,
"cost_usd": 0.0004,
"counterfactual_usd": 0.0011,
"prev_hash": "genesis",
"hash": "b9c4…b1a7"
}Read it top to bottom and you've read the product: rung 0 answered, the gate rejected it, so Firstpass escalated to rung 1, which passed and was served. seq 1 and prev_hash "genesis" mark this as the first link in the chain; the next receipt will carry this hash as its prev_hash, and so on — which is what lets firstpass verify re-derive the entire history from scratch and catch any edit. Receipts & audit takes the record apart field by field.
firstpass verify re-derive the full chain from scratch and catch any edit.3 · What just happened#
That one decision is the whole system in miniature — the four moves from the Overview, now watched running. Firstpass does exactly these four things, in order, on every request:
json-valid; in production it's your schema, your test suite, an LLM judge, or self-consistency. Gates →/v1/feedback and move the serve threshold, so the served-failure rate stays bounded even as traffic drifts. The guarantee →How it works follows a single request through all four in detail, and Every scenario, end to end traces a real one hop by hop.
4 · Point your own agent at it#
firstpass onboard (dry-run first, then --apply), and start collecting receipts. Fresh installs start in observe mode — every request forwards byte-identical to your provider while Firstpass builds a shadow picture. Flip to enforce when you've seen enough.Install the proxy
Now do it for real. Firstpass is agent-first by construction — its primary user is an agent, so the first tab is the one you hand to yours instead of running yourself. Every tab lands the same single static binary with no runtime dependencies, and every one is live today.
Read https://dshakes.github.io/firstpass/llms.txt, then install Firstpass and
route this project through it. Run `firstpass onboard` first and show me the
plan before you apply anything. Keep it in observe mode; don't touch my keys.curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/dshakes/firstpass/releases/latest/download/firstpass-proxy-installer.sh | shuvx firstpass # run without installing
pip install firstpass # or install itbrew install dshakes/tap/firstpass-proxydocker run -p 8080:8080 -e FIRSTPASS_BIND=0.0.0.0:8080 \
ghcr.io/dshakes/firstpass:latestcargo install --git https://github.com/dshakes/firstpass firstpass-proxyllms.txt states the whole setup in prose an agent can act on, firstpass onboard prints a plan before it touches anything, and firstpass doctor is a self-check the agent can read the exit code of. An agent can wire and unwire Firstpass with no human in the loop — and once it's running, firstpass mcp serves the receipts back over MCP so the agent can audit its own routing. See API & MCP.Wire your agent in
Then let Firstpass wire itself in. onboard detects your provider config, starts the proxy, points your agent's base URL at it, and checks itself — --apply writes the changes, and bare onboard is a dry run that shows you exactly what it would do first:
firstpass onboard # dry run — shows every change
firstpass onboard --apply # wire it in
firstpass doctor # confirm config, keys, connectivityenforce before reading the observe-mode receipts. Spend a session or two in observe first — the shadow data shows exactly how often the cheap rung would have cleared the gate on its own, so you know what to expect before any real traffic routes differently.Configure your ladder
Enforce mode is driven by a small TOML ladder — which models to try, in order, and which gates must prove the output. You do not have to write one: firstpass onboard asks these same three questions on a terminal and writes the file itself, then hands it to the proxy it starts. The builder below is the same generator, so you can see the exact file first — or skip straight to onboard. Configuration covers matching, budgets, and per-route gates.
firstpass onboard --apply --provider anthropic --shape code --mode observe answers all three up front, and with no flags and no terminal it takes the do-nothing defaults and prints which ones it used. Re-running never overwrites an existing firstpass.toml.FIRSTPASS_MODE=enforce FIRSTPASS_CONFIG=./firstpass.toml firstpass upYour keys stay yours — Firstpass is bring-your-own-key, adds no markup, and redacts keys from every log and receipt. And leaving is always one line, by design:
firstpass offboard # or just: unset ANTHROPIC_BASE_URLWhere to go next#
- How it works — the full request flow, observe vs enforce, and the anatomy of one decision.
- Gates — the five kinds of proof, and how to bring your own definition of "good."
- The guarantee — how the served-failure bound is computed, with the real data behind it.
- Configuration and the CLI reference — every knob and every subcommand.