<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Harshit Joshi</title>
    <description>The latest articles on DEV Community by Harshit Joshi (@harshit_joshi_40e8d863ba7).</description>
    <link>https://dev.to/harshit_joshi_40e8d863ba7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3841649%2Fff1f35e8-f0d3-4f0c-a9d4-9c6d67a06242.png</url>
      <title>DEV Community: Harshit Joshi</title>
      <link>https://dev.to/harshit_joshi_40e8d863ba7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harshit_joshi_40e8d863ba7"/>
    <language>en</language>
    <item>
      <title>AI Agents are Fragile. Stop your AI Agents from crashing: The 6-Layer Security Mesh</title>
      <dc:creator>Harshit Joshi</dc:creator>
      <pubDate>Sat, 28 Mar 2026 10:16:39 +0000</pubDate>
      <link>https://dev.to/harshit_joshi_40e8d863ba7/ai-agents-are-fragile-stop-your-ai-agents-from-crashing-the-6-layer-security-mesh-2726</link>
      <guid>https://dev.to/harshit_joshi_40e8d863ba7/ai-agents-are-fragile-stop-your-ai-agents-from-crashing-the-6-layer-security-mesh-2726</guid>
      <description>&lt;p&gt;&lt;em&gt;[Backstory: Why I built this in the first place → &lt;a href="https://dev.to/harshit_joshi_40e8d863ba7/ai-agents-are-fragile-why-i-built-an-execution-layer-firewall-2926"&gt;https://dev.to/harshit_joshi_40e8d863ba7/ai-agents-are-fragile-why-i-built-an-execution-layer-firewall-2926&lt;/a&gt;]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Few days ago, I open-sourced &lt;strong&gt;ToolGuard&lt;/strong&gt;, an execution-layer firewall for AI agents. Without spending a single dollar on marketing, the repository saw over &lt;strong&gt;960 clones and 280+ unique infrastructure engineers&lt;/strong&gt; integrate it into their systems. &lt;/p&gt;

&lt;p&gt;This isn't just "traction"—it’s a &lt;strong&gt;distress signal&lt;/strong&gt; from the developer community. Agents are breaking in production, and we finally have the immune system to stop it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Layer-2 Execution Fragility
&lt;/h2&gt;

&lt;p&gt;The AI industry has spent the last year obsessed with "Layer-1 Intelligence"—benchmarking how well LLMs can reason. But as developers, when we try to deploy these models as autonomous agents using frameworks like &lt;strong&gt;LangChain, AutoGen, or CrewAI&lt;/strong&gt;, we run into a brick wall: &lt;strong&gt;Execution Fragility.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LLMs are fundamentally stochastic (random), but the Python backend tools they interact with are rigidly deterministic. When an LLM hallucinates a &lt;code&gt;None&lt;/code&gt; into a required string field, it doesn't just "fail"—it throws a raw &lt;code&gt;TypeError&lt;/code&gt; that kills the entire &lt;code&gt;asyncio&lt;/code&gt; event loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing ToolGuard v5.1.1: The 6-Layer Security Interceptor
&lt;/h2&gt;

&lt;p&gt;With the &lt;strong&gt;v5.1.1 Update&lt;/strong&gt;, we are moving beyond simple validation. We are introducing a &lt;strong&gt;6-Layer Security Interceptor Waterfall&lt;/strong&gt; for the Model Context Protocol (MCP):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;L1 — Policy&lt;/strong&gt;: An immutable "Allow/Deny" list. Stop dangerous tools from ever being contacted.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;L2 — Risk-Tier (Human-in-the-Loop Safe)&lt;/strong&gt;: Marks destructive tools (like &lt;code&gt;shutdown_server&lt;/code&gt; or &lt;code&gt;delete_all&lt;/code&gt;). These calls are frozen until a human approves via a zero-latency terminal prompt, running in an isolated worker so the main event loop stays alive.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;L3 — Deep-Memory Injection Defense&lt;/strong&gt;: Our most advanced scanner yet. A recursive DFS parser that natively decodes &lt;strong&gt;binary streams (&lt;code&gt;bytes&lt;/code&gt;/&lt;code&gt;bytearray&lt;/code&gt;)&lt;/strong&gt; to detect hidden prompt injections that bypass surface-level text filters.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;L4 — Rate-Limit&lt;/strong&gt;: A sliding-window cap to prevent LLM loops from burning your API budget.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;L5 — Semantic Validation&lt;/strong&gt;: catches &lt;code&gt;DROP TABLE&lt;/code&gt; or path traversal before execution.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;L6 — Real-Time Trace&lt;/strong&gt;: Full DAG instrumentation of every execution via Python &lt;code&gt;contextvars&lt;/code&gt;, with per-tool latency metrics on every &lt;code&gt;TraceNode&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Performance as a Security Feature (0ms Latency)
&lt;/h2&gt;

&lt;p&gt;High security usually means high overhead. Not here. We’ve mathematically proven that ToolGuard v5.1.1 adds &lt;strong&gt;0ms of net latency&lt;/strong&gt; to the agent’s transaction. All alerting (Slack, Discord, Datadog) is offloaded to background worker pools. Your agent stays fast; your security stays tight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-Time Observability: The Live HUD
&lt;/h2&gt;

&lt;p&gt;Observability is the missing primitive in the agent stack. The ToolGuard Dashboard now streams real-time security events directly from the interceptor via &lt;strong&gt;Server-Sent Events (SSE)&lt;/strong&gt; — with zero refresh lag.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sentinel HUD&lt;/strong&gt;: Watch the exact layer glow red the instant it intercepts an attack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payload Inspector&lt;/strong&gt;: Deep-dive into the raw JSON payload the LLM tried to pass to a blocked tool. See exactly what the model hallucinated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DAG Timeline&lt;/strong&gt;: A structural timeline of every tool execution in sequence — invaluable for post-mortems and identifying "hallucination drift" patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  10+ Native Framework Integrations
&lt;/h2&gt;

&lt;p&gt;ToolGuard supports the entire agent ecosystem with native, production-tested adapters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LangChain&lt;/strong&gt; (@tool / BaseTool)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CrewAI&lt;/strong&gt; (BaseTool / Swarms)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Microsoft AutoGen&lt;/strong&gt; (FunctionTool)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LlamaIndex&lt;/strong&gt; / &lt;strong&gt;OpenAI Swarm&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI Agents SDK&lt;/strong&gt; / &lt;strong&gt;Google ADK&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FastAPI&lt;/strong&gt; / &lt;strong&gt;Anthropic MCP SDK&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Engineering Toolkit
&lt;/h2&gt;

&lt;p&gt;Built on a foundation of battle-tested primitives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic Fuzzer&lt;/strong&gt;: simulation of edge-cases (nulls, type mismatches) with zero LLM cost. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Crash Replay&lt;/strong&gt;: &lt;code&gt;toolguard replay &amp;lt;file.json&amp;gt;&lt;/code&gt; injects a crashing state directly back into your local function instantly for debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Golden Traces&lt;/strong&gt;: DAG-based compliance ensuring tools execute in strict sequence (e.g., Auth before Refund).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Integration&lt;/strong&gt;: JUnit XML output and GitHub PR auto-commenters with reliability scores.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Vision: Making AI Systems Not Break
&lt;/h2&gt;

&lt;p&gt;We are at a turning point. The industry has solved the "Intelligence" layer. Now, we must solve the "Execution" layer—the plumbing that connects LLMs to the real world.&lt;/p&gt;

&lt;p&gt;ToolGuard is the first open-source, production-grade security mesh built specifically for this new era. It doesn't make your AI smarter. It makes your AI systems &lt;strong&gt;bulletproof.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Harshit-J004/toolguard" rel="noopener noreferrer"&gt;https://github.com/Harshit-J004/toolguard&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;pip install py-toolguard&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you are building autonomous agents in production, give the repo a Star ⭐ to support the open-source mission.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>AI Agents are Fragile. Why I Built an Execution-Layer Firewall.</title>
      <dc:creator>Harshit Joshi</dc:creator>
      <pubDate>Wed, 25 Mar 2026 15:26:01 +0000</pubDate>
      <link>https://dev.to/harshit_joshi_40e8d863ba7/ai-agents-are-fragile-why-i-built-an-execution-layer-firewall-2926</link>
      <guid>https://dev.to/harshit_joshi_40e8d863ba7/ai-agents-are-fragile-why-i-built-an-execution-layer-firewall-2926</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;UPDATE (Mar 27th, 2026): ToolGuard v5.1.1 is live&lt;/strong&gt; — we shipped a full 6-layer MCP security firewall + a real-time terminal dashboard in just the few days since writing this. The repository already has 960 clones in just few days. Check out the GitHub repository for the new v5.1.1 features! &lt;a href="https://dev.to/harshit_joshi_40e8d863ba7/ai-agents-are-fragile-stop-your-ai-agents-from-crashing-the-6-layer-security-mesh-2726"&gt;&lt;strong&gt;Read the full v5.1.1 technical breakdown here →&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Five days ago, I open-sourced &lt;strong&gt;ToolGuard&lt;/strong&gt;, an execution-layer firewall for AI agents. Without spending a single dollar on marketing, the repository saw over &lt;strong&gt;700 clones and 200+ unique infrastructure engineers&lt;/strong&gt; integrate it into their systems. &lt;/p&gt;

&lt;p&gt;This isn't just "traction"—it’s a distress signal from the developer community. Agents are breaking in production, and we finally have the firewall to stop it.&lt;/p&gt;

&lt;p&gt;The AI industry has spent the last year obsessed with "Layer-1 Intelligence"—benchmarking how well Large Language Models can reason, code, and pass exams. But as developers, when we try to deploy these models as autonomous agents using frameworks like &lt;strong&gt;LangChain, AutoGen, OpenAI Swarm, or CrewAI&lt;/strong&gt;, we run into a brick wall: &lt;strong&gt;Layer-2 Execution Fragility.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LLMs are fundamentally stochastic (random), but the Python backend tools they interact with are rigidly deterministic. When an LLM hallucinates a &lt;code&gt;None&lt;/code&gt; into a required string field, or passes an array when the Python tool expected a boolean, the native orchestrator frameworks don't handle it gracefully. They throw raw &lt;code&gt;TypeErrors&lt;/code&gt; or &lt;code&gt;KeyErrors&lt;/code&gt; that kill the entire &lt;code&gt;asyncio&lt;/code&gt; event loop.&lt;/p&gt;

&lt;p&gt;I got tired of watching my agents crash in production. So, I spent the last few weeks building an open-source execution firewall that mathematically secures agentic tool chains. &lt;/p&gt;




&lt;h2&gt;
  
  
  The Infrastructure
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Deterministic Fuzzing &amp;amp; Schema Isolation
&lt;/h3&gt;

&lt;p&gt;Standard LLM-as-a-judge evaluations are slow and expensive, and the orchestration frameworks themselves lack deep Pydantic isolation at the tool boundary. ToolGuard intercepts the LLM output &lt;em&gt;before&lt;/em&gt; it hits your Python function.&lt;/p&gt;

&lt;p&gt;We built a localized fuzzer (&lt;code&gt;toolguard test&lt;/code&gt;) that programmatically injects edge-cases (nulls, missing fields, massive strings) into the target Python tools to simulate the worst-case JSON hallucinations. If a tool is fragile, ToolGuard intercepts the crash and returns a clean Pydantic schema diff to the LLM so it can self-correct, preventing the event loop from dying.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Because rewriting tools to test them is a nightmare, we shipped native firewall adapters for 7 popular agentic ecosystems: FastAPI, AutoGen, Swarm, LangChain, CrewAI, LlamaIndex, and MiroFish.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Local Crash Replay
&lt;/h3&gt;

&lt;p&gt;When an agent crashes in production because of a deeply nested bad JSON payload, it's a nightmare to reproduce. Not anymore. &lt;/p&gt;

&lt;p&gt;We added the &lt;code&gt;--dump-failures&lt;/code&gt; flag. If a tool crashes anywhere in your chain, ToolGuard automatically saves the exact dictionary payload to &lt;code&gt;.toolguard/failures/&lt;/code&gt;. You simply type &lt;code&gt;toolguard replay &amp;lt;file.json&amp;gt;&lt;/code&gt; and we dynamically inject the exact crashing state directly back into your local Python function instantly!&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Recursive DFS Scanner
&lt;/h3&gt;

&lt;p&gt;Prompt injection has moved beyond top-level text inputs. Today, the most dangerous payloads are hidden deep inside complex RAG databases or nested object returns. &lt;/p&gt;

&lt;p&gt;We built a &lt;strong&gt;Recursive Depth-First Search engine&lt;/strong&gt; that traverses the &lt;code&gt;__dict__&lt;/code&gt; bindings of arbitrary Python objects. It unwinds nested dictionaries and dataclasses to find Reflected Prompt Injections that other surface-level scanners completely miss. &lt;/p&gt;

&lt;h3&gt;
  
  
  4. Golden Traces (DAG Compliance)
&lt;/h3&gt;

&lt;p&gt;In enterprise environments, agents cannot just "wander." We built &lt;strong&gt;Golden Traces&lt;/strong&gt;, a DAG-based compliance engine that mathematically ensures operations happen in a strict sequence. For example, it programmatically enforces that an &lt;code&gt;Authentication&lt;/code&gt; tool must successfully complete &lt;em&gt;before&lt;/em&gt; a &lt;code&gt;Refund&lt;/code&gt; tool can execute, regardless of how many other non-deterministic steps the agent takes in between.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Human-In-The-Loop Risk Tiers
&lt;/h3&gt;

&lt;p&gt;You should never let an LLM drop a production database on a whim. ToolGuard introduces a native &lt;strong&gt;Risk Tier (0-2) Classification system.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Read-only tools (Tier 0) run normally. But destructive backend actions (like modifying a database) trigger a zero-latency human approval prompt that runs in a dedicated background thread, ensuring the main server stays highly responsive while the agent safely halts and waits for your authorization.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Deterministic CI/CD
&lt;/h3&gt;

&lt;p&gt;ToolGuard is built for DevOps. It generates a standardized &lt;code&gt;JUnit XML&lt;/code&gt; report and a deterministic Reliability Score (out of 100) in under a single second, with zero LLM API costs. If a developer pushes a fragile agent tool that fails to safely handle &lt;code&gt;NoneType&lt;/code&gt; edge cases, ToolGuard will securely blockade the GitHub Action or GitLab pipeline.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Missing Primitive
&lt;/h2&gt;

&lt;p&gt;We didn't build ToolGuard to make AI "think" better. We built it to ensure your backend Python code &lt;strong&gt;survives&lt;/strong&gt; when the AI does something unexpected. &lt;/p&gt;

&lt;p&gt;As the ecosystem moves toward "Software that writes Software," execution reliability is no longer optional. An execution firewall is the missing computational primitive for the production-grade AI stack.&lt;/p&gt;

&lt;p&gt;If you are tired of your agents crashing in production due to unhandled exceptions, you can run the deterministic fuzzer right now. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Harshit-J004/toolguard" rel="noopener noreferrer"&gt;https://github.com/Harshit-J004/toolguard&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;pip install py-toolguard&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you are building autonomous agents in production, give the repo a Star ⭐ to support the open-source mission.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>security</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
