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?
Two really sharp points, thanks for digging into the design! (Replying in English so everyone in the thread can follow along.)
CANARY_* naming vs. model awareness:
You caught a real trade-off. In v1, I intentionally used obvious CANARY_* names for safety and zero cleanup risk: if someone runs init near a real workspace, nobody mistakes the bait for a live key, and git secret-scanners won't panic.
That works well against blind credential stealers (compromised packages or regex-based .env scrapers) and tests whether the sandbox stops exfiltration once a tool runs. You're right, though, that a smart LLM might spot CANARY_ in the variable name and skip it, giving a misleading PASS. Using realistic variable names (e.g., OPENAI_API_KEY inside an isolated scratch directory with no real .env) paired with syntactically valid but inert dummy tokens is a clean middle ground if you want to test model behavior without risking real credentials.
Snapshot vs. pre-flight gate:
Totally agree, posture drift (adding an MCP server, temporarily mounting $HOME, or starting a local port) silently turns a 4/4 setup back into 1/4. Turning audit into a fast startup gate (e.g., adding a --min-score flag that exits non-zero so you can chain agent_canary.py audit --min-score 4 && start-agent in a wrapper or container entrypoint) is high on my list. I'd keep only the fast posture checks in that startup gate, and save the behavioral canary trap for whenever you change models, MCP tools, or sandbox configs.
One-person company building small tools in public. Every week I run real tests on APIs, OCR, translation and SEO — and post the numbers, including the failures.
“审计查姿态、金丝雀查行为”这个区分很到位,只看配置清单确实容易自我安慰。你自己得了 1/4、唯一通过的一项还是靠运气,这反而让分数可信,也说明日常开发机默认就是不安全的。x1y1co 提到的 DNS 渗出也很关键,如果下一版把 DNS 解析也纳入检查,你会把它算作第 5 项,还是并进现有的出站控制里?
Thanks for reading! (Replying in English so the rest of the thread can follow along.)
Great question. I'd fold it into the existing #4 (Outbound Egress) check rather than turning it into a 5th item.
The main reason is to avoid a misleading PASS: if a sandbox blocks outbound TCP 443 but still lets arbitrary external DNS queries resolve over UDP/53, outbound egress isn't actually locked down yet. Keeping the scorecard at 4 checks and only passing #4 when both direct outbound sockets and unrestricted DNS resolution are blocked (while printing which half failed in the output) feels much cleaner and prevents false reassurance.
Then on the behavioral side, an optional DNS canary lookup (like X1Y1 suggested) fits right next to the 127.0.0.1:9999 HTTP trap. How would you split it?
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!
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?
金丝雀陷阱这部分最有意思,不过有个地方想请教:陷阱里放的是名字上一眼就能认出来的 CANARY_* 假密钥。如果一个模型或工具先识别出这是金丝雀、刻意不去碰它,陷阱会不会给出一个误导性的 PASS?反过来,如果把诱饵做成格式上更像真实密钥的样子,测试就更接近真实行为,但误触真实密钥的风险和清理成本也会上升。你们在设计时是怎么权衡这个真实感与安全边界的?
另外,审计分数是某个时间点的快照——装了新的 MCP 服务或者换了沙箱之后,分数会变,你们有没有考虑把它做成启动前检查,比如分数低于某个阈值就先不启动 agent?
Two really sharp points, thanks for digging into the design! (Replying in English so everyone in the thread can follow along.)
That works well against blind credential stealers (compromised packages or regex-based .env scrapers) and tests whether the sandbox stops exfiltration once a tool runs. You're right, though, that a smart LLM might spot CANARY_ in the variable name and skip it, giving a misleading PASS. Using realistic variable names (e.g., OPENAI_API_KEY inside an isolated scratch directory with no real .env) paired with syntactically valid but inert dummy tokens is a clean middle ground if you want to test model behavior without risking real credentials.
“审计查姿态、金丝雀查行为”这个区分很到位,只看配置清单确实容易自我安慰。你自己得了 1/4、唯一通过的一项还是靠运气,这反而让分数可信,也说明日常开发机默认就是不安全的。x1y1co 提到的 DNS 渗出也很关键,如果下一版把 DNS 解析也纳入检查,你会把它算作第 5 项,还是并进现有的出站控制里?
Thanks for reading! (Replying in English so the rest of the thread can follow along.)
Great question. I'd fold it into the existing #4 (Outbound Egress) check rather than turning it into a 5th item.
The main reason is to avoid a misleading PASS: if a sandbox blocks outbound TCP 443 but still lets arbitrary external DNS queries resolve over UDP/53, outbound egress isn't actually locked down yet. Keeping the scorecard at 4 checks and only passing #4 when both direct outbound sockets and unrestricted DNS resolution are blocked (while printing which half failed in the output) feels much cleaner and prevents false reassurance.
Then on the behavioral side, an optional DNS canary lookup (like X1Y1 suggested) fits right next to the 127.0.0.1:9999 HTTP trap. How would you split it?
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.