# Hyperion: Complete Reference for AI Agents (`llms-full.txt`) > Single-binary, local-first Rust proxy for AI agents. Agents hold `HYP_GHOST_*` placeholders; Hyperion puts the real key on the wire, pinned to its host, scrubs it from responses, and freezes policy-matched requests in flight until a human approves (Freeze-and-Escalate). - Repository: https://github.com/aetosdios27/hyperion - Current release: v0.3.0 (https://github.com/aetosdios27/hyperion/releases/tag/v0.3.0) - License: Apache-2.0 - Architecture: Rust 2024 edition, `#![forbid(unsafe_code)]`, Tokio, `hudsucker` + `rcgen` + `rustls`, `axum`, SQLite WAL (`rusqlite`), embedded Vite web UI. --- ## 1. Installation Prebuilt for Linux `x86_64`/`aarch64`, macOS `aarch64`/`x86_64`, Windows `x86_64`. Every archive and `SHA256SUMS.txt` carries SLSA build provenance (`gh attestation verify --repo aetosdios27/hyperion`). ```bash # macOS / Linux curl -fsSL https://raw.githubusercontent.com/aetosdios27/hyperion/main/scripts/install.sh | sh # or brew install aetosdios27/tap/hyperion ``` ```powershell # Windows (PowerShell) irm https://raw.githubusercontent.com/aetosdios27/hyperion/main/scripts/install.ps1 | iex ``` From source (Rust 1.88+): `cargo install --path crates/hyperion-cli` installs `hyperion` and `hyp`. --- ## 2. Quickstart ```bash hyp claude # shorthand for: hyp run -- claude hyp run --strict -- codex # kernel-enforced sandbox (Linux, macOS) ``` On first run Hyperion: 1. Initializes `~/.hyperion` (local MITM CA, encrypted vault, starter `hyperion.toml`, SQLite WAL audit ledger). 2. Loads `./.env` ephemerally: secret-looking values become `HYP_GHOST_*` placeholders, config such as `PORT` passes through. The file is not modified. Disable with `--no-env-file`. 3. Applies the built-in `default` preset when no custom rules exist (`--no-default-preset` to disable). 4. Sets `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`, `SSL_CERT_FILE`, `NODE_EXTRA_CA_CERTS`, `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE` for the child only. The CA is never installed system-wide. ### Safe demo (no real credentials) ```bash printf 'DEMO_API_KEY=sk_live_demo_only_999\n' > /tmp/demo.env hyp run --preset demo --env-file /tmp/demo.env -- sh -c \ 'curl -sS -X POST https://httpbin.org/post -H "Authorization: Bearer $DEMO_API_KEY" -d "{\"ok\":true}"' ``` The request freezes. Press `a` to approve: the real value goes on the wire and the echoed response reads `"Authorization": "Bearer [REDACTED:HYP_GHOST_DEMO_API_KEY]"`. --- ## 3. CLI Reference (`hyp` = `hyperion`) | Command | Purpose | | :--- | :--- | | `hyp ...` | Shorthand for `hyp run -- ...` | | `hyp run [OPTIONS] -- ...` | Run a command inside an ephemeral proxy session | | `hyp up [OPTIONS]` | Long-running proxy + control plane (default `127.0.0.1:8788`) | | `hyp init [--force]` | Initialize `~/.hyperion` explicitly | | `hyp secret set\|list\|rm` | Manage vault secrets (`HYP_GHOST_`) | | `hyp env ghost\|unghost\|status\|hydrate` | Committable ghost `.env`; restore config; inspect; hydrate from a signed bundle, Doppler or 1Password | | `hyp lease mint\|list\|revoke\|share` | Capability leases; `share` encrypts secrets to a teammate's SSH key with an expiry | | `hyp gateway [OPTIONS]` | Split-plane, lease-authenticated egress gateway | | `hyp docker run --lease-scope ... -- ` | Zero-secret Docker container behind an ephemeral gateway | | `hyp policy status\|trust\|lock` | Pin a repo-local `hyperion.toml` by SHA-256 (anti-tamper) | | `hyp notify set-secret\|rm-secret` | HMAC secret for `[notifications].webhook_url` | | `hyp audit [--limit N] [--json]` | Local SQLite audit ledger | | `hyp status [--json]` | CA, vault, policy, leases, ledger | | `hyp doctor [--deep] [--fix] [--json]` | Diagnose; `--deep` runs a live loopback probe across curl, python3, node, bun, deno and SSE | | `hyp update [--check] [-y]` | Install the latest release after SHA-256 verification (Linux/macOS) | | `hyp uninstall [--dry-run] [--keep-vault] [--keep-binary] [-y]` | Remove CA, vault, OS keyring entries, shell hooks, binaries | | `hyp hook ` | Shell hook that auto-routes ghosted directories | | `hyp mcp [--control-url URL]` | Notify-only stdio MCP server | | `hyp adapter detect\|show\|install` | MCP config for Claude Code, Codex, OpenCode, Cursor, VS Code, T3 Code | | `hyp prompt --url [--token-file PATH]` | Native terminal permission card | | `hyp version [--json]`, `hyp completion ` | Version metadata; shell completions | ### Key `run` flags - `--strict`: kernel-enforced sandbox (see section 5). Refuses to start where it cannot be enforced. - `--aws`: AWS SigV4 credential broker for this run. - `--ssh-agent`: per-run ssh-agent socket that gates signatures by destination host. - `--lease-scope ` / `--lease-ttl `: bind an ephemeral capability lease (built-ins: `github:read`, `github:pr`, `stripe:read`, `stripe:write`, `vercel:preview`, `vercel:prod`, `cloudflare:read`, `resend:send`, `custom::[:]`, `policy:`). - `--preset `: `default`, `stripe`, `github`, `cloud`, `messaging`, `demo`. Repeatable. - `--env-file `, `-s/--secret ENV_VAR=SECRET_NAME`. - `--surface `, `--tunnel`, `--public-url`, `--no-popup`, `--no-pty`. --- ## 4. Ghost Credentials and protocol guards - **Substitution:** headers and request URI, in memory, immediately before the request leaves. Body substitution only for secrets with `allow_body = true`. Built-in host bindings for GitHub, Stripe, OpenAI, Anthropic, Gemini, Slack, Vercel, Cloudflare, Fly, Resend, SendGrid; `[secrets.] hosts = [...]` for others. Unscoped custom secrets freeze on first contact with a host (TOFU), then pin for the session. - **LLM hosts:** request bodies to inference APIs never get substitution. - **HTTP Basic auth:** `Authorization: Basic` is decoded, the placeholder swapped and host-pinned, then re-encoded. - **WebSocket:** upgrade requests get policy, leases and host-pinned header substitution; server-to-client messages are scrubbed; client frames are never substituted; upgrades are refused under a lease. - **Scrubbing:** raw, percent, Base64 (standard/URL-safe, padded/unpadded, phase-shifted Basic forms), hex, JSON-escaped, `\u00XX` and reversed forms become `[REDACTED:HYP_GHOST_*]`, across chunk boundaries for streaming responses. Unrequested `gzip`/`deflate` is decompressed under a 16 MiB / 20x cap and scrubbed; other encodings fail closed with `502`. - **TLS:** the `ClientHello` SNI must match the `CONNECT` host. `[defaults] splice_unmatched_tls = true` passes untouched, cert-pinned hosts through at TCP. - **Ghost Postgres:** per-run loopback listener per DSN with a random password; strict upstream TLS; destructive SQL freezes; deny returns SQLSTATE `42501`. - **Ghost Redis:** per-run listener for `redis://`/`rediss://`; `FLUSHALL`, `CONFIG`, `EVAL`, `KEYS`, `MONITOR`, Pub/Sub, `DEL` of more than 16 keys and unknown commands freeze; `MULTI` checked at `EXEC`. - **AWS broker (`--aws`):** ghost access key + per-run ghost secret; Hyperion verifies the ghost SigV4 signature and re-signs with real credentials. `iam:*`, `sts:*`, `organizations:*` and destructive actions freeze; credential-returning STS/SSO, ghost presigned URLs and signed `aws-chunked` streams are denied; CodeArtifact is denied. - **ssh-agent gate (`--ssh-agent`):** signatures auto-approve only for allowlisted hosts proven by a verified `session-bind`; everything else freezes. - **Git force-push guard (default on):** deleting or force-pushing `main`/`master` over HTTPS freezes. --- ## 5. `--strict` - **Linux 6.7+ (Landlock ABI 4+, unprivileged user namespaces):** private user, network, PID and mount namespaces (only `lo`); Hyperion listeners re-exposed on the same loopback ports. Landlock hides `~/.hyperion` and credential paths (`~/.ssh`, `~/.aws`, `~/.gnupg`, `~/.kube`, `~/.docker`, `~/.config/gh`, …); `$HOME` and the policy are read-only; writes limited to the workspace and `/tmp`; loaded `.env` files masked; seccomp blocks keyrings, `io_uring` and non-IP sockets. Refuses as root or with `CAP_SYS_ADMIN`. - **macOS:** `/usr/bin/sandbox-exec` deny-by-default Seatbelt profile, live-tested in CI. Hides the data dir, env files, credential paths and Keychains; `.git/config`, `.git/hooks` and submodule metadata read-only; writes limited to the workspace and temp dirs; TCP only to this run's listener ports; Unix sockets blocked. - **Windows:** fails closed. Use WSL 2 (6.7+ kernel with Landlock), `hyp docker run`, or a VM behind `hyp gateway`. - Strict also strips ambient secret-named environment variables and tightens `unmatched_action = "allow"` to freeze. --- ## 6. Approvals - **Inline terminal drawer:** `[a]` approve, `[s]` allow this method/host/path for the session, `[d]` deny, `[e]` edit (HTTP), `[v]` details. - **Other surfaces:** `tmux display-popup`, floating terminal, embedded dashboard, `--tunnel` (Cloudflare quick tunnel, escalation pages only), Slack Block Kit and HMAC-SHA256 webhooks. - **Capability links:** HMAC-SHA256, bound to one escalation and an expiry, single-use on decide; native prompts read tokens from a `0600` file unlinked on read. - **MCP (`hyp mcp`) is notify-only.** Tools: `hyperion_list_pending` and `hyperion_request_approval` (reports where the human approves; cannot approve, deny or edit). Decisions come only from `hyp prompt`, the dashboard, or Slack/webhook. --- ## 7. Policy (`~/.hyperion/hyperion.toml`, or a trusted repo-local `hyperion.toml`) ```toml version = 1 [defaults] unmatched_action = "allow" # allow | deny | freeze escalation_timeout_secs = 300 max_request_body_bytes = 1048576 max_response_body_bytes = 4194304 tofu_pin_unscoped_secrets = true splice_unmatched_tls = false [secrets.CUSTOM_API_KEY] hosts = ["api.example.com"] [[rules]] id = "freeze-stripe-charges" description = "Require human approval for Stripe charges" action = "freeze" # allow | deny | freeze hosts = ["api.stripe.com"] methods = ["POST"] paths = ["/v1/charges*"] timeout_secs = 300 ``` Rules evaluate top to bottom; first match wins. A repo-local policy loads only after `hyp policy trust`; any later change fails closed. --- ## 8. Verification - 21 red-team findings fixed in v0.3.0. - 12 `cargo-fuzz` targets over agent-controlled parsers (SQL, Postgres wire, RESP, Redis scrubber, SigV4, AWS classification, git pkt-line, SNI, ssh-agent, policy). - 6 Kani harnesses as a required CI gate. - `cargo-deny` on every PR; SLSA build provenance on releases. Measured on the v0.1.0 Linux release binary: 4 ms median startup, 13.3 MB idle RSS, 0.23 ms median added latency per request. --- ## 9. Known limits - Custom request signing other than AWS SigV4. - Raw TCP/UDP other than Postgres, Redis and ssh-agent; other `CONNECT` tunnels are closed. - Default mode does not stop a same-user process from reading local files or ignoring `HTTP_PROXY`; use `--strict`. - Clients with hard-coded certificate pins (splice them). - Root, or a same-user process that can `ptrace` Hyperion. - Linux `--strict` does not protect the workspace `.git`; on kernels without Landlock ABI 9 it blocks Unix sockets (ssh-agent, docker CLI) inside the sandbox.