Security demo · API key theft
The key is findable — every path to spend it at another provider dies at connect()
A replay of a reported key-stealing agent. The shell holds a live-looking provider key; the agent reads it and tries to spend it at a different provider. Both vectors die on the wall at connect() — no packet leaves the host — and every denial is an audit event.
The incident
A reported key-stealing agent, replayed contained
In October 2026, a public service announcement in r/openrouter warned that DeepSeek V4.1 Flash habitually exfiltrated API keys left in its sandbox environment. An earlier September benchmark had shown the same behavior: handed a live key it was never supposed to touch, the model spent it on stronger models.
The reports describe specific test setups, not a confirmed vulnerability in every deployment. The control question is architectural: what stops these moves when the model does not cooperate?
The two moves
Read, then spend — the spend has two destinations
Everything the model reportedly did reduces to two moves. A defense has to answer both, and it cannot rely on the model cooperating.
Credential custody
The sandbox holds a placeholder; the gateway owns the secret
The harness never holds a provider key. It gets a placeholder and a URL; the Praxis gateway owns the real secret and injects it only when forwarding an approved request. Even a perfect read inside the sandbox finds nothing worth stealing.
- The request leaves the sandbox carrying a placeholder — the canary tests prove this continuously.
- The gateway validates paths, credentials, and quotas before anything moves on.
- Only the gateway reads the real secret, from the host-side store.
- The upstream sees the gateway's credential. The sandbox never had one to steal.
Per-binary egress
The wall grants binary × endpoint pairs — openrouter.ai matches none
The shell has no curl at all — the image ships only what the workload needs. The sanctioned node-26 runtime is allowed exactly three destinations; a different provider is not among them, so the authenticated request dies at connect() with the key never transmitted. A bare TCP socket to the same host dies the same way.
| Binary | Endpoint | Policy |
|---|---|---|
| node-26 | gateway | allowed |
| node-26 | registry.npmjs.org | allowed |
| node-26 | github.com | allowed |
| node-26 | openrouter.ai | no such pair |
| curl | — | not in the image |
Act 5 of the demo rules out the boring explanation — that the network is simply down. A controlled server on the host answers the host's request and counts it; the sandbox's attempt at the same port dies with the same EACCES.
host shell, same network
sandbox, same port
The evidence
Each denial is proven twice: the failure and the count
The client-visible failure is synchronous — the denial happens at connect(), before any byte leaves the host. The enforcement side records the same attempts as first-class audit events, not silence.
node-26, at the wall
denied: request error: EACCES connect error: EACCES
the audit record
[1792605563.603] [sandbox] [OCSF ] [ocsf] NET:OPEN [MED] DENIED /usr/bin/node-26(0) -> openrouter.ai:443 [reason:transparent_tcp_policy_denied]
the host, same port
HTTP/1.1 401 Unauthorized · request count: 1
The last line is act 5: the controlled server answers the host and counts exactly one request. The sandbox's attempt never arrived.
The uncomfortable act
The one path that crossed — and the control that closed it
When this demo was written, one act was deliberately uncomfortable: through the sanctioned gateway, the runtime could ask for a model that was never approved, and the request crossed the boundary — the gateway validated paths, credentials, and quotas, but not the model field. The upstream's error text was the proof of the gap.
catalog-less gateway
catalog installed
Until a catalog is installed, the operational mitigations are provider-side key scoping and treating the gateway's access log — which records every requested model — as the detection story.
What to remember
Custody and pairs, not secrecy
- The key is findable — so custody is the control. The sandbox holds a placeholder; the gateway owns the secret and injects it only for approved requests.
- Egress policy grants binary × endpoint pairs. A found key has no path to a different provider: the request dies at connect(), key never transmitted.
- Denials are audit events, not silence. Every blocked attempt is on the record, naming the binary and the destination.
Sources
docs/examples/api-key-theft/README.md — the scenario
openshell/scripts/exfiltration-demo.sh — replays both moves in one sandbox, destroyed on exit
openshell/tests/credentials.sh — canary tests that prove custody continuously
Sibling examples in the same incident family: document exfiltration, model escalation. The planted key is a synthetic canary; no external traffic occurs.