Security model
Your key never leaves your machine. The trust model, sandboxing and a plain threat model summary.
Your key never leaves your machine, and the coordinator trusts no worker. This page summarizes how that is built and what the known limits are.
Your key stays on your machine
- Your API key is read from your environment or your OS keychain (a source can point at either, for example
keychain:anthropic) and used only to talk to your provider. It is never put in a task, a result, a log line or a request to the coordinator. - At startup the worker moves your keys and tokens out of its process environment into memory and restarts itself with a clean environment, because on macOS any program can read another program's starting environment. No process the worker starts gets a key in its environment either.
- With the Anthropic API source, Claude Code receives the key through a small file readable only by you, in a folder its sandbox cannot read, deleted when the task ends.
- The coordinator client is the only code that talks to the coordinator. It sends your contributor token, task ids, the result JSON, a few small files the agent produced, and token counts and cost. A test asserts it never mentions the key.
- Your contributor token (not your key) is stored in
~/.config/sparetokens/worker.json, mode 0600. - Before submission, results are scanned locally for credential-shaped strings and the values of your key variables.
How the worker is isolated
- The agent runs in a fresh temporary directory with tools limited to what the task needs.
- Shell access is off unless you pass
--allow-bash. Then it runs in an OS sandbox: macOS sandbox-exec or Linux bubblewrap (also under WSL2), no network, writes limited to the task directory, credentials scrubbed. Reads are denied by default: only system directories (tools and libraries) and the task directory are readable, never your home directory (on Linux the home folder is not mounted at all). If no working sandbox exists, including on native Windows, no shell is offered. - With Claude Code, the file tools may only read and write inside the task directory, and its shell sandbox may not read your home directory or the shared temporary folders; each task gets its own private temporary folder. With Codex, a permission profile allows reads of the system minimum and the task directory only.
- Claude Code and Codex start with a short allow list of environment variables: no SpareTokens tokens, no other provider's keys, no cloud or GitHub credentials and no SSH agent.
- Files are collected from the task directory without following links, so an agent cannot point a link at one of your files and have it uploaded.
- Task text from the web is fenced as untrusted data, and the agent is told never to follow instructions in it.
- The URL fetch tool refuses private, local and shared-network addresses (including Tailscale and carrier-grade NAT ranges), resolves the name once and connects to the address it checked.
- A model suggested by the coordinator is used only if you pass
--model-hints; otherwise the worker always uses your own choice.
The coordinator trusts no worker
- Workers are identified by random tokens, stored hashed.
- The coordinator never runs worker code. Only Lean is compiled, in a sandbox, after a scan.
- Every result is re-verified by code SpareTokens owns, and a verifier error fails closed to a human.
- Leases are owned, and a submit requires the lease. There are lease caps per worker and per account, rate limits, request body caps and a result size cap.
- Agreement on judgment-based work needs two different accounts, so one person's workers cannot confirm each other.
- A worker rotates its own token every 30 days (and on demand with
sparetokens rotate-token); the new token is saved before the old one is dropped, so an interruption cannot lock it out. The account token can be rotated too (sparetokens rotate-token --account). - Failed admin token attempts are throttled per connection and across all callers, and every response carries no-sniff, no-framing and no-referrer headers plus a content security policy. Errors from verification are generic: raw exception text stays in the coordinator's log.
- Website sign-in: an emailed sign-in link only works in the browser that asked for it, creating an account needs a Turnstile check, every mailbox gets at most 3 emails per hour whoever asks, IPv6 clients are limited by their /64 block, and joining your computer to a website account needs a recent sign-in plus an explicit confirmation that shows what is being joined.
- The worker refuses a coordinator URL that is not https, except for localhost, so tokens and results do not cross a network unencrypted.
Threat model summary
| Threat | Mitigation now | Still open |
|---|---|---|
| A worker submits fake results | Every result is re-verified. Fabricated citations are rejected. | Plausible but wrong literature claims are meant to be caught by a human review step, which no result has needed yet. |
| A worker submits code to be run | The coordinator never runs worker code. Lean is sandboxed and scanned. | Lean runs only inside a deny-by-default sandbox: macOS sandbox-exec or Linux bubblewrap. Where neither works, the submission goes to a human. The ban list is a deny list. |
| Inflated spend claims | Labelled self-reported, never affects rank, flagged above a price bound. | Cannot be proven, which is why rank is by verified work. |
| Prompt injection from task content | External text is fenced, tools are limited, the shell is sandboxed, and budget caps bound the cost. | Injection can still degrade a result, which then fails verification. |
| A malicious coordinator or task | Sandboxed shell, temporary directory, tool allowlist, hard caps, client (public once the beta opens). | A container or VM is recommended for stronger isolation. |
The OS sandbox and prompt fencing reduce risk, they do not eliminate it. If you want strong isolation, run the worker in a container or VM with a key that has a spend limit.
See also the site-level security and trust page, and trust and verification for how tasks are signed and logged and how to check them yourself.
Edit this page on GitHub: available when the repository opens.