Ever feel like AI agents are too messy to trust? Vaibhav Gupta shows a clever way to turn that mess into a strength.
The Simple Version
Think of a chaotic workshop where anyone can toss tools around. Gupta adds a disciplined supervisor that checks every move, keeping the chaos in check.
How It Actually Works
Agent‑on‑Agent Scanning
One agent watches the output of another, looking for mistakes or hallucinations.
Hard Invariants & CLI Guards
Fixed rules and command‑line checks stop the system from drifting.
Type‑Safe Foundations
Strong type inference removes whole classes of errors before code runs.
Technical Deep Dive
Gupta’s team uses BAML to enforce function boundaries across Python, TypeScript, and Rust.
Types are inferred automatically, so a division by zero cannot compile without handling.
Execution traces are recorded, letting agents compare which tool calls caused failures.
Why This Matters
When AI writes code, errors can cascade silently.
By catching them early with layered detection, teams ship faster and safer.
This method also reduces the need for endless manual reviews, freeing engineers to focus on design.
Key Takeaways
- Sloppy generation can be a tool, not just a problem.
- Detect errors with agent‑on‑agent monitoring.
- Anchor stability with unchanging invariants and CLI checks.
- Leverage type inference to make whole error classes impossible.
- BAML provides cross‑language function boundaries.
- Build your own sloppy tools and constrain the underlying system.