<?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: Maniram Tatipamula</title>
    <description>The latest articles on DEV Community by Maniram Tatipamula (@maniram).</description>
    <link>https://dev.to/maniram</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4277648%2Ff7a63de2-62e6-42bd-bdbb-b3b43a1ce64e.png</url>
      <title>DEV Community: Maniram Tatipamula</title>
      <link>https://dev.to/maniram</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maniram"/>
    <language>en</language>
    <item>
      <title>Why I built tarpit-guard: spotting AI tarpits before your agent burns tokens</title>
      <dc:creator>Maniram Tatipamula</dc:creator>
      <pubDate>Wed, 02 Dec 2026 06:10:24 +0000</pubDate>
      <link>https://dev.to/maniram/why-i-built-tarpit-guard-spotting-ai-tarpits-before-your-agent-burns-tokens-14mn</link>
      <guid>https://dev.to/maniram/why-i-built-tarpit-guard-spotting-ai-tarpits-before-your-agent-burns-tokens-14mn</guid>
      <description>&lt;p&gt;Originally published on my Hashnode blog&lt;/p&gt;

&lt;p&gt;Last week I watched a 418-byte JavaScript file turn into a 184 KB trap for AI agents. This post is about what that trap looks like, why it matters if you use coding agents, and the small tool I built to deal with it: &lt;strong&gt;tarpit-guard&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The file that ate the budget
&lt;/h2&gt;

&lt;p&gt;There is a growing class of tools that "harden" source code against AI analysis. One of them is BLA. I gave it a tiny &lt;code&gt;app.js&lt;/code&gt;: 15 lines, 418 bytes. What came back was this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Original&lt;/th&gt;
&lt;th&gt;Hardened&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Size&lt;/td&gt;
&lt;td&gt;418 B&lt;/td&gt;
&lt;td&gt;184 KB (~440x)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lines&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;2,998&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secret string in cleartext&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no (encrypted)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output when run&lt;/td&gt;
&lt;td&gt;identical&lt;/td&gt;
&lt;td&gt;identical&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The hardened file pads the real logic with decoy functions, hides branches behind always-true &lt;code&gt;Math.imul&lt;/code&gt; arithmetic, encrypts string literals behind runtime decoder loops, and plants jargon like "enclave", "attestation" and "TPM" that exists only to mislead whoever reads it.&lt;/p&gt;

&lt;p&gt;A human glances at that file and moves on. An AI agent does something worse: it reads it. It ingests 184 KB of input, spends reasoning tokens tracing dead ends, and often still lands on the wrong answer. The hardening tool's own summary for this file claimed a token amplification factor in the thousands. That's the point of a tarpit. It doesn't need to stop you. It just needs to make you pay.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cheap answer is to stop
&lt;/h2&gt;

&lt;p&gt;My first instinct was the obvious one: make the agent better at reading obfuscated code. That's a losing game, and worse, it's the wrong game. Reversing someone's protection is exactly what these tools exist to prevent.&lt;/p&gt;

&lt;p&gt;The cheap answer is simpler. &lt;strong&gt;Detect the tarpit first, then stop.&lt;/strong&gt; Don't read it, don't trace it, skip it or hand it to a human. A check that costs around 1K tokens replaces a 60K-token dead end.&lt;/p&gt;

&lt;p&gt;That's all tarpit-guard does.&lt;/p&gt;

&lt;h2&gt;
  
  
  What tarpit-guard does
&lt;/h2&gt;

&lt;p&gt;It scores a file or a repository from 0 to 100 for deliberate anti-analysis hardening, with a confidence value and the evidence behind the score. At 55 or above (configurable), the file is a tarpit and the tool says so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tarpit-guard bla_hardened_app.js
[TARPIT] score=   78 conf=1.00  bla_hardened_app.js
         182865B / 2998 lines, Math.imul×246, decoder_pairs=8, garbled_idents=190, decoy_hits=487
         fired: opaque_predicate_density, decoder_loops, decoy_vocabulary_density
         -&amp;gt; Treat as a tarpit. Stop here: do not read, trace, or try to deobfuscate this file. Skip it and move on, or flag it for a human.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In directory mode it also looks for tool fingerprints, such as a &lt;code&gt;.bla-hardened/&lt;/code&gt; folder, &lt;code&gt;.blarc&lt;/code&gt; or &lt;code&gt;bla-harden-summary.json&lt;/code&gt;, which are near-certain evidence on their own.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hard part: minified is not hostile
&lt;/h2&gt;

&lt;p&gt;The first version of this tool was wrong in an instructive way. It leaned on file size and line length, and it scored minified jQuery &lt;em&gt;higher&lt;/em&gt; than a genuinely obfuscated file. Minified code is machine-generated and ugly, but it isn't hostile.&lt;/p&gt;

&lt;p&gt;So the current signals key on things ordinary code, even heavily minified code, almost never produces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Math.imul&lt;/code&gt; opaque-predicate chains guarding real branches&lt;/li&gt;
&lt;li&gt;dense &lt;code&gt;_0x...&lt;/code&gt; string-array identifiers (the javascript-obfuscator family)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fromCharCode&lt;/code&gt; + &lt;code&gt;charCodeAt&lt;/code&gt; loops that rebuild encrypted strings at runtime&lt;/li&gt;
&lt;li&gt;self-defending and control-flow tricks like &lt;code&gt;!![]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;clusters of planted decoy vocabulary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a file dominated by one- and two-letter identifiers with none of those markers is recognised as plain minification and capped low.&lt;/p&gt;

&lt;p&gt;A labelled corpus of clean source, real minified bundles and hostile obfuscation runs on every change as a regression test. Today it shows 0 false positives and 0 false negatives: the highest benign score is 9.5 and the lowest hostile score is 78.&lt;/p&gt;

&lt;h2&gt;
  
  
  One rule: detect, never reverse
&lt;/h2&gt;

&lt;p&gt;tarpit-guard reads the &lt;em&gt;shape&lt;/em&gt; of a file, never its meaning. It doesn't deobfuscate, crack or extract secrets, and it never will. Building that would turn the project into the thing it warns about. This line is permanent and written into the README.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built to be boring to install
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pure Python standard library. Zero dependencies.&lt;/li&gt;
&lt;li&gt;Runs locally on raw text. No network, no code execution.&lt;/li&gt;
&lt;li&gt;A CLI for you and your CI, with &lt;code&gt;--json&lt;/code&gt; output.&lt;/li&gt;
&lt;li&gt;An optional MCP server so agents can run the check themselves.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install tarpit-guard
tarpit-guard path/to/code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To give an agent the tool, add the MCP server to your client config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"tarpit-guard"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"uvx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"--from"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tarpit-guard[mcp]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tarpit-guard-mcp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server exposes three tools: &lt;code&gt;check_file&lt;/code&gt;, &lt;code&gt;check_source&lt;/code&gt; and &lt;code&gt;scan_repo&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it is now
&lt;/h2&gt;

&lt;p&gt;tarpit-guard passed 1,700 PyPI downloads in its first week. The MCP server is listed on the official MCP Registry and on Glama, and on mcprush it has a Grade A rating with a 100/100 trust score. A Claude plugin is currently in review.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next, and how you can help
&lt;/h2&gt;

&lt;p&gt;The detector is only as good as the samples it has seen. The roadmap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More obfuscator fingerprints: webpack/terser signatures, PyArmor, obfuscator.io variants&lt;/li&gt;
&lt;li&gt;A larger real-world corpus, with thresholds pinned against it&lt;/li&gt;
&lt;li&gt;Per-language signal profiles for JS/TS, Python and WASM glue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've got a file it scores wrong, or a real obfuscated sample, please open an issue. There are good first issues tagged for new contributors, and the codebase is small enough to read in one sitting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/ManiraM-1/tarpit-guard" rel="noopener noreferrer"&gt;https://github.com/ManiraM-1/tarpit-guard&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;PyPI:&lt;/strong&gt; &lt;a href="https://pypi.org/project/tarpit-guard/" rel="noopener noreferrer"&gt;https://pypi.org/project/tarpit-guard/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it saves your agent from one tarpit, a star on the repo helps other developers find it.&lt;/p&gt;

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