# prefixgate

- **Event:** [Meta Global AI Developer Hackathon](https://cerebralvalley.ai/e/meta-ai-developer-hackathon)
- **When:** Oct 26, 12:00 PM – Nov 4, 9:00 PM (EST)
- **Where:** Online
- **Team:** [Sebastian Roda](https://cerebralvalley.ai/u/Sebastianroda)
- **GitHub:** https://github.com/Sebastianrodaaa/prefixgate
- **Demo video:** https://github.com/Sebastianrodaaa/prefixgate/releases/download/demo-v1/prefixgate-demo.mp4
- **Gallery:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3670

prefixgate is a real-time safety gate for AI agent tool calls. Agents now delete files, move money and call APIs faster than anyone can review them, and most guardrails only check a call after it is fully written. prefixgate reads an agent's tool call token by token as Llama 3.2 3B Instruct (Meta open weights, running on CPU) streams it, and for every prefix decides allow, deny or escalate. Its thresholds are calibrated with Learn-then-Test, which gives a statistical bound on how often a bad call slips through. Nothing is ever executed: risky calls are held for a human before they run.

Real results (24 generated agent tasks, CPU only): 14 of 16 risky calls were held for a human, 6 of 8 safe calls were allowed straight through, and 6 of 24 calls were decided before the call finished streaming. Two risky calls still got through, and we report that honestly in REPORT.md.

The repo includes a live dashboard (make demo), a recorded-runs replay on a Hugging Face Space (https://huggingface.co/spaces/sroda/prefixgate), tests, CI and a full report.

## More from Meta Global AI Developer Hackathon

- [REWIND](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3667)
- [jairotft](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3668)
- [Sidekick](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3669)
- [Zazen Builder](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3671)
- [Italian Rides](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3672)
- [Medha](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3673)

---

Markdown version of https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3670. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
