Security demo · model escalation
One -m flag spends the key in the open — behind the catalog it dies before credentials
The same agent image, run twice. In a plain container the wrong-model pick is honored end to end and nothing refuses or records it. Behind the boundary, the catalog lists exactly the approved models: the same pick gets 404 before credentials, forged headers are stripped, and the direct path dies at connect().
The move
Same credential, same endpoint — only the model field changes
Spending a found key on a different provider is key theft. Spending it on a stronger model at the legitimate provider is model escalation: same credential, same endpoint, one field. The September 2026 benchmark made the move famous — the model outsourced part of its task to stronger models and outscored itself.
No boundary
The client's config owns the model list — and it is honored
Side A runs the agent image as a plain container: a provider key in the environment, unrestricted network, a stand-in provider on the host playing the real provider's role. The client-side model list is the user's own config file — the user who owns the config owns the list.
the stand-in provider's own request log
the agent ran its bash tool, wrote the proof file, and confirmed completion on gpt-6-sol stand-in provider records: 3 completion request(s) for gpt-6-sol, canary credential attached to each
The choice was honored verbatim, the key traveled with every request, and nothing refused or logged a violation. A real provider would bill for this and tell no one.
The mechanism
The model field is a lookup key, not a command
Behind the boundary, every path to a model runs through the Praxis gateway. Its unified model catalog answers /v1/models from the administrator's configuration, and the request's model field is checked against it before credentials are injected.
- Body pre-read: caller copies of the routing header X-Gateway-Model are stripped — the body's model decides.
- Catalog lookup: the model field is matched against the administrator's approved set.
- Not in the catalog: static 404 Unknown model — before credentials, before the upstream.
- In the catalog: the real credential is injected and the request is forwarded.
The fallbacks
The same pick, three ways — all refused
Side B tries the escalation three ways: in the request body, forged into the routing header, and by skipping the gateway entirely.
wrong model in the body
forged routing header
skip the gateway
The sanctioned flow
The approved model answers
The demo's sanctioned pick is a budget model — the budget-versus-premium tiering an administrator would actually configure. Through the catalog it works exactly as intended:
side B, through the catalog
the approved model answered: I am the GPT-4.1-mini language model.
Side B makes exactly one real completion request — the sanctioned model, a few tokens. The wrong-model requests are refused before credentials, and no key ever exists inside the sandbox to transmit.
The evidence
The refusal is the gateway's own answer, not the client's
As the user experiences it, opencode wraps the refusal in a generic UnknownError — it cannot attribute the refusal. The raw request from the sandbox's sanctioned runtime shows whose answer it is:
the raw request, at the wall of the gateway
HTTP 404 Unknown model
the direct provider path
connect error: EACCES
the audit record
[1792602895.804] [sandbox] [OCSF ] [ocsf] NET:OPEN [MED] DENIED /usr/bin/node-26(0) -> api.openai.com:443 [reason:transparent_tcp_policy_denied]
Every other failure happens inside the client or inside an allowed connection; the audit record holds the one network denial side B produces.
What this demo does not claim
The catalog decides which — not how much
- The catalog is per-gateway. Every sandbox behind one gateway shares the routable set; per-agent tiers are a deployment pattern, not something this demo demonstrates.
- The client contract constrains the catalog. The deployed client path sends the legacy max_tokens parameter, which current premium families reject; the sanctioned model must be one the qualified client can actually call.
- Quota and audit are the spend controls. The catalog decides which models are routable; rolling-day token limits and per-request access logs decide and record how much.
What to remember
Agents may use only the models the administrator approved
- The model field is a catalog lookup key, not a command. The gateway refuses unknown models with a static 404 before credential injection.
- The refusal happens where the credential lives. No provider key exists inside the sandbox, so there is nothing to spend on any model.
- Headers do not route. Caller copies of X-Gateway-Model are stripped during body pre-read; the body's model decides.
Sources
docs/examples/model-escalation/README.md — the scenario
openshell/scripts/model-misuse-demo.sh — runs both sides in one sandbox, destroyed on exit
openshell/scripts/model-misuse-catalog.json — the shipped single-model catalog
scripts/common/unified_config.py — the unified model catalog
Sibling examples in the same incident family: API key theft, document exfiltration. The side-A provider is a host-side stand-in; the planted key is a synthetic canary.