<?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: Lokesh Kumar</title>
    <description>The latest articles on DEV Community by Lokesh Kumar (@lokesh_kumar_6064a4b62e5b).</description>
    <link>https://dev.to/lokesh_kumar_6064a4b62e5b</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%2F3972798%2F7076b8ff-4bdd-4fba-b621-d7ba4f7ec0aa.png</url>
      <title>DEV Community: Lokesh Kumar</title>
      <link>https://dev.to/lokesh_kumar_6064a4b62e5b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lokesh_kumar_6064a4b62e5b"/>
    <language>en</language>
    <item>
      <title>ZeroTrust Agents vs Alternatives: Why Framework-Level Security Fails</title>
      <dc:creator>Lokesh Kumar</dc:creator>
      <pubDate>Sun, 07 Jun 2026 19:00:00 +0000</pubDate>
      <link>https://dev.to/lokesh_kumar_6064a4b62e5b/zerotrust-agents-vs-alternatives-why-framework-level-security-fails-2g1l</link>
      <guid>https://dev.to/lokesh_kumar_6064a4b62e5b/zerotrust-agents-vs-alternatives-why-framework-level-security-fails-2g1l</guid>
      <description>&lt;p&gt;When an engineering team builds an autonomous AI agent, they usually start by hardcoding security directly into the agent's framework. &lt;/p&gt;

&lt;p&gt;If they are using &lt;strong&gt;LangChain&lt;/strong&gt;, they might write a custom &lt;code&gt;@tool&lt;/code&gt; decorator that checks a user's permissions before running. If they are using &lt;strong&gt;CrewAI&lt;/strong&gt;, they might write a Python &lt;code&gt;if/else&lt;/code&gt; statement inside the agent's execution loop. &lt;/p&gt;

&lt;p&gt;This is known as &lt;strong&gt;Framework-Level Security&lt;/strong&gt;, and for enterprise deployments, it is a disaster waiting to happen.&lt;/p&gt;

&lt;p&gt;To solve this, I built &lt;strong&gt;&lt;a href="https://github.com/lokeshsk/zerotrust-agents" rel="noopener noreferrer"&gt;ZeroTrust Agents&lt;/a&gt;&lt;/strong&gt;, an open-source deterministic API gateway for your AI agents. &lt;/p&gt;

&lt;p&gt;Securing your agent with it is as simple as changing one line of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt;

&lt;span class="c1"&gt;# To secure your agent, you just change the base_url
&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:8000/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;# Route through ZeroTrust Agents
&lt;/span&gt;    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your-openai-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is why you should be moving security out of your agent code and into the network layer.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem with Framework-Level Security
&lt;/h2&gt;

&lt;p&gt;If you rely on your Python framework or the LLM's prompt to enforce security, you run into three critical bottlenecks:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. It's Not Polyglot
&lt;/h3&gt;

&lt;p&gt;In a mid-sized enterprise, one team might use LangChain in Python, another might use AutoGen in TypeScript, and a third might write raw HTTP calls in Go. If security is tied to the framework, every team has to re-implement the security checks (and keep them updated) from scratch in their respective languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. It Relies on LLM Compliance
&lt;/h3&gt;

&lt;p&gt;Many framework-level checks happen &lt;em&gt;after&lt;/em&gt; the tool payload is parsed but &lt;em&gt;before&lt;/em&gt; the function executes. However, an adversarial prompt injection can often trick the framework's parser or cause the LLM to output malformed JSON that crashes the validation logic entirely. &lt;/p&gt;

&lt;h3&gt;
  
  
  3. No Centralized Audit Trail
&lt;/h3&gt;

&lt;p&gt;If every agent implements its own security natively, the CISO has no single pane of glass to view what these agents are doing across the organization. Auditing becomes a fragmented nightmare.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Gateway Paradigm (ZeroTrust Agents)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ZeroTrust Agents&lt;/strong&gt; moves security out of the application code and into the network layer. &lt;/p&gt;

&lt;p&gt;By functioning as a transparent reverse proxy between your agents and the upstream LLM (OpenAI, Anthropic, Gemini) or Model Context Protocol (MCP) server, it provides &lt;strong&gt;Network-Level Security&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Why is this architectural shift so much better?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Universal Compatibility:&lt;/strong&gt; It doesn't matter if you wrote your agent in Python, Rust, or Bash. If your agent makes an API call to an LLM to request a tool, the Gateway intercepts the stream. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Centralized Policy-as-Code:&lt;/strong&gt; Security teams can define YAML rules that apply globally. For example: &lt;em&gt;"No agent in the production environment may call &lt;code&gt;execute_sql&lt;/code&gt; without human approval."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human-in-the-Loop:&lt;/strong&gt; Because the proxy holds the HTTP connection open, it can suspend the agent's execution entirely, send a Slack message to an admin, and wait for them to click "Approve" before allowing the tool to run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single Pane of Glass:&lt;/strong&gt; Every tool call attempt—whether allowed or blocked—is logged centrally in the ZeroTrust dashboard. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security should never be an afterthought
&lt;/h3&gt;

&lt;p&gt;Security cannot be a bolt-on patch to an agent framework. It must be a foundational, decoupled layer. &lt;/p&gt;

&lt;p&gt;If you are building AI agents that touch production data, check out &lt;strong&gt;&lt;a href="https://github.com/lokeshsk/zerotrust-agents" rel="noopener noreferrer"&gt;ZeroTrust Agents on GitHub&lt;/a&gt;&lt;/strong&gt;. We are completely open-source and would love for you to spin up the Docker container, try it out, and leave us a ⭐ if you find it useful!&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;How are you currently securing your AI agents? Let me know in the comments below! *&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
