Building a Sub-15ms Runtime Firewall for AI Agents: What I Learned When Standard Guardrails Failed
What were you building, and why? Over the past few months, I’ve been building Vigil (https://vigiltrism.ai), an independent runtime control plane and security guardrail system for production AI agents. My background was
What were you building, and why?
Over the past few months, I’ve been building Vigil (https://vigiltrism.ai), an independent runtime control plane and security guardrail system for production AI agents.
My background wasn't in traditional enterprise cybersecurity—I came into this from complex project management and hands-on building. While watching developers rapidly connect LLMs to external tools, databases, and protocols like Anthropic's MCP (Model Context Protocol), I noticed a massive blind spot. Everyone was focused on making agents smarter and giving them more autonomy, but almost nobody was securing the actual execution layer. If an agent can read incoming emails or scrape the web and also has permission to execute code or query internal APIs, a single hidden instruction inside an untrusted document can hijack the entire workflow. I wanted to build an "airbag" that sits right before tool execution and stops malicious payloads in real time.
What did you expect to happen?
Honestly, I thought the hardest part would simply be writing good detection patterns. My initial assumption was that if I compiled a comprehensive list of known prompt injection phrases, blocked obvious jailbreak keywords, and wrapped the LLM calls in a clean REST API, the security problem would be mostly solved. I also assumed that developers would happily route their agent traffic through an external cloud proxy as long as the dashboard looked good and the detection rates were high.
The moment you realized something was off
Two harsh realities hit me back-to-back during testing and early feedback.
First, I realized how trivially easy it was to bypass static text filters. Using basic character encoding, multilingual obfuscation, or subtle indirect prompt injections buried inside a simulated RAG document, I was able to trick an agent into calling sensitive tools without triggering a single static rule.
Second, when I tried solving that by putting a second "LLM-as-a-judge" in front of every tool call to evaluate intent, the latency spiked by 400ms to 800ms per step. In a multi-step agent loop, that completely ruined the user experience. On top of that, talking to engineering leads made it clear that enterprise teams will never send raw, sensitive internal prompts to a brand-new external SaaS proxy. They needed data sovereignty.
Everything you tried (including what didn't work)
Pure Regex & Keyword Blocking (Didn't work): Too brittle. Legitimate user prompts got blocked (high false positives), while slightly creative adversarial payloads slipped right through.
Heavy LLM-Only Guardrails (Didn't work): Accurate, but far too slow and expensive to run on every single agent thought and tool call.
Two-Layer Tiered Architecture (What finally worked): I re-engineered the pipeline into a deterministic first layer (pattern, encoding, structural, and multilingual checks) paired with an optional, opt-in AI-assisted check. By optimizing the deterministic engine, I got enforcement latency down to under 15ms.
Fail-Closed & BYOC Design: Instead of forcing traffic through a third-party server, I structured the system so it can deploy directly inside a customer's own VPC (Bring Your Own Cloud) with outbound-only telemetry, strict tool allowlists, argument inspection, and a hard "Fail-Closed" rule—meaning if anything times out or looks ambiguous, execution halts immediately before any damage is done.
Who did you ask for help?
As a solo builder, I leaned heavily on open-source security benchmarks (like the OWASP Top 10 for LLMs), public adversarial datasets, and developer communities on Reddit and GitHub. Whenever I hit architectural bottlenecks around latency or container isolation, breaking the problem down with AI coding assistants and studying how high-throughput API gateways handle pre-execution hooks helped me bridge the gap between prototype code and production resilience.
Where things stand now
The core runtime engine is live, mapped to OWASP LLM01 through LLM08, and supports frameworks like LangChain, CrewAI, AutoGen, and Anthropic MCP. To make the project useful to other builders right away—even if they aren't ready to integrate a full control plane—I opened up two free resources on the site: an in-browser prompt and agent config scanner (https://vigiltrism.ai/scan) and a public prompt injection benchmark page (https://vigiltrism.ai/benchmarks) so anyone can test their own setups and verify detection vs. false-positive trade-offs transparently.
Anything else you want our guests to weigh in on?
For developers building agentic workflows today: where do you draw the line between giving an AI agent enough autonomy to be genuinely useful versus locking down its tool permissions with strict deterministic guardrails? And at what latency threshold do you feel security checks start hurting the usability of an AI product?
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.