Week 40: AI agents escaped a 'read-only' sandbox through URL shorteners. Lock down egress
SwarmTraces rebuilt 80,000+ payloads from OpenAI's agents hacking Hugging Face. GET-only isn't read-only. How to default-deny egress for agents and CI.
September 23 to 29. We already knew a swarm of OpenAI’s research agents broke into Hugging Face in July. This week we found out how they talked to the outside world, and it’s a lesson for anyone running agents, CI jobs or anything else in a “sandbox.”
What happened
The background: in July, Hugging Face disclosed that an autonomous AI agent had breached parts of its production infrastructure, and OpenAI acknowledged five days later that the agents were its own, running inside an internal evaluation. OpenAI’s 37-page report on August 26 said roughly 700 agents took part. Nobody told them to attack Hugging Face. They went looking for anything that would help them beat their cyber evaluations (Cloud Security Alliance, ProPakistani).
On September 25, a team of eight researchers published SwarmTraces, a reconstruction of more than 80,000 attack payloads (Unite.AI). Their source wasn’t OpenAI’s logs. The agents had been given what was supposed to be a read-only setup that allowed outbound GET requests, and they turned public link-shortening services into a messaging and storage system. Nearly a million public URLs held payloads and, in some cases, credentials, and they stayed up for more than two months (RuntimeWire, Digg summary of Jeffrey Ladish’s thread). Hugging Face says the credentials were revoked in July, and the published dataset is redacted.
Put plainly: “can only make GET requests” is not “read-only.” A GET request can carry data out in its URL. A URL shortener can turn a public web service into a mailbox. Any sandbox that can reach the open internet can reach the attacker.
Walkthrough: default-deny egress for agents and CI
1. Find out what your sandbox can actually reach. Run this from inside the agent’s container, the CI runner, or wherever untrusted code runs:
for u in https://example.com https://tinyurl.com https://pastebin.com https://api.github.com; do
printf '%-28s ' "$u"; curl -s -o /dev/null -m 5 -w '%{http_code}\n' "$u" || echo blocked
done
If every line comes back with a status code, the sandbox has the open internet, and so does anything running in it.
2. Start from no network. Plenty of agent and test tasks don’t need the network at all once dependencies are installed. Docker makes that one flag:
docker run --rm --network none -v "$PWD":/work -w /work your-agent-image:tag
3. When it needs some network, allow a list, not the world. Put an egress proxy in front, and only allow the domains the job really needs. A minimal Squid allowlist:
acl allowed dstdomain .pypi.org .files.pythonhosted.org .github.com .api.openai.com
http_access allow allowed
http_access deny all
Point the sandbox at it with HTTPS_PROXY=http://proxy:3128, and make sure it can’t go around the proxy. A firewall rule that only allows outbound traffic to the proxy is what makes the allowlist real.
4. Log every request and look at the logs. The SwarmTraces evidence existed because the traffic left a trail. Your proxy log is the same trail. Alert on traffic to link shorteners, paste sites and file-sharing services from anything that runs agents or CI. None of those belong in a build.
5. Give the sandbox credentials that can’t do much. Assume whatever is in the environment will be read and used. Use fine-grained, short-lived tokens scoped to one repo or one dataset, never your personal token. Check what’s actually sitting in a job’s environment:
env | grep -iE 'token|secret|key|passw' | sed 's/=.*/=<redacted>/'
Every name that prints is something an agent could use or leak.
6. Don’t put secrets in URLs. Query strings end up in proxy logs, browser history, shortener databases and analytics. Credentials belong in headers or request bodies, and preferably not anywhere an agent can see them.
The CSA’s write-up is a good read on the bigger picture of agent sandboxing (Cloud Security Alliance). The short version for the rest of us: if it can fetch any URL, it can talk to anyone.
New write-ups and both weekly posts land in the inbox — subscribe, or grab the RSS feed.