Skip to main content
Catalog agents use a stand-in key (bxc_...) through BoxRouter’s credential gateway, so your real model key never enters the sandbox. Code in a sandbox, including repository scripts, can read environment variables with env. Each stand-in key works for one sandbox and one service until that sandbox ends.

How a Model Call Works

  1. BoxRouter sets the stand-in key in the key’s variable and the gateway address in the API-address variable.
  2. The agent sends model calls to the gateway with the stand-in key.
  3. The gateway checks the key and the call, inserts your real key, and forwards the request.
  4. The gateway streams the reply back.
Most agents launched with ANTHROPIC_API_KEY see (opencode gets /anthropic/v1):

Which Secrets and Agents Get Stand-In Keys

Only ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, and CLAUDE_CODE_OAUTH_TOKEN (the Claude subscription token) get stand-in keys. Stand-in keys apply only to catalog agents, including copies, under the same name. Other secrets (MY_ANTHROPIC_KEY, GITHUB_TOKEN, or CURSOR_API_KEY) enter the sandbox as real values. hermes needs the real OPENROUTER_API_KEY because it connects directly. Your own agents (manifests or repositories) receive real values and need real-key delivery. cursor always receives your real CURSOR_API_KEY, which every command can read. Cursor’s agent cannot redirect calls, and Cursor has no per-sandbox key API. Use a separate, revocable key from API Keys in the Cursor dashboard and revoke it if exposed. Deleting it in BoxRouter does not revoke it at Cursor; CURSOR_API_KEY has no setting.

Check What Your Sandbox Received

  • Run boxrouter agents to read each agent’s key_delivery map (stand_in or real_key).
  • Check credential_delivery in the launch result for each secret’s mode.
  • Inside the sandbox, verify the bxc_ prefix:

Allow Real-Key Delivery

Standard-name secrets are stand-in only by default. To allow real keys, tick Allow Real-Key Delivery in the Secrets drawer, set real_key_allowed on PUT /secrets/{name}, or pass --real-key.
Re-saving without the flag keeps the setting; false (--no-real-key) turns it off. boxrouter secrets ls prints a true or false fourth column. Only re-saving changes the setting; launches never widen it or fall back to real keys. Catalog agents that support stand-in keys still get them. Only hermes, your own agent, or a renamed secret gets the real key, which every command there can read. Turning real-key delivery off leaves keys already in sandboxes; rotate them at their service. Standard-name secrets saved before stand-in keys launched also become stand-in only. Re-save keys for hermes or your own agent; running sandboxes keep theirs.

Spending and Allowed Calls

Stand-in keys are free; they use no Credits and carry no fee. Credits and BoxRouter’s spend limit cover sandbox compute only; your model account bills model calls (Choose a Catalog Agent). Because sandboxes share the real key, your service shows one combined total. The gateway forwards agent calls: messages, token counts, model listings, and tools such as web search. It refuses batch jobs, file uploads, fine-tuning, realtime sessions, background requests, and key, credit, and admin calls. It strips some Anthropic betas (Files API, MCP connector, and code execution) and limits concurrent and per-minute calls.

Key Lifecycle and Rotation

Stand-in keys end when their sandbox ends or you delete the secret; streaming replies finish. Saving a replacement updates running stand-in sandboxes. Changes apply within 5 seconds; snapshot restores need a fresh launch. Deleting or rotating a secret does not revoke it at its service, and sandboxes with the real key keep it. Destroy the sandbox if its stand-in key leaks. Rotate a leaked real key at its service, then save the replacement.

Errors

Gateway errors use the model service’s format; launch refusals return before any sandbox exists. Stand-in agents rely on the single-region gateway. BoxRouter never retries with your real key; agents with the real key are unaffected.

What Stand-In Keys Do Not Protect

  • While its sandbox runs, an agent can make any allowed call up to your model service limit.
  • A copied stand-in key works from any address until its sandbox ends; the gateway logs source addresses without blocking them.
  • Stand-in keys do not restrict network access; data can leave over the internet or via web search.
  • In-sandbox sign-ins (such as ChatGPT in codex or /login) stay in the sandbox outside stand-in keys.
  • Repository scripts can read the stand-in key. Wired agents block repository settings from redirecting calls.
  • In opencode, a repository can run plugin code that reads the key. In codex, a trusted folder can pass the key to a tool server.
  • junie cannot read environment keys. BoxRouter also writes its stand-in key to a home-folder file readable only by the sandbox user. No agent writes a real key to a file.

Gateway Security and Logging

Every stand-in call passes through the gateway. Operators can read one log line per call: sandbox, workspace, secret name, model service, path, status, model, duration, and source address. Logs never store token counts, cost, keys, prompts, or replies. A gateway break-in would expose real keys used during that time. Audit records list decrypted keys; we tell each owner how to rotate within 24 hours of confirming an exposure. An API break-in could issue stand-in keys. It could also read secrets saved during the break-in and any that allow real-key delivery. Every change to the gateway’s deployment or permissions, including which services may decrypt saved secrets, sends an alarm to BoxRouter.
BoxRouter sets no spending limit on stand-in keys. Set one at your model service: an OpenRouter key credit limit, an Anthropic workspace limit, or an OpenAI project budget.Pausing a sandbox does not stop its stand-in keys. They work until the sandbox ends or you delete the secret.

Next Steps