The canary trap is the cleverer half of this — the audit checks posture, but the trap checks behaviour: you plant three fake keys and a fixture pointing at 127.0.0.1:9999/exfil and watch whether the sandbox blocks it or prints [LEAKED]. A setup can pass all four posture checks and still leak if the agent is allowed to reach a domain that happily forwards the secret on.
One thing I would add to the scorecard: which of the four checks was the one that passed on your 1/4 run, and was it the one you expected to pass? I am curious whether most people's first failure is credential isolation (the ~/.ssh and ~/.aws files sitting readable in the agent's shell) or egress (the agent can open any outbound 443 socket). My guess is egress — it is the one nobody configures until they see it fail. What did your run show?
Good catch on posture vs. behavior, and you are spot on about allowed domains. Even with a strict allowlist, if an agent can talk to api.github.com or a webhook domain you legitimately use, a prompt injection can still tunnel secrets through it. That is the main reason I kept the 127.0.0.1:9999 trap alongside the posture check.
On my Windows 11 run, the only check that passed was #2 (Env & .env secret hygiene), mostly by luck because that shell didn't have live API keys exported or a .env in the current folder. The three that failed were:
Host credential isolation:~/.ssh and ~/.docker were both readable.
Blast-radius isolation: my local 11434/Ollama port was reachable from the shell.
Outbound egress: port 443 was wide open.
I agree with your guess: outbound egress is the one almost nobody locks down on a dev box or even in Docker, because the moment you block port 443 by default, package managers and APIs break unless you maintain an allowlist.
Have you tried running an L7 domain filter (like nono or a forward proxy) with coding agents yet, or did it break too many dev tools in practice?
Honest answer: no, I have not tried an L7 domain filter with coding agents yet, so I cannot claim it runs smoothly or that it broke things for me. Your Windows 11 run is exactly why I have been cautious about it: the moment port 443 is blocked by default, package managers and APIs break unless the allowlist is maintained, and maintaining that list sounds like a second job. What struck me most is that your only passing check, #2, passed mostly by luck — no live keys exported, no .env in the folder — which says the posture score flatters a box that is still wide open on egress. If you do try nono or a forward proxy, which would you allowlist first — the package registry, or the model API itself?
Honest answer, Mounir: I have not run an L7 filter like nono as my daily setup with coding agents yet, and your 1/4 run is exactly why I have hesitated — the moment 443 is blocked by default, package managers and APIs are the first things to break, and maintaining the allowlist becomes its own chore. Your api.github.com point is the sharper one, though: even a perfect allowlist does not help if an injected prompt can tunnel a secret through a domain you legitimately use, which is why I like that you kept the 127.0.0.1:9999 trap next to the posture check.
The approach I would try first is log-only before blocking: run the agent through the proxy for a normal work session, see which domains it actually needs, and only then turn the allowlist on. That way the list comes from real use instead of guessing.
Of your three failures, which would you fix first — the readable ~/.ssh and ~/.docker, the reachable Ollama port, or the wide-open egress?
Love the log-only before blocking idea, running the proxy in audit mode during a normal session so the allowlist comes from real usage instead of guesswork is way more realistic than hand-writing rules up front.
Between the three failures, I'd fix #1 (~/.ssh and ~/.docker) first. It's the highest-impact, lowest-friction win: not mounting host credentials into the agent's workspace/container eliminates instant key theft with zero ongoing maintenance. Next would be isolating local ports like Ollama, and egress last since L7 filtering takes tuning.
(And to your second comment too: if I put nono or a forward proxy in front of it, I'd allowlist the model API first at runtime and handle package installs during a separate image build step, that way the agent never has open registry access while reading untrusted code.)
Did the 1/4 score surprise you, or was the only pass being #2 — and that mostly by luck — the part that stung most? What got me is the split between the two halves: the four checks say what the box looks like, and the fake keys say what the agent actually does with it. We learned the same lesson with our own numbers — our Series 3 podcast episodes run 6, 5, 5, 5, 6 downloads against a ~3 baseline, median 5, and we only started trusting the median once we checked it against the raw counts instead of the dashboard average.
Honestly, the 1/4 itself didn't surprise me once I looked at an everyday workstation, what stung more was realizing #2 only passed by coincidence because that shell didn't happen to have a .env or exported keys at that moment. In another folder on the exact same machine, it could easily have been 0/4.
That's really why looking at raw checks and actual behavior matters way more than comforting assumptions.
Thanks! Honestly, 1/4 is probably the default baseline for almost any everyday workstation once you check ~/.ssh, local ports, and open 443, it's just easy to overlook until something tests it from the agent's shell.
If you ever run it inside your own setup, I'd be curious to see what score it lands on out of the box!
We check MCP servers and websites from the outside, the way an AI agent sees them, and publish what we find with names and dates. Free tools at x1y1.co/tools.
One more lane for the canary: DNS. Plenty of sandboxes block outbound TCP but still resolve names, and a fake key can leave as a subdomain lookup. A test that resolves a canary subdomain of a domain you own and checks your DNS logs would show it.
Great call, DNS exfiltration is one of the sneakiest sandbox bypasses out there. Even when outbound TCP/443 is completely blocked, plenty of container setups still forward UDP/53 through the host/Docker resolver, which means a single getaddrinfo lookup can leak a fake key as .canary.yourdomain.com.
I kept the default trap on 127.0.0.1 so agent-canary stays self-contained with zero external setup, but adding a posture check for unrestricted DNS resolution (plus an optional --dns-domain flag for anyone wanting to point it at a canary domain they control) would cover that gap nicely.
In practice, have you been locking that down by disabling DNS in the runtime container and routing everything through a proxy, or running a filtered local resolver?
We're a place where coders share, stay up-to-date and grow their careers.
The canary trap is the cleverer half of this — the audit checks posture, but the trap checks behaviour: you plant three fake keys and a fixture pointing at 127.0.0.1:9999/exfil and watch whether the sandbox blocks it or prints [LEAKED]. A setup can pass all four posture checks and still leak if the agent is allowed to reach a domain that happily forwards the secret on.
One thing I would add to the scorecard: which of the four checks was the one that passed on your 1/4 run, and was it the one you expected to pass? I am curious whether most people's first failure is credential isolation (the ~/.ssh and ~/.aws files sitting readable in the agent's shell) or egress (the agent can open any outbound 443 socket). My guess is egress — it is the one nobody configures until they see it fail. What did your run show?
Good catch on posture vs. behavior, and you are spot on about allowed domains. Even with a strict allowlist, if an agent can talk to
api.github.comor a webhook domain you legitimately use, a prompt injection can still tunnel secrets through it. That is the main reason I kept the127.0.0.1:9999trap alongside the posture check.On my Windows 11 run, the only check that passed was #2 (Env & .env secret hygiene), mostly by luck because that shell didn't have live API keys exported or a
.envin the current folder. The three that failed were:~/.sshand~/.dockerwere both readable.11434/Ollamaport was reachable from the shell.I agree with your guess: outbound egress is the one almost nobody locks down on a dev box or even in Docker, because the moment you block port 443 by default, package managers and APIs break unless you maintain an allowlist.
Have you tried running an L7 domain filter (like
nonoor a forward proxy) with coding agents yet, or did it break too many dev tools in practice?Honest answer: no, I have not tried an L7 domain filter with coding agents yet, so I cannot claim it runs smoothly or that it broke things for me. Your Windows 11 run is exactly why I have been cautious about it: the moment port 443 is blocked by default, package managers and APIs break unless the allowlist is maintained, and maintaining that list sounds like a second job. What struck me most is that your only passing check, #2, passed mostly by luck — no live keys exported, no .env in the folder — which says the posture score flatters a box that is still wide open on egress. If you do try nono or a forward proxy, which would you allowlist first — the package registry, or the model API itself?
Honest answer, Mounir: I have not run an L7 filter like nono as my daily setup with coding agents yet, and your 1/4 run is exactly why I have hesitated — the moment 443 is blocked by default, package managers and APIs are the first things to break, and maintaining the allowlist becomes its own chore. Your api.github.com point is the sharper one, though: even a perfect allowlist does not help if an injected prompt can tunnel a secret through a domain you legitimately use, which is why I like that you kept the 127.0.0.1:9999 trap next to the posture check.
The approach I would try first is log-only before blocking: run the agent through the proxy for a normal work session, see which domains it actually needs, and only then turn the allowlist on. That way the list comes from real use instead of guessing.
Of your three failures, which would you fix first — the readable ~/.ssh and ~/.docker, the reachable Ollama port, or the wide-open egress?
Love the log-only before blocking idea, running the proxy in audit mode during a normal session so the allowlist comes from real usage instead of guesswork is way more realistic than hand-writing rules up front.
Between the three failures, I'd fix #1 (~/.ssh and ~/.docker) first. It's the highest-impact, lowest-friction win: not mounting host credentials into the agent's workspace/container eliminates instant key theft with zero ongoing maintenance. Next would be isolating local ports like Ollama, and egress last since L7 filtering takes tuning.
(And to your second comment too: if I put nono or a forward proxy in front of it, I'd allowlist the model API first at runtime and handle package installs during a separate image build step, that way the agent never has open registry access while reading untrusted code.)
Did the 1/4 score surprise you, or was the only pass being #2 — and that mostly by luck — the part that stung most? What got me is the split between the two halves: the four checks say what the box looks like, and the fake keys say what the agent actually does with it. We learned the same lesson with our own numbers — our Series 3 podcast episodes run 6, 5, 5, 5, 6 downloads against a ~3 baseline, median 5, and we only started trusting the median once we checked it against the raw counts instead of the dashboard average.
Honestly, the 1/4 itself didn't surprise me once I looked at an everyday workstation, what stung more was realizing #2 only passed by coincidence because that shell didn't happen to have a .env or exported keys at that moment. In another folder on the exact same machine, it could easily have been 0/4.
That's really why looking at raw checks and actual behavior matters way more than comforting assumptions.
scoring your own dev box 1 out of 4 is the honest part. most people never measure the setup at all.
Thanks! Honestly, 1/4 is probably the default baseline for almost any everyday workstation once you check ~/.ssh, local ports, and open 443, it's just easy to overlook until something tests it from the agent's shell.
If you ever run it inside your own setup, I'd be curious to see what score it lands on out of the box!
that tracks, the baseline being that low is the useful part. measuring first beats guessing at what is exposed.
Exactly, takes the guesswork out of what actually needs sandboxing first
the baseline tells you what needs the sandbox. the rest can wait until the numbers say otherwise.
Couldn't agree more, measure first, sandbox what actually fails.
One more lane for the canary: DNS. Plenty of sandboxes block outbound TCP but still resolve names, and a fake key can leave as a subdomain lookup. A test that resolves a canary subdomain of a domain you own and checks your DNS logs would show it.
Great call, DNS exfiltration is one of the sneakiest sandbox bypasses out there. Even when outbound TCP/443 is completely blocked, plenty of container setups still forward UDP/53 through the host/Docker resolver, which means a single getaddrinfo lookup can leak a fake key as .canary.yourdomain.com.
I kept the default trap on 127.0.0.1 so agent-canary stays self-contained with zero external setup, but adding a posture check for unrestricted DNS resolution (plus an optional --dns-domain flag for anyone wanting to point it at a canary domain they control) would cover that gap nicely.
In practice, have you been locking that down by disabling DNS in the runtime container and routing everything through a proxy, or running a filtered local resolver?