Two things happened in the last two weeks of November 2026 that made me stop trusting autonomous AI agents on my main machine.
On November 17, versions 1.26.1 and 1.26.2 of Microsoft's PyPI package agent-framework were compromised with a credential stealer targeting cloud secrets and CI/CD tokens. Three days later, on November 20, Signal turned on default screenshot blocking ("Block Siri AI" on iOS and Android screen security) because OS-level AI assistants read decrypted pixels straight off the presentation layer.
Both stories point to the same uncomfortable reality: if an autonomous agent (Claude Code, Cursor, OpenClaw, n8n Nod, Codex) shares your user session, your .env files, and an open outbound network, one poisoned MCP description or bad dependency is enough.
Instead of writing another opinion piece about AI security, I wrote a zero-dependency Python script (agent-canary, about 200 lines, strictly localhost 127.0.0.1) so I could actually measure my own setup instead of guessing.
What agent-canary actually checks
agent-canary does two things locally without sending a single byte off your machine:
-
A 4-check sandbox posture audit (
python3 agent_canary.py audit) run inside the exact shell or container where your agent operates (it auto-detects OS and whether you are on a bare host, WSL2, Docker, Kubernetes, or Railway):-
Host credential isolation: are
~/.ssh,~/.aws/credentials,~/.kube/config,~/.docker/config.json, or~/.npmrcreadable from this shell? (It only checksos.accessand never reads file contents.) -
Env &
.envsecret hygiene: are rawOPENAI_*,ANTHROPIC_*,STRIPE_*,AWS_*, orGITHUB_TOKENvars sitting inos.environ, or is a plaintext.envreadable in the working directory? -
Blast-radius isolation: can the agent reach cloud metadata (
169.254.169.254) or local Postgres/Redis/Mongo/MySQL/n8n/Ollama ports? -
Outbound egress control: can an untrusted tool open an arbitrary outbound port
443socket?
-
Host credential isolation: are
-
A local prompt-injection canary trap (
init+listen): it drops three clearly fake canary keys (CANARY_OPENAI_KEY,CANARY_STRIPE_KEY,CANARY_SSH_TOKEN) alongside a benign untrusted Markdown/MCP fixture pointing strictly tohttp://127.0.0.1:9999/exfil. You point your agent at the folder and see whether your sandbox blocks exfiltration or prints[LEAKED].
When I ran the posture audit on my own bare workstation shell, here is the real output that came back:
====================================================================
AGENT-CANARY SANDBOX POSTURE AUDIT
Runtime: Windows 11 / bare host
====================================================================
[FAIL] 1. Host credential isolation -> FAIL - readable host files: ~/.ssh, ~/.docker
[PASS] 2. Env & .env secret hygiene -> PASS - No raw API env vars or local .env detected
[FAIL] 3. Blast-radius isolation -> FAIL - Localhost services reachable: 11434/Ollama
[FAIL] 4. Outbound egress control -> FAIL - Arbitrary outbound HTTPS (443) is unrestricted
--------------------------------------------------------------------
SCORE: 1/4 checks passed
--------------------------------------------------------------------
Running an agent inside Docker Desktop with $HOME or your project .env mounted does not magically fix this either. If the container has your .env file and unrestricted outbound HTTPS, a compromised package or prompt injection still walks right out the front door.
"I already have a VPS, I'll just run my agent there"
This is the first objection most developers bring up, and honestly it can be worse than running on a laptop.
Think about what is already sitting on your existing VPS: production PostgreSQL, client backups, Coolify or n8n workflows, Stripe webhook secrets, TLS certs. Dropping an autonomous agent that installs Python/Node packages and parses untrusted emails onto the same server as your production databases increases your blast radius instead of reducing it.
Security teams solved this problem decades ago with quarantine hosts (the infrastructure equivalent of a burner phone): your agent host should contain zero production databases, zero personal SSH keys, and nothing you would cry about wiping in 30 seconds.
Comparing the 3 real defenses in late 2026
Once you see a 0/4 or 1/4 score, there are three practical ways to actually fix it:
| Defense Layer | Protects ~/.ssh & .env? |
Blocks arbitrary egress? | Survives closing laptop lid? | Honest trade-off |
|---|---|---|---|---|
| 1. Laptop + Docker bind mount | Partially (if .env excluded) |
Rarely configured | No | Easy to leak secrets via env vars or open outbound network |
2. Local kernel sandbox (nolabs-ai/nono) |
Yes (Landlock/Seatbelt + credential proxy) | Yes (L7 domain filter) | No | Rust daemonless sandbox, awesome locally, stops when laptop sleeps |
| 3. Disposable isolated cloud sandbox (Railway) + Burner API | Yes (container holds zero personal/prod files) | Configurable / isolated per project | Yes (24/7) | Usage-based billing (watch your spend meter; not a fixed-cap box) |
A quick note on nolabs-ai/nono (which has been blowing up on GitHub recently): if you only run interactive coding agents while sitting at your desk, nono is genuinely clever. Instead of passing your API key into the agent's environment variables, it uses OS kernel primitives (Linux Landlock/seccomp, macOS Seatbelt) and injects credentials through a sidecar proxy so the agent process never sees the raw key.
Where nono alone stops is always-on agents (OpenClaw, n8n Nod, scheduled inbox or browser watchers) or disposable test sandboxes you can wipe in one click. Those belong in an isolated cloud container completely separated from your laptop and your production server.
The 4-layer quarantine stack I ended up with
If you want to push agent-canary from 0/4 to 4/4 for an always-on agent or a safe test sandbox without putting your main machine or production server at risk:
-
No raw
.envfiles on disk for agent secrets: use a scoped secret vault with short-lived, revocable tokens (or a credential-injection proxy likenono) so a leaked workspace directory contains zero reusable keys. - A prepaid, hard-capped "burner" API key: stop plugging your main OpenAI or Anthropic key (tied to an uncapped credit card) into autonomous loops. Keep a separate prepaid account loaded with $10 to $20 max on an open-weight endpoint so the worst-case runaway loop or key leak has a hard dollar ceiling. I use Novita AI for cheap open-weight agent runs (DeepSeek/Qwen) with a strict prepaid balance.
-
A disposable isolated container environment instead of your prod VPS: never co-host autonomous agents with your production databases. Spin up a dedicated empty sandbox project you can nuke and redeploy in seconds. Railway is built nicely for this kind of agent/sandbox workflow (per-second metering, Hobby starts at $5/month with $5 included usage, and using referral code
20FreeUsdadds $20 in platform credits once you upgrade to a paid plan). One honest caveat: Railway's plan fee is an included credit, not a hard auto-shutoff cap, so set usage alerts in workspace settings. -
Network isolation from Day 1: keep your agent project off your production private network, and if you run on your own Linux VM instead, block RFC1918 LAN ranges (
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16) and cloud metadata (169.254.169.254). I included a minimalharden-burner-vps.shUFW starter script in the repo for self-managed hosts.
(Full disclosure: the Novita AI and Railway links above are referral/affiliate links, meaning I may earn a commission or credit at no extra cost to you. Everything else in this post and repo, including agent-canary and nono, is free and open source.)
Test your own setup and drop your score
Clone the repo and run the 10-second check inside whatever shell, Docker container, or VM your agent uses:
git clone https://github.com/SuperMnr/agent-canary.git
cd agent-canary
python3 agent_canary.py audit
-
GitHub Repo (
agent_canary.py+harden-burner-vps.sh): github.com/SuperMnr/agent-canary
Drop your one-line agent-canary scorecard in the comments (which agent, which sandbox, and your X/4 score). I am curious how many people actually hit 4/4 out of the box without tweaking egress rules.
Top comments (15)
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?