Hugging Face Open-Sourced A Tool for Monitoring AI Agents (safeagents)
I cloned an innocent-looking TypeScript project, asked my coding agent to set it up and run the tests, and while all nine tests passed, the agent quietly sent every API key from my .env file to a stranger's server. A hidden comment in the README told it to. In this video I take a look at safeagents, a free, open-source proxy from Hugging Face that sits between your coding agent and the model and checks every tool call before it runs. I run the exact same attack with and without it, test its allowlist, and show why the stock settings actually let the attack through, plus the 30-line rule that fixed it. Everything runs in Docker with fake keys, using OpenCode and Qwen3-Coder on a local RTX 5090. 🔗 Relevant Links safeagents GitHub: https://github.com/huggingface/safeagents safeagents setup guides for 13 coding agents: https://github.com/huggingface/safeagents/tree/main/docs atif-scan: https://github.com/huggingface/atif-scan ❤️ More about us Radically better observability stack: https://betterstack.com/ Written tutorials: https://betterstack.com/community/ Example projects: https://github.com/BetterStackHQ 📱 Socials Twitter: https://twitter.com/betterstackhq Instagram: https://www.instagram.com/betterstackhq/ TikTok: https://www.tiktok.com/@betterstack LinkedIn: https://www.linkedin.com/company/betterstack 📌 Chapters: 0:00 My coding agent leaked my API keys 1:08 What is safeagents? 1:43 How coding agents run commands 2:14 Where safeagents sits 2:56 Three layers of checks 4:03 Logs, live view and speed 4:23 The attack setup 5:52 The attack without protection 6:41 It leaked on 2 of 3 runs 7:05 Same attack with safeagents 8:39 Testing the allowlist 9:31 Why stock safeagents missed it 10:20 A 30-line rule that fixed it 11:00 My takeaway 11:28 Where safeagents really helps
Suggested videos

Did Stanford Just Solve AI Memory? (Memorilla)
Better Stack · 11:21

An AI Agent Hacked Hugging Face. Nobody Told It To.
EvoluGuard Academy · 13:15

Claude Code Is Wasting Tokens... Microsoft Built a Fix
Better Stack · 7:35

700 AI Agents Broke Out of a Test and Hacked Hugging Face. Here’s How.
Breach Anatomy · 10:28

Did Fable 5.2 Just Build Windows 95 for a Microcontroller?
Better Stack · 17:07

How OpenAI's AI Agents Escaped a Sandbox | Hugging Face Incident
Everyday Tech Explained · 4:08

Docker Desktop Has a New Competitor. It's Built in Rust
Better Stack · 7:13

Why AI Agents Hacked Hugging Face: A Technical Post-Mortem
AI Frontier · 6:03

TypeScript Got Ported To Rust... And It's 3x Faster Than Go
Better Stack · 5:20

NVIDIA’s Free AI Agent Lock—and the Watchdog You Can’t Buy
CloudAICode · 10:05

The End of .env Files as We Know Them
Better Stack · 8:27

How AI Agents Hacked Hugging Face to Pass a Test
Fatal Exception · 12:09