418-byte file balloons to 180KB: tarpit-guard MCP server flags AI-trapping code
Ok-Impact-5316 · reddit · 2026-12-01
Some code is now deliberately crafted to trap AI agents. Using a hardening tool called BLA, the author turned a 418-byte JS file into 180KB of decoy functions and misleading comments — functionally identical, but an agent reading it burns tens of thousands of tokens.
They released tarpit-guard, a small MCP server that scores files 0-100 for tarpit potential so agents can check before reading and stop if flagged; it only detects, never decodes.
- The BLA file scores 78 (TARPIT); minified jQuery/Lodash score near 0, so normal minified code isn't flagged
- Runs locally over stdio, zero-dependency core, no server/account/cost
- Works with Claude Desktop (one-click extension), Claude Code, and Cursor
- Install: pip install "tarpit-guard[mcp]"
The author is soliciting feedback, especially false positives.
More from coding & agent
- exe.dev pitches 'a private computer for your agents': real VMs with root via SSH — davidcrawshaw · 2026-12-01
- Check crawl logs: ChatGPT-User agent may be hunting /black-friday/ pages at the wrong slug — gaganghotra_ · 2026-12-01
- 'RIP Cursor, long live Grok Build': a user's verdict on xAI's coding tool — alexmacgregor__ · 2026-12-01
- Strands Agents ships Rust SDK: 50ms cold start and 48MB vs Python's 2.4s — FlolightC · 2026-12-01
- MCP config hell: every client wants a different format and failures are silent — TwistNo5735 · 2026-12-01
- Make a coding agent prove its fix: self-correcting loop with evidence — Harshit_Ahluwalia · 2026-12-01