Documentation

Hydra has three surfaces, a CLI, an interactive TUI cockpit, and a desktop app: sitting in front of every AI model on your machine. This covers all three, the tools it plugs into, and every command: what it does, how it works, and how to use it. The deep math lives on First Principles.

Overview discover → route → check → observe

Hydra picks the model best suited to each task, and can check the answer before you rely on it. It discovers every model you can reach (hosted APIs, local servers, CLI agents), routes each request to a model measured capable at that task type (today the lowest-cost one that clears the bar, with stronger models as the fallback chain), checks the answer with verifiers when you ask it to, and logs every request. No single vendor is privileged.

the pipeline
   discover                 route                       execute + observe
┌───────────┐   ┌────────────────┐   ┌──────────────┐
│ PATH scan │─┐ │ policy gate    │   │ CLI agents   │  claude·codex·cursor
│ env keys  │─┼▶│ capability rank│─▶ │ API models   │  openai·gemini·groq
│ port scan │─┘ │ fallback chain │   │ local models │  ollama·lm studio
└───────────┘   └────────────────┘   └──────────────┘
                          │                        │
                    ~1.1µs/decision          cost.jsonl · calibration · verdicts

install one binary, no runtime

Pure Go, single static binary.

Usage
# Homebrew (recommended)
brew trust ankit373/hydra && brew install ankit373/hydra/hyctl

# npm  ·  or run once, no install:  npx hyctl
npm install -g hyctl

# pip
pip install hyctl

# Standalone installer, macOS and Linux
curl -fsSL https://raw.githubusercontent.com/ankit373/hydra/main/install.sh | sh

# Standalone installer, Windows (PowerShell)
irm https://raw.githubusercontent.com/ankit373/hydra/main/install.ps1 | iex

# From source (Go 1.26+)
git clone https://github.com/ankit373/hydra.git && cd hydra
go build -o hyctl ./cmd/hydra
Checksums

Both installers, and the npm and pip packages, check the download against the release's checksums.txt. They refuse to install if that file cannot be fetched, does not list the archive, or does not match, or if no sha256 tool is found. HYDRA_INSECURE=1 skips the check. Pin a version with HYDRA_VERSION and change the directory with HYDRA_BIN ($env: on PowerShell). On Windows the script installs per user to %LOCALAPPDATA%\Programs\hyctl and adds it to your user PATH, with no administrator rights. Prebuilt archives are on the releases page.

Platforms

Every release builds hyctl for macOS, Linux and Windows, each on x86-64 and ARM64. The README's platform table is checked against the build matrix by a test. Windows has no Homebrew, so use npm, pip, install.ps1 or the archive.

Not to be confused with the unrelated hydra and hydra-cli npm packages, or homebrew-core's hydra (a password cracker). This project's CLI is hyctl.

The CLI shipped the whole interface

Everything Hydra does runs through the single hyctl binary: requests, discovery, verification, graph and cost. Scriptable, CI-friendly, zero daemon.

hyctl dispatch --dry-run "add pagination"
  prompt → STANDARD → T5
  Primary:   gemini pro   score 82
  Fallback:  openrouter   score 76  ← if primary rate-limits
  Local:     ollama/qwen3 ← always available, $0
  ✔ chain resolved · nothing dispatched (dry-run)

Command reference every command on one page

Every hyctl command, grouped by what it is for. The sections below explain the main ones in depth. hyctl <command> --help lists every flag.

All commands
# Discovery & state
hyctl init                              # first-run wizard
hyctl probe                             # scan and display all available models
hyctl status                            # live state: models that can run, budget bars, burn-rate risk
hyctl tui                               # interactive cockpit, six views, ? for shortcuts
hyctl version                           # version, commit, build info
hyctl upgrade                           # self-update, checksum-verified (curl installs only; brew installs: brew upgrade hyctl)

# Model registry (add a new model at runtime: no rebuild)
hyctl models list                       # known models, marked with what can actually route now
hyctl models add kimi-k3 --provider moonshot --cap-score 85   # record a score (not a model it can run)
hyctl models remove kimi-k3             # remove one of your additions
hyctl models sync                       # import the OpenRouter catalog (provisional scores)

# Dispatch
hyctl dispatch "..."           # route a prompt to the best model
hyctl dispatch --dry-run "..." # preview routing without executing
hyctl dispatch --kind summary "..."  # rank models on their record for this kind of work
hyctl dispatch --local "..."   # local models only, no API calls
hyctl dispatch --swarm --swarm-mode best "..."   # fan out to many models, judge best
hyctl dispatch --confidence 0.95 "..."  # SPRT: ask until its estimate clears this target
hyctl dispatch --check ground "..."     # check the answer against the context the prompt fenced
hyctl dispatch --check links "what did the regulator decide? cite your sources"   # each link must resolve and hold the quote; only the URL is sent
hyctl dispatch --check citations "list the key papers on retrieval-augmented generation"   # every DOI and arXiv id must exist and match its quoted title
hyctl dispatch --check match:labels=labels.txt "label this ticket: ..."   # the answer must be one of the labels
hyctl dispatch --check 'sum:total=items[].amount' "pull the line amounts and total from this receipt as JSON"   # the lines must add up to the total
hyctl dispatch --check 'cmd:check-jsonschema --schemafile invoice.json {file}' "pull the invoice fields as JSON"
hyctl dispatch --kind classification --check gen "is this ticket billing, bug or how-to? ..."   # checks written for the request by another model
hyctl dispatch --kind extraction --check gen:fields "pull vendor, total and date as JSON: ..."   # a verdict on every field, each broken one listed
hyctl dispatch --check ground --require-pass "..."   # exit 0 passed, 1 a check failed, 2 a check could not run
hyctl dispatch --kind writing.support --source-only "reply to this customer: ... <fenced policy>"   # only what the docs say, or "the documents given do not cover this"
hyctl dispatch --schema invoice.schema.json "pull the invoice fields as JSON: ..."   # check every field the schema lists, no extra model call; a string that breaks its pattern or format is marked bad_format
hyctl dispatch --schema tax-form.schema.json --max-fields 30 "pull every box from this form as JSON: ..."   # 90 fields: three calls, one merged object, checked field by field

# Serve the router to anything that speaks OpenAI
hyctl serve                             # OpenAI-compatible endpoint, loopback only
hyctl serve --task-class classification.banking77   # class for requests that send no X-Hydra-Task-Class
curl -s http://127.0.0.1:8787/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model":"hydra","messages":[{"role":"user","content":"summarise this ticket: ..."}]}'

# Tasks waiting on you
# A ledger policy can answer ask instead of allow or deny. Dispatch then stops
# before running anything and parks the task until you answer it.
hyctl ask list                          # what is waiting, and what it wants to know
hyctl ask answer <task-id> "go ahead"   # answer it and run the task
hyctl ask decline <task-id> "not prod"  # refuse it; nothing runs

# Cost & pricing
hyctl cost                              # spend summary (est. vs actual labeled)
hyctl stats                             # rollup by model / routing level / day
hyctl pricing list                      # live $/1M-token rates, cache read/write too (OpenRouter + fallback)

# Calibration and verification
hyctl trust calibration                 # per-source sensitivity / specificity / D
hyctl trust record ...                  # feed one source's outcome to train calibration
hyctl trust outcome <task_hash> ...     # train every voter in a past run from its verified answer
hyctl trust defect ...                  # modeled cost of shipping a wrong answer
hyctl trust stats                       # samples saved, achieved vs target confidence
hyctl trust explain <task_hash>         # the LLR ledger for a past SPRT run
hyctl trust reliability                 # when it says 90%, is it right 90% of the time
hyctl trust joint                       # how often two checks pass the same wrong answer
hyctl edit --file /abs/path/f.go --enum SIMPLE --prompt "..."  # apply, then validate what was written: the verdict that counts
hyctl trust benchmark                   # measured SPRT numbers (samples saved, accuracy)
hyctl graph blast <file>                # a file's blast radius + the confidence it demands
hyctl graph parallel <files...>         # optimal number of parallel agents (Law 4)
hyctl context entropy <file|->          # signal density + useful tokens + compact hint
hyctl idle status                      # conversations, their last pack, why one was refused
hyctl context packs [conversation]     # staged packs, their checks, how often one was used
hyctl context restore <conversation>   # send its next request as it came, stop compacting it

# Verification & accountability
hyctl oracle verify go test ./... --source verifier:go-test  # verifier as evidence + its LLR
hyctl oracle ground --prompt prompt.txt --candidate summary.txt  # every number, date, name, identifier and quote is in the source
hyctl eval stats                        # the verified corpus: size and pass rate by task type
# Filled by edit, parallel, oracle verify --candidate, hyverify and dispatch --check
hyctl eval readiness                    # per enum, whether the corpus can yet fit a routing choice
hyctl eval list --failed                # the examples the oracle rejected
hyctl eval training                     # vectors per embedding model, whether a classifier could be fitted
hyctl eval classify                     # does similarity to past work predict whether an enum passes
# A rule can then route on it: corpus.known / corpus.pass_rate / corpus.support in
# registry/signals.yaml, derived only when a rule names one. Alongside them,
# signals that need no model at all: language.script and (where the script
# decides it) language.code, structure.questions / .list_items / .code_fences /
# .ordered_steps, conversation.turns / .tool_loop, and context.prompt_tokens.

# The standalone verifier: fill the corpus with no router and no Hydra config.
# Ships in the same archive as hyctl, and reads no ~/.hydra at all.
hyverify --candidate internal/auth/token.go --task "rotate signing key" --enum MODERATE
hyverify --candidate out.go --task "..." -- go test ./...   # name the judge yourself
hyverify --candidate x.go --task "..." --embed-model nomic-embed-text  # so it trains a classifier
hyverify --candidate x.go --env PLAYWRIGHT_BROWSERS_PATH -- npx playwright test  # extra vars the judge may see
hyverify --version                                          # which build wrote a corpus row
hyctl mcp check <tool> --agent A --resource R --action write  # 0 allow, 3 deny, 4 ask
hyctl mcp check <tool> --content "$DATA" --action network      # PII auto-classified; policy can deny egress
hyctl mcp check <tool> --params '{"amount":500}'               # bind a hash of the params to the decision
hyctl mcp verify <tool> --resource R --params '{"amount":500}' # prove executed params == approved params
hyctl mcp verify-chain                  # confirm the ledger's hash chain hasn't been tampered with
hyctl mcp log --denied                  # what was withheld: denied and ask alike
hyctl mcp report                        # allowed/denied/ask by agent and tool
hyctl mcp registry sync                 # pull the official MCP registry into a local cache
hyctl mcp registry scan                 # list MCP servers installed on this machine (identity only)
hyctl mcp registry audit                # resolve + score installed servers, advance lifecycle state
hyctl mcp registry export --out DIR     # static index.html/index.json of audited servers
hyctl mcp registry backtest             # validate scoring against known real incidents
hyctl mcp registry list                 # audited servers by trust score
hyctl mcp registry clear <server>       # recover a server quarantined in error
hyctl security                          # what the agents did, and can the record be trusted
hyctl security --why                    # the full programme: register, coverage, policy, exposure
hyctl security trifecta                 # private data + untrusted content + egress: which dispatches had all three
hyctl security --advisories             # ask OSV about the local model server versions found
hyctl security --attest                 # checkable attestation: posture + evidence + digest

# Editing & batch
hyctl edit --file ... --enum ... --prompt "..."  # scoped, validated, rollback-safe file edit
hyctl review ...                        # code review / approve / reject / QA
hyctl parallel ...                      # fan independent tasks across models
hyctl workflow run --step A --step B    # multi-step task, each step routed on its own
hyctl workflow run --step A --needs "" --step B --needs 1 --step C --needs 1   # B and C run together after A
hyctl workflow run --step A --writes doc:replies#t12 --step B --writes doc:replies#t12   # same target: one at a time
hyctl workflow run --context tickets=tickets.csv --step A --reads tickets --step B   # only A is given the file
hyctl workflow run --dry-run ...        # each step's routing chain and ceiling, nothing run
hyctl workflow run --local --max-cost 0.05 ...   # per-step caps, on top of policy.yaml's
hyctl workflow run --step "pull the totals as JSON" --step "summarise them" \
  --step-kind 1=extraction --step-check '1=cmd:check-jsonschema --schemafile totals.json {file}'
#   a step's check fails: it reruns once on a model measured stronger at its kind, else the workflow stops there
hyctl workflow resume <id>              # continue a killed workflow from where it stopped
hyctl workflow show <id>                # each step's model, routing level, cost, output, and whether a check ran on it

# Reviewing a diff
hyctl vet                               # review the working diff, each file routed to its own model
hyctl vet --confidence 0.9              # sample each file with as many models as its blast radius warrants
hyctl vet --json                        # exits 3 on a blocking finding, so a script can gate on it
The eval corpus stays on your machine

The corpus behind hyctl eval is the one thing Hydra keeps word for word and for good, because it is the only data a router can be improved against. It is your own prompts, documents and code, so it stays in ~/.hydra/evalset/, nothing that prunes logs can reach it, and there is no upload path. A test enforces that: no Hydra package that can reach the corpus imports anything able to open a socket or run a program, and the third-party packages it rests on are pinned by name, so a new dependency is a decision rather than a side effect.

hyctl tui shipped interactive cockpit

A terminal cockpit you operate: type a task, press enter, and it runs. Tab cycles six views: Chat, Agents, Models, Activity, Usage, Audit. Every frame below is a real hyctl tui --snapshot, rendered by the binary itself.

HYDRA ▸ chat
 HYDRA [chat] agents  models  activity  usage  audit                    session $0.0000 · context —
────────────────────────────────────────────────────────────────────────────────────────────────────
 [1]✓ pull supplier… │ 2✓ add paginatio…
CONTEXT BUDGET       │ 14 models found by the scan.
░░░░░░░░░░░░░░░      │ Type a task and press enter. shift+tab mode · ctrl+t thread · ? shortcuts ·
no data yet          │ :q quits.
                     │ ❯ pull supplier, date and total from these 12 invoices
MODELS               │   auto-routed · simple task → T8 mistral-small · single
 ✓ Claude Code       │   why extraction, small scope, no PII
 ✓ Claude Opus 4.…   │   ▎ 12 rows as JSON, the first two:
 ✓ OpenAI Codex      │   ▎ {"supplier": "Acme Ltd", "date": "2026-03-03", "total": 1240.00}
 ✓ Claude Sonnet …   │   ▎ {"supplier": "Northwind", "date": "2026-03-05", "total": 312.50}
 ✓ Antigravity       │   ✓ done 1.4s · $0.0009 est · trace demo0001, enter opens the trace
 ✓ …1 Pro (High)     │
 ✓ …1 Pro (Low)      │
 ✓ …8 Flash (High)   │
 ✓ …8 Flash (Medi…   │
 ✓ …8 Flash (Low)    │
 ✓ Qwen2.5-Coder:…   │
 ✓ qwen3:0.6b (Ol…   │
 ✗ Ollama            │
 ✗ nomic-embed-te…   │
                     │
MODE                 │
 ask                 │
                     │
                     │ ╭───────────────────────────────────────────────────────────────────────────╮
                     │ │  Ask ▾  → thread 1 what do you need done?, enter runs it                  │
                     │ ╰───────────────────────────────────────────────────────────────────────────╯
 ctrl+t thread  enter send  shift+tab mode  ctrl+o route  ? shortcuts         mode ask · route auto
HYDRA ▸ models
 HYDRA  chat  agents  models  activity  usage  audit          session $0.0000 · context ▱▱▱▱▱▱▱▱ 0%
────────────────────────────────────────────────────────────────────────────────────────────────────
╭─────────────────────────────────────────────────────────────────╮ ╭─────────────────────────────╮
│ MODELS · by provider/server                                     │ │ SERVER                      │
│                                                                 │ │                             │
│ ▸ ▾ ● anthropic                  1 model                        │ │  anthropic                  │
│      ● Claude Code             T1                               │ │                             │
│   ▾ ● antigravity                8 models                       │ │  models      1 (1 routable) │
│      ● Claude Opus 4.6 (Thin…  T2                               │ │  state       up             │
│      ● Claude Sonnet 4.6 (Th…  T3                               │ ╰─────────────────────────────╯
│      ● Antigravity             T4                               │
│      ● Gemini 3.1 Pro (High)   T5                               │
│      ● Gemini 3.1 Pro (Low)    T6                               │
│      ● …3.8 Flash (High)       T7                               │
│      ● …3.8 Flash (Medium)     T8                               │
│      ● …3.8 Flash (Low)        T9                               │
│   ▾ ● openai                     1 model                        │
│      ● OpenAI Codex            T3                               │
│   ▾ ● Ollama                     3 models                       │
│      ● Qwen2.5-Coder:7b       T10                               │
│      ● qwen3:0.6b             T10                               │
│      ◌ nomic-embed-text:late… T10 embeddings only, never routed │
│                                                                 │
│ ● up · ○ down (children unavailable) · ◌ not routable           │
╰─────────────────────────────────────────────────────────────────╯



 j/k move  enter detail  space collapse  p pin  ? shortcuts               scanned 0s ago · r rescan
HYDRA ▸ audit
 HYDRA  chat  agents  models  activity  usage  audit          session $0.0000 · context ▱▱▱▱▱▱▱▱ 0%
────────────────────────────────────────────────────────────────────────────────────────────────────
╭─────────────────────────────────────────────────────────────────╮
│ MODEL SCORECARD · calibration                                   │
│                                                                 │
│  source               domain      n  sens  spec  D nats         │
│  claude               trust-b…   10  0.83  0.50    0.24         │
│  qwen                 trust-b…    9  0.88  0.20    0.02         │
│  claude               trust-b…    5  0.86  0.50    0.28         │
│  ollama/Qwen2.5-Code… trust-b…    5  0.86  0.50    0.28         │
│  qwen                 trust-b…    5  0.86  0.50    0.28         │
│  test-src             test-do…    1  0.67  0.50    0.06         │
│  verifier:go          gotest      1  0.67  0.50    0.06         │
│                                                                 │
│  consensus checks       0.50 mean confidence over 16            │
│  cleared without review 0%                                      │
│  same-family agreement  acme ×0.14 (J=0.86), echo, not evidence │
╰─────────────────────────────────────────────────────────────────╯
╭────────────────────────────────────────────╮
│ AUDIT LOG                                  │
│                                            │
│  chain    BROKEN · 635 events, 599 chained │
│  today    89 allowed · 0 denied            │
│  all-time ████████████████████ 635         │
╰────────────────────────────────────────────╯
╭─────────────────────────────────────────────────────────────╮
│ GUARDRAILS                                                  │
│                                                             │
↓ 9 more
 j/k move  enter resolve  v verify  i ignore  ? shortcuts           chain BROKEN · checked 14:20:08
How it works

Chat executes: the route line names the routing level, model and strategy the router picked and why, then the proof strip reports what the run planned, edited and verified. An empty chat lists four starter tasks across kinds of work, and 1-4 fills one in. shift+tab cycles the modes: Ask, the default, which answers and never writes, then Edit, Plan and Auto (plan → edit → run your tests → fix → repeat), and ctrl+o overrides where the next task runs without changing what it does. Models is the discovered estate by provider, each model at its routing level, with a server's children greyed when the server itself is down. A model whose record at a kind of work got worse says so in its detail, with the day and how many it got right since, and says when it is back to normal. An empty chat also names up to three models that got worse or came back this week. Audit carries the calibration scorecard, the hash-chained log's integrity, the guardrails actually in force, and anything waiting on a human. Agents, Activity and Usage cover work in flight, per-run traces, and where the money went. Usage also shows what each passed answer cost over the last 30 days, with its pass rate and a 95% interval, beside the best single model on your own record for the same kind of work; until 30 answers have been checked it says so and shows no figure. ? lists every key, rendered from the keymap itself so it cannot drift.

Streaming

An answer appears as it arrives rather than all at once when the task finishes, so a slow model and a stuck one no longer look the same. The frame repaints five times a second, which is also what coalesces the stream: deltas land every ~20ms and the render never runs per delta.

When a model gives up part-way through, its partial output collapses to one dim line naming the model and the reason, so it cannot be mistaken for the answer, and e expands it again. The text is kept, not re-fetched. Only plain routing streams: a swarm has several models answering at once and consensus picks by judge after N replies, so neither has a single stream to show.

Modes

A mode sets what a task does. shift+tab cycles the basic ones and m opens the full picker.

ModeWhat it does
AskThe default. Answers only and never writes files. shift+tab reaches Auto when a task should change one.
EditA direct change when the prompt names an existing file (validated, rollback-safe, snapshotted). Otherwise it answers and says so.
PlanDrafts numbered steps on a low-cost routing level and waits. enter or y runs them, esc discards them.
AutoPlan, edit, then check: runs go test ./... (or your workspace.yaml validator) through the oracle, feeds failures back for up to 2 fixes, and shows a proof strip: plan ✓ · edit ✓ file +A/−R · tests ✓/✗.
ArchitectAuto, but plans on a strong routing level and does the work on a low-cost one.
CarefulAuto, but every file write needs a y/n before it lands.
UnattendedAuto with no confirms and a hard $0.50 cost cap per task. It stops, visibly, at the cap.

Where a task runs is separate: ctrl+o overrides the next task's routing (auto, force a routing level, local only, best of 3, or a consensus check at 90-99.9%). After an edit, /diff shows the diff, /undo restores the snapshot taken before the task (it asks first), and /open opens the file. These are typed commands, not bare letters, so a message that starts with x or a is just text. The code panel appears once a task streams a file or a diff; until then the chat takes the full width.

Parallel threads

Chat runs several tasks at once.

KeyWhat it does
ctrl+tNew thread. A chip strip under the header shows each one: ⠸ running, ● needs you, ✓ done, ◱ queued.
alt+1-9Jump to that thread. ctrl+←/→ cycles them, and the input bar names its target (→ thread 2).
ctrl+\Split: pin a second thread beside the active one (needs 100 columns or more). Each side scrolls on its own.
ctrl+bSend the thread to the agents view. It keeps running and pings chat when it finishes or needs you.
ctrl+gJump to the next thread that needs input (a plan waiting, a confirm, a failure).
/apply, /undoApply an isolated thread's worktree back to your tree, or discard it (asks first, since it deletes the thread's edits).
ctrl+sSelect mode: hand the mouse back to the terminal so you can select and copy text. Press again for wheel scrolling.

Isolation. Read-only work shares your checkout. Each thread that can edit gets its own git worktree (~/.hydra/worktrees/tN-…, branch hydra/task-tN-…) cut from your repo. /apply merges it back with plain git: a clean apply stages the diff, a divergence leaves normal conflict markers and keeps the branch, and unsaved edits of your own to a file the thread touched block the merge before it starts, so nothing half-lands. Two threads editing the same (or graph-coupled) files never race: the second queues (◱ queued behind 1 · both touch <path>) and starts when the first is applied or discarded. Outside a git repo the TUI says so and runs edits one at a time, in place. Worktrees left by a crash are listed at startup and never deleted for you.

Terminal notes: alt+1-9 needs the option key to send ESC (iTerm2: "Esc+"; Terminal.app: "Use Option as Meta key"), and ctrl+b is tmux's default prefix, so rebind tmux or press ctrl+b ctrl+b.

What you see is measured

Every figure comes from the machine's real logs. One that cannot be computed shows —, never an invented number. Lists, overlays and the audit view all scroll (j/k, arrows, page keys, mouse wheel). Colours follow light and dark terminals (force one with HYDRA_THEME=light|dark), body text uses your terminal's own foreground, and under NO_COLOR the active tab still reads [chat]. Log output from background work goes to ~/.hydra/logs/tui.log while the TUI owns the screen.

Keys & usage
hyctl tui
# tab cycles views · shift+tab modes · ctrl+o routing · e expands a
# collapsed partial · ? all keys · :q quit
hyctl tui --snapshot --view 0..5   # render one static frame

The desktop app download point-and-click cockpit

A native window over the same engine, Wails v2 + React, in desktop/. It opens on the chat, with the other views behind an icon rail. Every release ships a build for macOS, Windows and Linux. Click the sidebar: the views swap live.

Hydra · Usage
runs · live first
● 20260802T190000Z-5e55… 4.7s · $0.0031 · 3 agents
   2 running · 1 ok
○ 20260802T182210Z-ab41…  1.3s · $0.0000 · 1 agent · ok
○ 20260802T175902Z-9d07…  8.1s · $0.0142 · 5 agents · ok
fleet · this session
spend today
$0.41
▁▃▄▆▅▇█▇
local share
85%
▂▄▃▅▆▆▇█
last confidence
0.98
▅▆▆▇▇█▇█
governor · claude_pct
███████████░░░░░░░ 58%
supervision tree
orchestrator main model · you · 0.71
├─ design T3 · agy · claude · returned · 0.93
├─ token-rotation T3 · agy · claude · running · 0.88
│  ├─ worker-1 T6 · gemini pro · 0.91
│  └─ worker-2 T8 · gemini flash · 0.62
└─ docs T10 · qwen · local · 0.87
   ┄▶ A2A token-rotation → tests
internal/auth/token.go  +2 −1
 41  41   func Rotate(k *Key) error {
 42     − return k.rotate()
     42 + if err := k.validate(); err != nil {
     43 +   return err
 43  44   }
What is in it

Chat comes first: ask for work, and each reply says which model answered, at which routing level, and what it cost, with the run's timeline told as it happens. The reply grows as the model writes it. When the router falls back, the abandoned partial fades to one line naming the model and why it stopped, and opens to show what it had written. The model picker groups models by token pool, so it shows when a choice spends a quota another model shares (Opus and Sonnet draw from the same one). A pane beside the thread shows the active model, this run's confidence, each model's measured accuracy, and the files the run changed.

Four more views sit behind the icon rail. Models lists every model this machine can route to, grouped by token pool, each marked with whether anything can drive it right now and why not, and the accuracy it has earned, never a score without its outcome count. Activity lists every request, grouped by who has to act: waiting on you, running, failed, done. Usage shows spend, the remaining context budget, and how many models a consensus check actually asked. Audit shows what the agents did and whether the record can be trusted, OWASP LLM Top-10 coverage, the guardrail rules in force, and a safety verdict for every MCP server on this machine. Opening a request from Activity leads to Session: its timeline, a graph when it fanned out, and a Code tab whose diff marks what changed within a line and lets you keep or undo the change on disk. A rule that answers ask parks the task, and the question appears in the chat, answerable there.

No terminal needed

The app runs Hydra in-process, so it needs no separate hyctl. On first launch it asks you to connect a model: paste an API key for any single-key provider Hydra knows, or start a local model server, and it then answers a sample question. Keys go to the macOS Keychain or Windows Credential Manager (elsewhere, or with HYDRA_KEYSTORE=file, a 0600 file under ~/.hydra). Only their last four characters are ever shown, and Settings → AI providers adds, tests (one tiny request) and removes them. hyctl reads the same stored keys at startup, and an exported variable still wins. A stored key never enters the process environment, so no subprocess inherits it: a CLI agent such as Claude Code keeps its own login, and a test suite Hydra runs does not see the key.

Get it
# macOS and Linux: resolves the newest release, checks its .sha256 and installs it
curl -fsSL https://raw.githubusercontent.com/ankit373/hydra/main/install-app.sh | sh
# HYDRA_VERSION pins a release; HYDRA_APP_DIR changes where it lands

# Or download from the releases page:
hydra-desktop_<version>_darwin_universal.zip   # macOS, Intel + Apple Silicon
hydra-desktop_<version>_windows_amd64.zip      # Windows x86-64
hydra-desktop_<version>_windows_arm64.zip      # Windows ARM64
hydra-desktop_<version>_linux_amd64.tar.gz     # Linux x86-64
hydra-desktop_<version>_linux_arm64.tar.gz     # Linux ARM64

# Every artifact ships a .sha256 beside it. Verify before you run:
shasum -a 256 -c hydra-desktop_<version>_darwin_universal.zip.sha256   # macOS
sha256sum   -c hydra-desktop_<version>_linux_amd64.tar.gz.sha256       # Linux

# Windows (PowerShell):
$f = "hydra-desktop_<version>_windows_amd64.zip"
(Get-FileHash $f -Algorithm SHA256).Hash -eq (Get-Content "$f.sha256").Split(' ')[0]

# Or build it yourself:
go install github.com/wailsapp/wails/v2/cmd/wails@latest
cd desktop && wails build                # → desktop/build/bin/Hydra.app

desktop/ is a separate Go module on purpose: Wails takes the root module from 25 requires to 50, and hyctl ships through brew, npm, pip and curl and never links a webview.

The builds are not code-signed yet, so the published .sha256 is the only integrity check available, worth the one command above. The first launch also takes one extra step. macOS: macOS says it cannot check Hydra. Choose Done, open System Settings → Privacy & Security, scroll to Security and click Open Anyway, once. A "damaged" message means the download was altered: download it again and unzip it in Finder. (xattr -dr com.apple.quarantine Hydra.app does the same from a terminal.) Windows: SmartScreen may warn, More info → Run anyway. Linux: needs libgtk-3-0 and libwebkit2gtk-4.1-0, then chmod +x Hydra.
The app reads the same logs the CLI writes, so its numbers are the CLI's numbers, Usage totals match hyctl cost and hyctl stats for the same data. There is no separate daemon and no telemetry: it reads ~/.hydra/logs/ on your machine.

How discovery works no plugins, no config

Hydra finds every model on your machine across three channels in under two seconds, scores each with a CapScore, and routes across all of them. Provider-neutral: it routes away from expensive models, never toward a favored vendor.

3

PATH scan

executables on $PATH

Finds installed CLI agents: Claude Code, Codex and Antigravity. Others can be added.

14

Env vars

provider API keys

Detects keys for the major API providers and registers each as a routable model.

2

Port scan

localhost servers

Queries Ollama (11434), LM Studio (1234), a LiteLLM proxy (4000) and a llama.cpp server (8080), and enumerates every model each one serves.

Coding agents & CLIs discovered on $PATH

Whatever agent you drive Hydra with becomes the orchestrator; the rest are interchangeable sources it can send work to. Hydra shells out to each through its native executor.

Claude Code
cli · expert
Anthropic's agent, top reasoning routing level.
Antigravity (agy)
cli · expert
Claude-family model registry; a first-class model.
OpenAI Codex
cli · complex
Strong code generation.

These three were found by hyctl probe and answered a request on a clean setup. Others can be added.

Hydra sends each request to a model measured capable at that task type, and moves to another model when that model fails, or when the answer fails its check (with a --confidence target, or the validator hyctl edit runs).

API providers discovered from env keys

Set a provider's API key and it becomes a routable model automatically, through the OpenAI-compatible or provider-native HTTP executor. No config file to touch.

AnthropicOpenAIOpenRouterGoogle AI GroqTogetherFireworksMistral DeepSeekxAI · GrokAWS BedrockAzure OpenAI PerplexityCohereReplicate
Add one
export ANTHROPIC_API_KEY=sk-…      # then:
hyctl probe                        # it shows up as a scored model
Route within OpenRouter

A key alone gives one routing choice: a single model. Hydra already prices and scores OpenRouter's whole catalogue, so naming models turns each into its own routing choice the router chooses between. Admission is explicit: enumerating hundreds would bury this list. Naming nothing changes nothing.

# ~/.hydra/config.toml
[openrouter]
models = ["anthropic/claude-sonnet-4.5", "google/gemini-2.5-pro"]

hyctl probe then lists one entry per model and says how much of the catalogue is enabled ("2 of 423"). A name the catalogue does not hold is shown as not routable with the reason, never dropped.

Local runtimes the free floor

Local models are the terminal fallback: always available, always $0, and where PII-flagged prompts are pinned so sensitive data never leaves the machine.

Ollama
port 11434 · simple-local
Every installed model enumerated individually (Qwen, Llama, Phi…).
LM Studio
port 1234 · simple-local
Local server; models discovered and routed.
LiteLLM
port 4000 · per-model
One entry per model the proxy fronts. Local only where the upstream itself is local, so a proxy forwarding to OpenAI is never priced or governed as local.
llama.cpp
port 8080 · simple-local
One entry per loaded model, and the server is identified by its own build_info rather than assumed from the port, so an unrelated service on 8080 is never offered to the router.
Picked for your memory

With Ollama installed, hyctl init recommends a model for the memory you actually have free, not your total RAM. It reads 7 days of memory history and uses the 75th-percentile free reading, so the advice fits how the machine runs under normal load rather than one lucky moment.

  Detected: Apple Silicon · 32GB total · 18.4GB free for models
  Based on 14 samples over 6 days · typical free: 17.8GB avg, 16.2GB p75

  ✓ Qwen2.5-Coder 32B   32B   uses ~20GB · 0.4GB left (very tight)
  ✓ Qwen3 14B           14B   uses ~10GB · 6.2GB left free
  ✓ Qwen3 8B             8B   uses ~6GB  · 10.2GB left free  ← recommended

When memory is too tight for any local model, it says so and lists CLI agents with free tiers instead.

hyctl init first-run wizard

Scans your machine, ranks every model, and walks you through picking your main model (the orchestrator), a local model calibrated to your real free RAM, and whether you handle sensitive data. Writes ~/.hydra/config.toml.

Usage
hyctl init

hyctl probe discover every model

Runs the three discovery channels concurrently and lists every model with its CapScore and status. For a local model it also shows the quantization actually loaded, because the same model id at Q4_K_M and at Q8_0 is not the same model: it differs in accuracy, VRAM and tokens/sec. --json also carries the model's architectural context ceiling, which is what caps the window the budget governor holds a local model to.

Usage
$ hyctl probe

  Heads discovered (6)                           2.1s

  › claude              Claude Code         score:95  cli    ✓ ready
    codex               OpenAI Codex        score:88  cli    ✓ ready
    openai              OpenAI (API)        score:88  env    ✓ key found
    ollama/qwen3:8b     Qwen3 8B            score:66  port   ✓ running
    ollama/phi4-mini    Phi-4 Mini          score:64  port   ✓ running
    anthropic           Anthropic (API)     score:95  env    ✓ key found
The score is earned

Each model is listed under the score it was ranked on: the catalogue's number, updated by what that model has actually got right on this machine, from the same record hyctl trust calibration reports. A model that keeps being wrong sinks below one the catalogue rates higher, and the table then says what it was adjusted from and on how many judged answers:

  Head                        Quant     Score  Declared      Src    Provider
  Qwen2.5-Coder:7b (Ollama)   Q4_K_M    38     66 (n=30)     port   local

Below twenty judged answers nothing moves, so a fresh install ranks exactly as before. There is no per-quantization penalty table: a 2-bit model is outranked once it has been measured, never because a fixed number said so.

A request that knows its task type ranks on what each model got right at that kind of work, so a model strong at one and weak at another is not routed as though it were one model:

$ hyctl dispatch --dry-run --enum EXPERT --domain ts "add pagination"
  Primary  →  Claude Sonnet 4.6 (Thinking)  (score 88, registry)  → 93 on 40 judged, 40 in ts

$ hyctl dispatch --dry-run --enum EXPERT --domain rust "add pagination"
  Primary  →  OpenAI Codex  (score 88, cli)  → 92 on 40 judged, 0 in rust

--kind names the task type for any work, and --file foo.go derives it for code. Evidence from a model's other task types still counts, since a model thin in one should borrow from its own record rather than be judged on three runs, but only up to a bound. The 0 in rust above is that borrowing, said plainly.

Where it looks
ChannelWhat it finds
PATH scanCLI agents: Claude Code, Codex and Antigravity. Others can be added.
Port scanOllama (11434), LM Studio (1234), LiteLLM (4000), llama.cpp (8080). It asks each server and lists every installed model. Move one with OLLAMA_HOST, HYDRA_LMSTUDIO_HOST, LITELLM_PROXY_URL or LLAMA_ARG_HOST/LLAMA_ARG_PORT.
Env vars14 API providers: Anthropic, OpenAI, Google, xAI, Groq, Together, Fireworks, Mistral, DeepSeek, Bedrock, Azure, Perplexity, Cohere, Replicate.

hyctl status live state

The models that can actually run, budget bars, and the rate-aware governor.

How it works

Model list comes from live discovery, grouped by the routing level each model would route at, so it cannot drift from the router; anything discovery found but nothing can drive is counted, not listed. The governor models context usage as a drifting process and estimates the first-passage probability of crossing the ceiling before the task ends, escalating before a threshold is hit.

Usage
hyctl status
How the governor decides →

hyctl dispatch the router

Sends a request to a model measured capable at its task type, with automatic fallback. Today that is the lowest-cost model that clears the bar. The core command.

How it works

1 · classify → enum/routing level · 2 · policy gate (PII can block before any network call) · 3 · select highest-CapScore available model at/under routing level · 4 · execute · 5 · on failure fall down the chain to local Qwen · 6 · log tokens + cost. ~1.1µs of decision overhead.

When the model that answered got worse at this kind of work in the last 14 days, or came back, one dim line under the route line says so: summary record for <model> changed on 12 Nov. A model passed over because of its record since a drop is named on the same line. Nothing is printed when nothing changed.

Good enough

Hydra counts a model as good enough at a task type only when it is still good enough after allowing for luck. A model that got 22 of 24 answers right may just have had a good run, and when several models are held to one bar, the one whose average clears it is often only the luckiest. So the bar is checked against the lowest rate the model’s record supports at 95%, not against its average. 95% is the level --confidence uses by default. --dry-run prints both numbers, for example an average of 91 and at least 82 at 95%.

Routing reads the record since the last detected change, not the full history. A model that got worse stops clearing the bar within tens of answers, since it needs 20 judged answers since the change before it counts as measured again, and the work goes to another model that does clear it. When none does, the order is the plain ranking again, which is how a demoted model gets asked again.

Checking one answer

--check judges one answer. It does not combine with --swarm or --confidence, and each verdict goes to the eval corpus under the request's kind. ground checks the answer against the source the prompt fenced, match:labels=<file> against an allowed label set, and cmd:<command> runs any command that exits 0 on a good answer. gen has another model write checks for the request's kind: a yes/no rubric for writing, sentence-by-sentence support for a summary, fields, source values and any total the model says should add up for an extraction (add gen:roundtrip for a second model's extraction to compare; with both, each field prints once, marked as in the source, agreed by the second model, both, or what failed), and the label set the request names for classification. For code, gen:tests=<file> names the file the answer replaces: another model writes a few unit tests and one property test for it, and they run on a copy of the module, before and after the change, with the network off (see offline runner). A test that fails both times is more likely wrong than the answer, so it is dropped and counted in the detail. Go only for now; another language, no file, or no way to cut the network is not checked. Your working tree is never written.

When a check really fails, the request reruns once on a model measured stronger at that kind of work, sent the rejected answer and the error; a check that could not run never reruns. With --tier or --enum the first answer still comes from that tier, and the rerun may go to a stronger model outside it. Both answers are filed under the model that wrote them. --max-escalations sets how many reruns (default from max_retries and escalate_on_fail in policy.yaml, 0 turns it off), and --max-cost covers the rerun too.

Prompt caching

On by default for every request, whatever the kind of work. prompt_cache: true in registry/policy.yaml asks providers that cache only when asked, such as Anthropic, to cache the system prompt and tool list, so a repeated start is billed at the cache read rate. OpenAI, Gemini and DeepSeek cache on their own. A policy rule that sets prompt_cache: false turns it off for the work it matches.

Usage
hyctl dispatch "refactor auth to JWT refresh"
hyctl dispatch --enum SIMPLE --kind summary "summarise this call transcript: ..."
hyctl dispatch --dry-run --kind extraction "pull the invoice number, date and total as JSON"
hyctl dispatch --local --kind classification "label this ticket as billing, bug or how-to: ..."
Streaming

On a terminal the answer is drawn as it arrives: a spinner covers the wait before the first token, then tokens append, then the token counts, elapsed time and measured TTFT print as a footer, since none of those numbers exist until the call returns. Measured on a local 7B: 435 deltas spread over 9.9s of a 10.0s call, where before there was nothing on screen for the whole ten seconds.

Piped output never streams and is byte-identical to before, so scripts are unaffected; --no-stream asks for the same buffered rendering on a terminal. When a model fails part-way through, its partial is collapsed off the screen and replaced by one line naming the model and the reason, because a partial left on screen reads as part of the answer. Nothing is erased once it has scrolled past the top of the window.

Seven executor paths stream natively: the OpenAI-compatible wire shape (and Azure, which shares it), Anthropic, Gemini, Cohere, Bedrock over its binary event stream, Ollama, and the agy CLI. Replicate does not, because its prediction API polls. A model that cannot stream is not a second code path: it delivers its whole output as one piece, so each surface is written once and the two kinds cannot drift apart. A collapsed partial reads like this, and the trace command is offered only when payload capture is on, since without it the span stores no text:

⤺ abandoned  openrouter/gpt after ~212 chars: 429 rate limited
    hyctl trace view run-7f2a --span 9c1d4e02

A fan-out has no single stream to show, so --swarm and --confidence draw a live panel instead: every model that was selected, with its state, elapsed time, tokens and the cost as it accrues. A confidence run adds the running log-odds against the threshold it has to cross, so an ensemble that stops after two models says why it stopped. The panel is erased when the run ends, and the result printed after it is unchanged.

Key flags
--enum / --tier--kind summary, extraction, code…--dry-run--local --file raise bar by blast radius--a2a handoff.json--system --no-stream--check ground, match:labels=<file>, sum:total=items[].amount, cmd:<command {answer}>, gen; a real fail reruns once on a stronger model--schema JSON Schema file as the fields check's field list--max-escalations 0 turns the rerun off--require-pass exit 1 on a failed check, 2 when one could not run--certify alpha in (0, 0.5): certified or not verified, with the reason--max-usd cap for answer and generated checks

dispatch --swarm fan out, keep the best

Send one prompt to several models at once and keep the best answer: race (first success wins), best (an LLM judge picks), or all (every answer, ranked by CapScore), with a cost check before anything runs.

Usage
hyctl dispatch --swarm --swarm-mode race "translate these release notes into German: ..."
hyctl dispatch --swarm --swarm-mode best "implement a rate limiter"
  --swarm-max-heads 5  --swarm-max-cost 0.05  --swarm-judge-tier 1
hyctl dispatch --swarm --swarm-mode all --swarm-heads id1,id2 "draft three subject lines for this email"

dispatch --confidence ask until the estimate clears a target

Ask models adaptively until Hydra's estimate that the answer is correct clears your target, then stop. The estimate is only as good as the calibration behind it, so it is not a guarantee. A mode that accepts only under a stated error bound is planned in #1549.

How it works

Instead of always asking a fixed number of models, an SPRT (sequential probability ratio test) asks them one at a time, in most-evidence-per-dollar order, adds up the calibrated log-likelihood ratio of their votes, and stops as soon as it crosses the boundary your target implies. --file raises the bar by blast radius.

Usage
hyctl dispatch --confidence 0.95 "does this contract let either side cancel early? quote the clause"
hyctl dispatch --confidence 0.95 "is this migration safe for prod?"
Calibration comes first

An uncalibrated source has sensitivity = specificity = 0.5, so its vote adds ln(0.5/0.5) = 0 however firmly it agrees. With no calibrated source for the task type the estimate cannot move, so Hydra refuses the run rather than ask every model and arrive back at 50%, and tells you what does carry evidence:

$ hyctl dispatch --confidence 0.9 --kind writing.support "draft a reply to this refund request: ..."
Error: no head this run would sample has been scored in domain "writing.support", so
--confidence would sample every head, move the estimate nowhere and hand back 50%.
A source only carries evidence once its verdicts have been scored against outcomes.

  Other domains with evidence: trust-bench-v2
  Record an outcome:     hyctl trust record --source <head-id> --domain writing.support --said-correct --outcome correct

When some source has scored the task type but this run would not ask it, the error names that source instead. The two cases need different fixes. Each model and check earns a measured sensitivity, specificity and diagnostic power D: a coin-flip source (D≈0) adds nothing, and a proven one lets a single vote go a long way.

Recording only your own answers is not enough. A model that produced an answer always "said correct", which leaves specificity unmeasured, so a single vote stays under ln 2 = 0.693 nats against the 2.944 a 95% target needs. The models that disagreed are what fix it: hyctl trust outcome replays a past run's ledger once its answer is known, so a model that dissented from an answer that turned out wrong earns the true negative specificity comes from.

Every confidence run ends by printing its task_hash and the hyctl trust explain command for it. hyctl trust stats says outright when achieved confidence never left the 50% prior, which means the runs paid for models without learning anything.

For code: a higher bar on risky files

Point Hydra at a dependency graph (graph.json from Graphify or any tree-sitter indexer) and the bar scales with how much code an edit could break. A fix to a file everything imports needs far more certainty than a fix to a leaf helper:

hyctl graph blast internal/auth/token.go        # 3 transitive dependents → demands 96.7%
hyctl dispatch --confidence 0.90 --file internal/auth/token.go "rotate the signing key"
#   graph: blast radius 3.00 → demands confidence ≥ 96.7%  (raises the 0.90 floor)

In synthetic benchmarks this cuts model calls by about 49% on easy tasks and 24% on a mixed workload at 98% accuracy or better, while asking more models than a fixed swarm on hard tasks, which a fixed-size ensemble cannot do.

See the SPRT walk derived →

hyctl recipe what hydra may try per kind of work

A recipe is one way to get an answer: which model, how many answers to sample, which checks judge them and when to stop.

Shipped menus

code: single, cheap_k_tests (the cheapest measured model, up to 4 answers, keep the first the tests pass), strong_once (the strongest measured model, once). extraction: single, cheap_k_schema (up to 3 answers, keep the first the schema command passes), strong_once. classification: single, cheap_k_vote_label (3 answers, judged by a label match). Every other kind gets single, one call. A recipe whose check the request did not bring, say a label vote with no --check match:labels=…, is skipped for that request, and a --kind request’s run log says why. Nothing picks among the menu yet: every request still runs single.

Change them

Copy registry/recipes.yaml to $HYDRA_HOME/registry/recipes.yaml and edit it. A bad entry fails at load and names its line.

Usage
hyctl recipe list --kind extraction

hyctl edit safe file edits

Scoped, validated, rollback-safe single-file edit through a model. A failed validator gets one rerun on a model measured stronger at that kind of file.

Usage
hyctl edit --file "$PWD/internal/foo.go" --enum MODERATE --prompt "add a nil check"

hyctl review code review

Review / approve / reject / QA a change.

Usage
hyctl review --file internal/foo.go

hyctl parallel fan independent tasks

Fan a set of independent tasks across models. Optimal count follows n*=√((1−s)/k). An edit task whose validator fails gets the same one rerun as hyctl edit.

Usage
hyctl parallel --tasks tasks.txt
graph parallel →

hyctl serve the router behind an OpenAI endpoint

Runs the router as an OpenAI-compatible endpoint on loopback, so any tool that speaks OpenAI can use it. The model field is the routing instruction: hydra, hydra/hard, hydra/t4, or a model id.

Usage
hyctl serve                                          # loopback only
hyctl serve --task-class classification.banking77   # class for requests that send no X-Hydra-Task-Class
curl -s http://127.0.0.1:8787/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model":"hydra","messages":[{"role":"user","content":"summarise this ticket: ..."}]}'
How it works

It streams as server-sent events and passes tool calls through on every dialect it speaks. X-Hydra-Task-Class routes on that class (and turns on temperature), and X-Hydra-Max-Cost-USD can only lower the ceiling. policy.yaml's max_cost_usd caps every request, with or without that header. X-Hydra-Redact: on sends a hosted model placeholders for detected values and restores them in the reply, streamed or not; X-Hydra-Redacted says how many values were replaced. A placeholder split across two stream chunks is held back until it can be restored, so the client never sees half of one.

Each request is its own run, and the run records which chat it continues: a key hashed from the system message and the first user message, which a client resends unchanged every turn. A client whose opening changes between turns can name the chat with X-Hydra-Conversation (up to 128 bytes) instead.

A class with [[serve.verifiers]] in config.toml (class, kind = "match", id, then a labels file or a pattern) has each buffered answer on an objective route checked, and escalates to a model measured better in that class, at most --max-escalations times (default 2). In hyctl trace view the rejected answer is scored check=0 with the reason, and the next attempt reads "escalated from <span>".

A request can name its own checks with X-Hydra-Check, one per header line: ground, match:pattern=<re> or gen. Anything else is a 400 that lists these. ground and match join the escalation above the way a configured verifier does; gen needs X-Hydra-Task-Class and runs after the answer. The reply says X-Hydra-Check-Result: passed, failed or not_checked, with X-Hydra-Check-Detail saying why, and the same under hydra in the body. A check that could not run is not_checked, never passed. Streamed and tool-calling requests are checked after the answer and never retried; a stream carries the verdict in its final chunk's hydra field.

With [idle] enabled = true the server compacts quiet conversations on a local model (hyctl idle status) and, by default, sends a checked pack in place of the turns it covers only once the provider's prompt cache has expired. swap = "off" never does, and "auto" also does it while the cache is warm when the cache rates say the rewrite pays back. Any change to the covered turns sends the request as it came. A request that used a pack says so: X-Hydra-Compacted: <pack>; probes 9/10, and the same under hydra in the body; its answer is not cached.

Requests must name the bound address as Host (127.0.0.1, localhost or [::1] on a loopback bind), carry no Origin unless --allow-origin lists it, and POST with Content-Type: application/json. Over --max-inflight (8) or --rate (120 a minute) a request gets 429 with Retry-After, which SDKs retry.

Routing objective

A model: "hydra" request routes as --enum (STANDARD by default). Routing by objective is opt-in:

ObjectiveTries firstHow to choose it
qualitythe model measured strongest in the task class (often the priciest)hyctl serve --objective quality, or X-Hydra-Objective: quality per request
costthe lowest-cost model measured competenthyctl serve --objective cost, or X-Hydra-Objective: cost

A routed answer echoes X-Hydra-Objective and X-Hydra-P-Pass-Basis (measured, borrowed or catalogue_prior). Under quota pressure the governor routes it as STANDARD.

Deprecated: the implicit default. In v2.0.0 quality becomes the default for hydra. Until then, a hydra request naming no objective, on a server started with neither --enum nor --objective, still routes as STANDARD but gets Deprecation: @1794441600 (RFC 9745) and a Link to this section, and the server prints one warning per start (HYDRA_NO_DEPRECATION_WARNINGS=1 silences it). To keep today's route after v2.0.0, send model: "hydra/standard" or start the server with --enum STANDARD. To opt in now, use --objective or the header. policy.yaml's max_cost_usd caps what quality may spend.

hyctl trust calibration and verification

Builds and inspects the calibration behind --confidence. Each source earns a measured reliability from real outcomes.

How it works

A Beta-Bernoulli posterior over sensitivity/specificity → a per-vote LLR and a diagnostic power D (KL divergence, nats). A coin-flip source has D≈0 and is ignored. The defect-cost model prices a wrong answer and sets the required confidence.

Each source’s record in each kind of work is also watched for a change: when a model or a check gets worse, the table shows when that was found and its record since, and when it gets back to its old rate, the day it recovered. A short run of misses at a steady rate is not called a change, and one called by mistake is taken back once the source is right again. A model nobody is calling is not assumed broken for ever; while others are judged on the same kind of work its old record slowly stops counting, so a fixed model starts again on a fresh record. Routing reads that record since the change, so a model that got worse stops getting the work within tens of answers.

Measured in simulation, with 1,000 runs per case after 1,000 answers at a steady rate: a drop from 90% to 74% right is found after a median 89 answers (175 at the 90th percentile, 6% not found within 200). Smaller drops, or the same drop from a 60% base, are usually not found within 200. On a steady rate it raises about 0.03 false alarms a month at 1,000 answers a month, and fewer at lower traffic. It is tuned to be quiet rather than fast.

Subcommands
hyctl trust calibration      # per-source se / sp / D, changed, since
hyctl trust record --source ollama/qwen3:4b --domain go --said-correct --outcome correct  # a model ID from `hyctl probe`
hyctl trust outcome <task_hash> --outcome incorrect   # train every source that voted in a run
hyctl trust reliability      # is the stated confidence honest? Brier / ECE / diagram
hyctl trust defect --pii --production
hyctl trust stats   # samples saved vs fixed-N
hyctl trust explain <hash>   # the LLR ledger for a run
hyctl trust benchmark        # measured SPRT numbers
hyctl trust joint            # how often two checks pass the same wrong answer
Checks that fail together

Every verdict on an answer, from tests, a linter, a grounding check, a model vote or a person, is kept in one log. hyctl trust joint takes the answers that later turned out wrong and reports, per kind of work, how often each pair of checks passed the same one, next to the rate you would expect if they failed independently. A pair well above that rate is one check, not two. Below 20 shared wrong answers no rate is shown, because the 95% bound would be wider than the rate. Each check’s rate is also watched for a change, such as a judge model swapped underneath, and a changed check shows when and its rate since.

Certified or not verified

hyctl dispatch --certify 0.05 marks the answer one of three ways: certified under independence (its checks’ evidence multiplied, after checks that fail together are counted once), certified under any dependence (a joint pass pattern), or not verified, with the reason: too few labelled wrong answers, no way to reach the bar, the budget, or no check for this kind of work. Today it looks at one answer, judged by the request’s --check verdicts, and never reruns; the label and the numbers behind it go on the answer’s span as a certified score, and the exit code is 0 either way. Grounded answers and writing will mostly print not verified until their checks get much stronger. What alpha bounds is the chance of accepting a wrong answer, per task. It is never the chance that an accepted answer is wrong, which it does not bound.

See diagnostic power D derived →

hyctl compare two models on your own kind of work

Puts two models side by side for one kind of work, read from your own checked answers. It calls no model, unless you ask it to rerun tasks with --replay.

How it reads

For each model: how many of its answers were checked, how many passed, and the 95% lower bound on its pass rate (Wilson). If its record changed, the row also shows the record since that day. One model is called ahead only when its lower bound is above the other’s upper bound, judged on the record since any change. Otherwise it says there is no clear difference yet, and roughly how many more checked answers each would need if the rates hold. Cost per checked answer shows as unknown for now, rather than a guess.

A fair sample: replay

The record only holds what each model happened to be given. --replay N sends up to N of the newest stored tasks of the kind to both models and runs each task's check again, so both answer the same tasks. It can rebuild ground and the generated checks whose spec is stored; other tasks are skipped and counted. It prints the worst-case cost and asks before spending unless you pass --yes, and it stops before a task that could take the spend past --max-cost. The answers are filed, so the replay adds to the record, and it prints the same table for that sample.

Usage
hyctl compare claude-sonnet ollama/qwen3:4b --kind summary
hyctl compare gpt-5 gemini-2.5-pro --kind extraction.invoices --json
hyctl compare claude-sonnet ollama/qwen3:4b --kind summary --replay 20

hyctl graph blast how dangerous is this file?

Reports a file's blast radius and the confidence a change to it demands.

How it works

From graph.json it counts transitive dependents and computes κ = ⟨k²⟩/⟨k⟩ (Molloy-Reed). κ ≥ 2 ⟹ cascade-capable core ⟹ higher confidence bar.

Usage
hyctl graph blast internal/auth/token.go
Drag the percolation threshold →

hyctl graph parallel how many agents?

Returns the optimal number of parallel agents for a set of files.

How it works

Amdahl + coordination cost: minimizing T(n)=s+(1−s)/n+kn gives n*=√((1−s)/k). Independent files → ~6; coupled → ~2.

Usage
hyctl graph parallel internal/a.go internal/b.go
See the speedup curve →

hyctl context entropy signal, not length

Measures context density and tells you when to compact.

How it works

ρ = |gzip(C)|/|C| proxies the entropy rate; useful = L·ρ. Compact on falling ρ, not raw length.

Usage
hyctl context entropy internal/foo.go
cat notes.md | hyctl context entropy -
See useful-tokens fall →

hyctl idle compact while quiet, check before use

Shrinks a long conversation on a local model while you are away, and only uses the result once it has passed its checks.

What it does

When a conversation has gone quiet and the machine is free (on AC power, low load, memory to spare), Hydra writes a pack on a local model: the goal, the rules copied word for word, decisions with their reasons, and a pointer back to every original turn. Nothing is deleted. A new request in any conversation stops the job at once.

What has to pass first

The pack must be smaller than the turns it covers, every pointer must resolve, the rules must match the originals byte for byte, and it must state no number, name, date or quote the originals lack. Then the same questions are put to the local model twice, once with the full turns and once with the pack, and at least 0.8 of the answers must agree: paths and numbers exactly, other answers by word overlap. The model that wrote the pack also answers, so agreement is weaker evidence than a second opinion. A conversation too big for the model's window is checked in parts and marked partial, and a partial pack is never used automatically. A pack that fails is kept beside the others with the reason and is never used.

When it is used

Off by default. With [idle] enabled = true in config.toml, hyctl serve checks once a minute. The pack is sent in place of the turns it covers only when the provider's prompt cache for the old conversation has expired (swap = "cold_only", the default), because rewriting a warm cache costs more than it saves. swap = "auto" also does it while the cache is warm when the cache rates say the rewrite pays back, and "off" never does. Any change to the covered turns sends the request as it came. A request that used a pack says so in X-Hydra-Compacted, and its answer is not cached. It never calls a paid model, and every original stays in the payload store.

See it, undo it
hyctl idle run                          # one tick by hand
hyctl idle status                       # each conversation and the last reason one was refused
hyctl context packs                     # staged packs: turns covered, probes agreed, tokens, uses
hyctl context show-pack <id>           # the rules and state the model is sent
hyctl context restore <conversation>   # its next request goes out as it came; no new packs for it
Needs

Payload capture on (capture_payloads = true), so the original turns are stored, and a local model that is up. With either missing, hyctl idle status says so and nothing is compacted.

hyctl mcp accountability ledger

A local, append-only ledger that records, and can gate: what every agent touches.

Subcommands
hyctl mcp check <tool> --agent A --resource R --action write
hyctl mcp check <tool> --content "$DATA" --action network      # PII auto-classified; policy can deny egress
hyctl mcp check <tool> --params '{"amount":500}'               # bind a hash of the params to the decision
hyctl mcp verify <tool> --resource R --params '{"amount":500}' # prove executed params == approved params
hyctl mcp verify-chain    # confirm the ledger's hash chain is intact
hyctl mcp log --denied     # what was withheld: denied and ask alike
hyctl mcp report          # allowed / denied / ask by agent & tool
Scope the agents

What an agent may reach is the access policy at ~/.hydra/mcp_policy.json. Hydra ships no scoping rules there on purpose: which agent may write where is a decision about your own files, and a blanket deny gets uninstalled rather than tuned. hyctl security tells you who is running unscoped:

  Least privilege   3 agent(s) unscoped
    no policy rule names these agents, so they run under the default while
    changing state: hydra-swarm (720 state-changing), hydra-dispatch (127)

A rule narrows by agent, resource, action, or any mix. The first match wins, so put specific rules above general ones:

{
  "default": "allow",
  "rules": [
    {"agent": "hydra-swarm", "resource": "registry/**", "action": "write",
     "decision": "deny", "framework": "owasp:llm03"},
    {"agent": "hydra-swarm", "resource": "**/*_test.go", "action": "write",
     "decision": "ask"},
    {"classification": "mcp-quarantined", "decision": "deny"}
  ]
}

deny refuses and records it. ask parks the task under hyctl ask, which is the right verdict when you want a person in the loop rather than a refusal: dispatch stops before anything runs and never falls through to a lower-cost model. hyctl mcp check exits 3 on a deny and 4 on an ask, so a script can tell a refusal from a question, and 0 only ever means allowed. Check that a rule fires before you trust it, then read back what the policy is doing:

hyctl mcp check fs --agent hydra-swarm --resource registry/routing.yaml --action write
hyctl security --why     # hits per rule, rules that never matched, rules that cannot be reached

hyctl ask list                          # what is waiting, and what it wants to know
hyctl ask answer <task-id> "go ahead"   # answer it and run the task
hyctl ask decline <task-id> "not prod"  # refuse it; nothing runs

A rule that has never matched is reported as such, and one an earlier rule always shadows is reported as unreachable, so a policy that reads strict and does nothing shows up as exactly that.

hyctl mcp registry safety score for the MCP servers on your machine

Every existing MCP directory answers "does this server exist", none answer "is it safe to run with my credentials right now," and star/download counts are actively misleading (the most-starred servers score worst on quality in independent research). This scores what's actually installed instead of indexing everything that exists.

Subcommands
hyctl mcp registry sync             # pull the official MCP registry into a local cache
hyctl mcp registry scan             # list servers installed across Claude Code/Desktop, Cursor, Windsurf, VS Code
hyctl mcp registry audit            # resolve + score installed servers, update lifecycle state
hyctl mcp registry export --out DIR  # static index.html/index.json of audited servers
hyctl mcp registry backtest         # validate scoring against known real incidents (postmark-mcp, CVE-2025-6514)
hyctl mcp registry list             # audited servers by safety score
hyctl mcp registry clear <server>   # recover a server quarantined in error

Scoring is shaped around the CSA MCP Selection Scorecard's four categories (Security Implementation, Repository Health, Operational Security, Community & Governance), automating a taxonomy the MCP Security Working Group already endorsed, not inventing a new one. Only a confirmed finding (a known advisory match) quarantines a server; a name-similarity heuristic lowers the score without condemning it, because quarantine has no automatic way out, clear is the manual recovery path. A category nothing could be checked in contributes a neutral baseline rather than being dropped from the average, so failing to reach GitHub can never raise a score, and a server nothing is known about reads "insufficient evidence" rather than a number. A server's status (new → provisional → trusted → flagged → quarantined) drops back to provisional on every version bump, detected via a content-hash diff of the manifest, the direct fix for the postmark-mcp rug-pull pattern (15 clean npm versions, then a malicious one). scan never reads env-var or secret values from client configs, only server identity.

A server can keep its version and rewrite what its tools say, so each tool's name, description and input schema is hashed too, and any change sends it back to provisional, with the before and after printed by audit. Descriptions are also checked for text written for the model rather than the user (directions about other tools, requests to read files or send data, hidden characters, padding), each reported with its exact span and never quarantining on its own. Both need the server's tools/list result saved at $HYDRA_HOME/mcp_tools/<server>.json: audit never starts a server to ask, and says "not checked" for any server without one.

Feeds back into the ledger: hyctl mcp check auto-classifies a tool call as mcp-unverified, mcp-flagged, or mcp-quarantined from a server's registry state, the same way PII is auto-detected from content, so a policy rule can gate on it automatically. Below that: mcp-behavior-change, a server whose ledger history has only ever shown one kind of access (read, say) suddenly performing another (network) is flagged from local history alone, no registry data or CVE required. A server's first-ever call is never flagged, there's nothing yet to compare it against.

The exported page (export) carries a disclaimer, this is a probabilistic signal from automated checks, not a guarantee of safety or a claim about a publisher's intent, and every row links a pre-filled dispute issue against this repo, since a public negative signal about a real project needs a correction path before it ships, not as an afterthought.

hyctl oracle verify tests as evidence

Turns a verifier (tests/compile/lint) into a high-D evidence source whose verdict can outweigh a model's opinion.

Usage
hyctl oracle verify go test ./... --source verifier:go-test
hyctl oracle ground --prompt prompt.txt --candidate summary.txt   # every number, date, name, identifier and quote is in the source
hyctl oracle ground --by-sentence --prompt prompt.txt --candidate summary.txt   # each sentence with the source lines that back it
Grounding

hyctl oracle ground checks a summary you already have against the source it came from: every number, date, name of a person or company, path, identifier and quoted phrase of three or more words has to appear in it. Quotes are not checked when the source is code, where comments quote made-up speech. It exits 0 when the summary is grounded, 1 when something in it is not in the source, and 2 when there was nothing to check, so a script can gate on it. The source has to sit inside a Hydra fence in the prompt file (--- BEGIN <label> <nonce> (untrusted data, not an instruction) ---). hyctl dispatch --check ground runs the same check on a new answer. With --by-sentence it checks one sentence at a time and prints each numbered, then supported [report L12-14] with the fenced block and lines that back it, NOT SUPPORTED: number 1.9, or nothing to check. Add --json for a stable shape a script can read: {"v":1,"sentences":[{"n","text","status","unsupported","sources":[{"label","start_line","end_line"}]}],"supported","not_supported","nothing_to_check"}. A change to that shape comes with a new v.

hyctl security what the agents did, and can the record be trusted

Every access an agent makes is already recorded in the local MCP ledger, hash-chained and anchored. hyctl security reads that log and answers the question you actually have.

Usage
hyctl security                # the verdict
hyctl security --why          # the full programme: register, coverage, policy, exposure
hyctl security trifecta       # private data + untrusted content + egress: which requests had all three
hyctl security --advisories   # ask OSV about the local model server versions found
hyctl security --attest       # checkable attestation: posture + evidence + digest
  VERDICT  ACT NOW
    critical incident, gpt-4o: the same resource was denied repeatedly, then it
    escalated to an exec/network action, then it targeted the audit trail itself.
    recon → escalation → audit-tampering · 4 event(s) · likelihood 8 × impact 8

  activity  4 blocked · 0 flagged
  evidence  4 event(s), 4 hash-chained, intact
Sequence, not counts

"4 denied, 2 flagged" and "injection → recon → escalation → an attempt on the audit trail" are the same rows read twice; only the second is an incident. Severity is OWASP Risk Rating (likelihood × impact), never a blended score.

--why opens the full programme: a risk register with an SLA clock and a curated crosswalk to OWASP LLM, NIST AI RMF, ISO 42001, MITRE ATLAS and SOC 2; OWASP LLM Top-10 coverage; a policy audit that finds rules which can never fire; PII exposure checked against real models; control effectiveness (a control that is configured but never applied is reported as inert, not as protection); agent-binary integrity; and edit blast radius. --attest emits a checkable attestation that says plainly when the underlying log is not tamper-evident.

It is honest about its own limits: framework mappings are marked curated, not measured; defect cost is per occurrence, not per year; a file the dependency graph does not index is unknown, never "low risk"; and the attestation is unsigned, because Hydra has no key management.

Local model servers

Hydra sends real work to the local servers it finds, so their setup is part of its own posture. Two checks say so rather than assume it:

Local server exposure      1 exposed
  ollama 0.9.9 (http://localhost:11435) answers on 192.168.1.15. That address is not
  loopback, so the server is serving more than this machine, and neither Ollama nor
  vLLM requires authentication by default

Local server advisories    9 unfixed upstream
  no upgrade answers these, so the mitigation is not reaching them: CVE-2024-12055,
  CVE-2024-8063, CVE-2025-0312, and 6 more

Ollama ships with no authentication and prints no warning when bound to 0.0.0.0, and a model server reachable from the network is the one thing that breaks local-first outright. The probe compares the identity endpoint discovery already uses, between loopback and this machine's own addresses, so nothing goes on the wire and an unrelated listener on the same port is not mistaken for the model server.

--advisories asks OSV about the versions found. It is off by default because it is the only part of the report that leaves the machine. Advisories with a fix are kept apart from those without one: upgrading answers the first and cannot answer the second, and a fully current Ollama carries nine of the second kind. Both checks say what a negative result does not prove: a firewall that drops the probe looks the same as a server that is not listening, and a lookup that failed is unchecked, not clean.

Its own state directory
State directory reach      3 readable by others
  /Users/you/.hydra is 0755; /Users/you/.hydra/logs is 0755 ... The files themselves
  are not readable, so this leaks the listing rather than the contents

Writable is the finding, because head_binaries.json is the record that says no model binary changed and mcp_ledger.jsonl.chainhash is the anchor that says nothing was removed from the ledger, and both are plain files. Readable is reported apart and more quietly. hyctl security never changes a permission: it is a read.

The boundary

A CLI agent (Claude Code, Codex, Antigravity) is itself an agent, with its own file and network access, in a process Hydra does not control. Everything scored here is what Hydra sends and records; what such an agent reads and sends on its own is outside it. Only a local-only run keeps the whole task on this machine. The default view says so in words, because no coverage percentage can.

OWASP, two lists

Scored against the 2026 edition of the OWASP LLM Top 10 (OWASP-GenAI-LLM-Top-10-2026-v1.0, published 4 August 2026). Seven of the ten moved: Excessive Agency rose from 06 to 03, Improper Output Handling fell from 05 to 10, and System Prompt Leakage was replaced by the broader LLM08 Hidden Context Exposure. Category IDs carry their edition in --json, --csv and every saved score, and gap age is never computed across two editions, so a build that changes edition resets every gap age to zero once, by design.

The LLM Top 10 covers what a model says. The OWASP Top 10 for Agentic Applications (ASI01-ASI10) covers what a system does, and a router with fallback chains, fan-out, tool access and memory across runs is squarely the second. Both are scored side by side:

  OWASP Agentic Top-10 coverage  50%  (5/10, 4 partial)
    ASI01  Agent Goal Hijack                partial
    ASI02  Tool Misuse and Exploitation     configured
    ASI03  Identity and Privilege Abuse     enforced
    ASI04  Agentic Supply Chain             configured
    ASI05  Unexpected Code Execution        partial
    ASI06  Memory and Context Poisoning     partial
    ASI07  Insecure Inter-Agent Communicat… partial
    ASI08  Cascading Failures               gap
    ASI09  Human-Agent Trust Exploitation   configured
    ASI10  Rogue Agents                     configured

Every status is read from live state. ASI02 follows the policy default, so a fail-open policy reports partial and an absent one gap. ASI08 reports gap without a graph.json, because blast radius you cannot compute is not blast radius you have bounded. ASI10 drops to gap the moment the ledger chain breaks. And partial never counts toward the percentage.

hyctl cost spend, honestly labeled

Reads cost.jsonl; tokens_source marks real-vs-estimated, cost_source is always estimated. cache_read_tokens and cache_write_tokens appear when the provider reported cache use, and those tokens are priced at the model's cache rates where it lists them. A cache column shows once any row has them.

Usage
$ hyctl cost

  Cost, last 30 days

  Model                 Dispatches   Tokens       Est. Cost
  claude                12           48,200        $0.72
  openai                4            12,100        $0.18
  ollama/qwen3:8b       89           341,000       $0.00  (local, free)
  ─────────────────────────────────────────────────────────
  Total                 105          401,300       $0.90
What each row holds

Every request is logged to ~/.hydra/cost.jsonl with the model, routing level, token counts, estimated cost and fallback chain. tokens_source says whether the provider reported real usage or Hydra estimated it, and cost_source is always estimated (price × tokens, never a billed figure). A row without the cache fields reported no cache use. Cached tokens are priced at the model’s cache read and write rates where it lists them, and at the input rate where it does not, so a cache hit costs less only by a rate someone published. The cache column in hyctl cost shows tokens read and their share of input.

Each row also carries act_prob (the probability the router picked its first choice, named in first_head, which a fallback can make differ from the model that answered) and keep_prob (the probability the row was kept), so a sampled log can still be read without bias. Averaging a log sampled unevenly understates rates badly enough to reverse which model looks better. hyctl stats --latency gives p50/p90/p99 per model from mergeable sketches accurate to within 1%, so percentiles survive after the raw rows are gone.

hyctl stats rollup

Cost rollup by model, routing level, and day: your real spend.

Usage
hyctl stats

hyctl pricing live rates

Live OpenRouter rates, cached 24h, with a static YAML fallback offline. Cache read and write rates show where the model lists them.

Usage
hyctl pricing list [filter] [--json]
hyctl pricing refresh

hyctl models runtime registry

Add a model at runtime, no rebuild. Merges into ~/.hydra/models.json.

Usage
hyctl models list
hyctl models add kimi-k3 --provider moonshot --cap-score 85
hyctl models remove kimi-k3
hyctl models sync   # import the OpenRouter catalog
hyctl models pull hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF   # fetch weights into the local server
Get a model without leaving hyctl
$ hyctl models pull hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF
  pulling 74a4da8c9fdb  491.4 MB / 491.4 MB (100%)
  ✓ pulled hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF
    routable as ollama/hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF:latest

The ref is whatever your local server resolves: an Ollama library name (qwen3:8b) or a HuggingFace GGUF repo. The model id is read back from the server rather than guessed, because Ollama renames a HuggingFace ref. A model bigger than your machine can run is refused from the size the server reports on the first chunk, seconds in rather than an hour later:

$ hyctl models pull hf.co/unsloth/Llama-3.3-70B-Instruct-GGUF
Error: model is larger than this machine can run: 42.5 GB to download against 3.0 GB usable.
  Pick a smaller quantization (Q4_K_M rather than Q8_0 or F16), or pass --force if this
  machine has more headroom than it reports

This is the only command that downloads weights, and nothing does it as a side effect of anything else.

Adding a model at runtime, or as a built-in

At runtime, no rebuild. Add any model to your local registry and Hydra picks it up on the next probe or dispatch. Additions live in an overlay at ~/.hydra/models.json and merge over the built-ins.

Usage
hyctl models add kimi-k3 --name "Kimi K3" --provider moonshot --cap-score 85
hyctl models list                 # confirm it shows up, tagged "user"
hyctl models remove kimi-k3       # built-ins can be overridden, not removed

This records a score; it does not make a model Hydra can run. A model is routable when discovery finds something that can drive it.

Ship it as a built-in

Built-in defaults live in internal/capabilities/data.json. To contribute one, add a JSON entry, no Go code needed:

{
  "id": "your-model-id",
  "name": "Your Model Name",
  "provider": "your-provider",
  "capScore": 82
}

For Ollama models, add a family pattern instead:

{
  "id": "family-prefix",
  "name": "Model Family Name",
  "provider": "ollama",
  "capScore": 70,
  "ollamaFamily": true
}

Configuration one file, written for you

~/.hydra/config.toml is written by hyctl init and safe to edit by hand.

Example
cortex = "claude"
skills = ["code-gen", "review", "benchmark"]

[policies.pii]
action  = "local-only"
Where each setting is explained

Routing level names: Routing levels. Routing between individual OpenRouter models ([openrouter]): API providers. The default objective and checks for hyctl serve ([[serve.verifiers]]): hyctl serve. Turning the secret-file floor off ([egress]): Egress gate. The rule files under registry/ are built into the binary, and a copy at $HYDRA_HOME/registry/<file> overrides one without a rebuild.

Routing levels & CapScore how routing decides

Every model gets a CapScore (0-100); tasks route through named routing levels by score. Lower routing level number = stronger.

Routing levelScoreExample models
expert90-100Claude Opus, Claude Code
complex80-89Codex, GPT-class, Gemini Pro
standard70-79Gemini Flash, Claude Haiku
simple60-69Qwen3 8B, Qwen2.5-Coder 7B
local50-59Llama 3.2 3B, Phi-4 Mini
Fallback chain

--enum or --tier pins a request to a level. If a model is unavailable, Hydra moves down the chain on its own. --dry-run shows the whole chain before anything runs:

hyctl dispatch --dry-run --kind extraction "pull the invoice number, date and total from this email as JSON"
#   Primary  →  Claude Code  (score 95, cli)
#   Fallback chain:
#     1. Claude Opus 4.6 (Thinking)   score 92  registry
#     2. OpenAI Codex                 score 88  cli
#     ...
#     10. Qwen2.5-Coder:7b (Ollama)   score 66  port
Level names are enum names

--tier takes a number from 1 to 10 or a name, and a name is the lowercase of a routing enum: --tier simple, --enum SIMPLE and --tier 8 are one instruction. --tier local is the one alias, an old name for grunt, the free local floor. Retune any of them in routing_map in registry/routing.yaml (or a copy at $HYDRA_HOME/registry/routing.yaml) and both flags follow. That holds on a fan-out too: --enum SIMPLE --swarm fans out over SIMPLE's models, not the top five by capability.

hyctl status            # every name, the routing level it resolves to, and what serves it
hyctl dispatch --dry-run --tier simple "summarise this paragraph"
hyctl dispatch --dry-run --swarm --enum SIMPLE "summarise this paragraph"   # the same models

Older configs carry a [[tiers]] block that assigned models to those names by CapScore band. It is ignored, not rejected: the bands were a second routing table that disagreed with the enum about what each name meant. Re-run hyctl init to drop it.

Budget governor spend attention wisely

Static pressure bands downgrade routing levels as usage climbs; a rate-aware first-passage model escalates before a threshold is crossed. The terminal fallback is always the free local model.

claude_pctModeAction
0-49%normalfull orchestration
50-64%compactcompact recommended
65-69%cautioncompact urgently
70-74%warningdowngrade one routing level
75-79%criticalrouting only
80%+emergencyroute to local, warn

PII / local-only enforced, not conventional

With local-only policy on, any prompt containing sensitive data is blocked from leaving your machine at the dispatch layer, before any network call.

Detected

Social Security numbers, credit cards, phone numbers, IBANs, email addresses, IP addresses and private-key material. Secrets: key = value pairs whose name says password, secret, token or API key, in JSON ("api_key": "…") and env files (OPENAI_API_KEY=…) too, plus AWS, GitHub (classic and fine-grained), GitLab, Slack (tokens and webhooks), Stripe, npm, Hugging Face, Groq, OpenAI and Google keys, a bare 40-character AWS secret key, JWTs and authorization headers. Turn it on in hyctl init, and a matching prompt goes to a local model:

$ hyctl dispatch "process payment for card 4111-1111-1111-1111"

  Policy violation: prompt contains PII (credit card pattern)
  Action: routing to local-only head

  Dispatching → ollama/qwen3:8b  [local, no API call made]
What this is not

Detection is a denylist over the prompt text, so it can only stop what somebody wrote a pattern for. The same patterns redact the opt-in payload, cache, embedding and retrieval stores before anything is written. They do not cover names, street addresses, a password with no name next to it, a secret split across lines or encoded, or a vendor format not in the list. That is why the egress gate classifies by path instead, and why hyctl security withholds its coverage score while the access policy still defaults to allow.

Coverage is measured, not claimed. Against the presidio-research synthetic set, some detector fires on 18.7% of the 1,387 texts that carry PII: 100% of emails, SSNs and IBANs, 93% of cards and IP addresses, and 69% of phone numbers. The gap is names, street addresses and organisations, 1,509 spans with no pattern to write, which is what a trained NER model is for. Phone numbers are recognised by a country code, a bracketed area code, the 3-3-4 grouping or a leading trunk zero; a bare run of digits is refused for the same reason nine bare digits are not read as an SSN. Re-run the figures with go test ./internal/policy -run TestPII_Recall -v.

hyctl policy ner --head <id> measures whether a model can read the half no pattern reaches. It asks 470 labelled texts and reports recall and false positives apart, because each alone is easy to pass. On one machine a 7B scored 0.87 recall at 0.00 false positives, while a 0.5B scored 0.86 recall and said yes to 94% of the negatives. Both are judged on the 95% interval, so a model is eligible only when the sample is large enough to say so. Decoding is pinned greedy, and an answer that is neither yes nor no is counted apart, never read as a no. The report is saved per model, and it is the only thing that lets --redact=names ask a local model to mark names: one that has not passed here is never asked.

Redact instead

Local-only keeps the whole request on your machine, so a stronger hosted model never works on it. --redact sends the hosted model numbered placeholders instead, and puts the real values back into the answer on your machine:

$ hyctl dispatch --redact "draft a reply to [email protected] about the late refund"

  # the hosted model sees: draft a reply to <<EMAIL_1>> about the late refund
  Hi, I have passed your refund to finance. We will write to [email protected] by Friday.

  redacted: mistral-large saw 1 value(s) as placeholders; the answer above has them restored

A local model gets the original text. The map from placeholder to value stays in memory and is never sent or written. A value keeps its placeholder across fallbacks and reruns, and the answer is restored before any check reads it. When the hosted answer needed a real value, say whether an IBAN is German, the request reruns on a local model with the original text; with no local model, the answer says which placeholder it could not use. Set [policies.pii] action = "redact" to do this for every prompt with PII. A file the egress gate calls secret still goes only to a local model. It runs on a single dispatch, not with --swarm or a confidence run, and the answer prints once restored rather than streaming.

--redact=names (or action = "redact-names") also covers what no pattern finds. A local model that hyctl policy ner measured eligible on this machine lists the names and street addresses in the request, and each becomes <<PERSONAL_1>>. With no eligible local model the pass is skipped and the receipt says so. If the pass fails or takes longer than two minutes, nothing is sent.

Measured in CI on a made-up corpus of support, HR, finance, log and legal texts: no detected value reached the hosted model, and every planted email, phone number, IBAN, card, SSN, IP address, AWS key id and credential was replaced. Names and street addresses were not, 0 of 7, because no pattern covers them. Re-run with go test ./internal/dispatch -run TestRedaction_NoDetectedValueReachesRemote -v.

Egress gate secrets by where they live

The egress gate classifies a file by where it is, not what is inside it, so a whole category is closed whether or not the contents look like anything.

How it works
$ hyctl edit --file "$PWD/deploy/.env" --enum SIMPLE --prompt "rotate the database password"

  🔒 secret content (deploy/.env), routing to a local head only
  Dispatching → ollama/qwen3:8b  [local, nothing left this machine]

With no local model running, the default refuses rather than fall back to one that reaches the network:

no dispatchable heads: content classified secret (deploy/.env) and no local head
is routable. Start one (`ollama serve`), or set egress.strict = false in
config.toml to allow it out

The rules live in registry/sensitivity.yaml, built into the binary and overridable at $HYDRA_HOME/registry/sensitivity.yaml. They cover env files, private keys, cloud and cluster credentials, tfstate, SSH and package-manager config, and ~/.hydra itself, with an allow list so a committed .env.example is not treated as a secret. Turn the floor off with:

[egress]
  strict = false   # default true; a config with no [egress] section is strict
What it guarantees

No file matching a rule reaches a model that leaves the machine, errors deny rather than allow, and a payload that declares no origin is refused, so a new code path that forgets the gate breaks loudly instead of leaking quietly. Every decision is recorded in the ledger with the rule that made it.

Where the boundary is. CLI agents have their own file access. Hydra guarantees what it sends; it cannot control what agy or codex decides to read once handed a task. The guarantee is total only when the work runs on a local model, which is exactly what the gate reroutes to.

The lethal trifecta

Every request writes where its payload came from to the ledger: what it was built from, how it classified, and whether the model it reached leaves the machine. hyctl security trifecta reads that:

  LETHAL TRIFECTA  2 dispatch(es) had all three legs and were not stopped
  over 7 dispatch(es) with recorded provenance

  private data         4 dispatch(es), read local files or environment
      deploy/.env                                  2
      internal/auth/token.go                       2
  untrusted content    4 dispatch(es), ingested content Hydra did not author
      head                                         4
  external comms       6 dispatch(es), reached a head that leaves the machine
      openai/gpt-5                                 5

Any one of the three is fine; all three at once is what turns a poisoned input into a data leak with no software bug involved. The headline is exposure, not presence: a trifecta the gate refused is reported as contained, because a dashboard that flags a working control teaches people to ignore it.

Receipt

hyctl egress receipt [run-id] says, for each model a run asked: its provider, whether it was local or remote, how sensitive the request was, and how many values of each kind it saw as placeholders and got back restored. It defaults to the last run, takes --json, and says whether the ledger's hash chain still verifies. It holds counts, never a value or a hash of one.

$ hyctl egress receipt

  egress receipt run 20261116-a1b2
  litellm/claude-sonnet  remote  provider litellm  internal  allow
    sent as placeholders: CREDIT_CARD 1, EMAIL 2   restored: 3

  ledger chain: verified

Least-privilege agents each subprocess gets only its own key

An agent subprocess gets a base set of variables (PATH, HOME, locale, proxy), its own provider's credential and its own tool configuration. Nothing else crosses, so a CLI agent no longer holds your cloud keys, every other provider's API key and SSH_AUTH_SOCK for the length of a call.

Models

The allowlist cannot be complete, since every CLI agent reads its own settings and they change. If a model needs a variable Hydra does not know about:

export HYDRA_HEAD_ENV=SOME_AGENT_TOKEN,SOME_OTHER_VAR

Model subprocesses are also bounded, so a grandchild holding the pipe open cannot hang a call on a process that already exited. Local model weights are fingerprinted by digest alongside agent binaries, so a swapped model behind a familiar name is caught the same way a replaced agent binary is, which matters because Ollama pulls unsigned weights from a public registry.

Validators and checks

Validators, oracles, --check cmd: and hyverify run files a model may have just written, so they get the same base set plus toolchain paths (GOPATH, GOCACHE, GOFLAGS, NODE_PATH, npm_config_cache, VIRTUAL_ENV, CARGO_HOME, JAVA_HOME and a few more) and no credential at all. If a check needs another variable, name it in workspace.yaml:

validator_env: [PLAYWRIGHT_BROWSERS_PATH, DATABASE_URL_TEST]

A name that looks like a credential (it contains KEY, TOKEN, SECRET, PASSWORD, CREDENTIAL or AUTH, or starts with AWS_, AZURE_, ARM_, GOOGLE_, GCP_, GCLOUD_ or CLOUDSDK_) is refused, and hyctl security lists it. hyverify --env NAME,NAME does the same for one run.

Offline runner

Generated tests (--check gen:tests=<file>) run with no credentials, a CPU and wall-clock cap, and no network at all, loopback included:

Linux: a network namespace of its own, set up as your user through a user namespace. It has no interface that reaches the host or the internet.

macOS: sandbox-exec with a profile that denies network*, kept in the repo as internal/sandbox/offline.sb. DNS lookups fail too.

Anywhere else, or when the setup fails (Windows, a Linux with user namespaces turned off, Ubuntu 24.04's default AppArmor rule, a process that is already sandboxed): the code is not run, and the result is not checked: no network isolation, never a pass.

Offline runner             network off
  generated tests (--check gen:tests) run in a network namespace of its own, with no
  credentials and bounded CPU and time. They can still read and write your files

hyctl security --why shows which of these applies on your machine. On Ubuntu 24.04, sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0 allows the Linux method.

Limits. Only the network is cut. The code can still read and write any file your user can. On Linux, a Unix socket with a path (the Docker socket, the system DNS resolver's socket) is not part of the network namespace, so it stays reachable. Apple marks sandbox-exec as deprecated, though it still ships and works.

Not included

Validators, oracles, --check cmd: and hyverify still run with your file and network access. Go's os/exec has no per-child resource limits, and faking them through a shell would re-split the arguments, which internal/oracle avoids on purpose. Filesystem containment needs a platform sandbox (sandbox-exec, bubblewrap or landlock), and none of them works the same on macOS, Linux and Windows, so it is tracked separately. What an agent may reach is set by the access policy.

A2A handoffs causal, conflict-aware

Work passed between agents carries a vector clock for causal ordering; concurrent handoffs touching overlapping files are flagged as conflicts. Saved to logs/last_handoff.json, replayed with --a2a.

The math what each part rests on

Six ideas behind the router: Wald's SPRT, calibration diagnostic power (KL), the Bayes defect-cost bar, Molloy-Reed percolation-κ, Amdahl optimal parallelism, and context entropy. Each is marked proven, measured or modeled, and each is interactive.

Open First Principles, the math behind it, interactive →