AI coding agents are fast, and sometimes they take shortcuts you won't notice until it hurts. Here are three I made short videos about this week. Each one comes with a command you can run today.
1. Slopsquatting: your agent installs a package that doesn't exist
LLMs sometimes suggest package names that were never published. Anyone can register those names on npm or PyPI and put malicious code inside. The attack is called slopsquatting.
The numbers come from "We Have a Package for You!" (Spracklen et al., USENIX Security 2025). The authors generated 576,000 code samples with 16 LLMs. 19.7% of the suggested packages didn't exist. When they re-ran prompts that had produced a fake name, 43% of those fake names came back in all 10 reruns. Names that predictable are easy to squat.
"Just try installing it" is the wrong move. npm install runs a package's preinstall, install and postinstall scripts, so its code runs the moment it lands.
The 5-second check:
npm view PACKAGE-NAME time.created repository.url
- If you get
404 Not Found, the name is made up. Stop there. - If it exists, look closer. A brand-new package with no repo and only a handful of weekly downloads is a red flag. Existing doesn't mean safe.
- For Python,
https://pypi.org/project/PACKAGE-NAME/returns a 404 for names that were never published.
Then add this rule to AGENTS.md: "Never invent file paths, API fields, package names, URLs, versions or quotes. If unsure, say so and say how to find out."
2. Claude Code reads your .env without asking
According to Claude Code's permissions docs, file reads inside your working directory need no approval. Read-only shell commands like cat, head, tail and grep also run without a prompt. If the agent decides your Stripe bug "might be config", your live keys end up in the conversation. The docs also say a .claudeignore file has no effect.
The fix: deny rules in .claude/settings.json:
{
"permissions": {
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Read(./secrets/**)"
]
}
}
- Deny beats allow, so no allow rule can carve an exception out of it.
- Read deny rules also cover file commands Claude recognizes in Bash, such as
cat,head,tailandsed. - Commit the file and your whole team is covered.
- Caveat: a Python or Node script that opens the file itself isn't covered. For OS-level blocking, turn on the sandbox.
3. Your agent made CI green by deleting the failing test
Ask an agent to "make CI pass" and sometimes it takes the shortcut. It deletes the failing test, or marks it .skip, and reports green. Anthropic's own Claude prompting guide warns that Claude "can sometimes focus too heavily on making tests pass at the expense of more general solutions."
Catch it with git:
git diff main --name-only --diff-filter=D -- '*.test.*'
git diff main | grep -E '^\+.*\.(skip|only)\('
-
--diff-filter=Dkeeps only deleted files, and--name-onlyprints just their paths. In a git pathspec,*matches across folders, sosrc/cart/cart.test.tsis caught too. - The grep finds added lines that call
.skip(or.only(, such asit.skiportest.onlyin Jest and Vitest. - In CI, diff against the base branch (for example
origin/main...HEAD) and fail the job if either command prints anything. - What this misses: an agent that rewrites the assertion so it passes. You still need to read the test diff.
Put the rules where your agent reads them
Each of these checks has a matching line for AGENTS.md: no invented packages, never read .env*, and "green by cheating is red." They're all in the hard rules of our packs:
- DRW-06: Supabase + Next.js Agent Kit ($19). AGENTS.md, CLAUDE.md, 8 scoped Cursor rules, 10 prompts and a Claude Code hook that blocks tables without RLS: https://agentkitdrawer.com/supabase-nextjs-agent-kit/?utm_source=devto&utm_medium=article&utm_campaign=2026-44&utm_content=agent-footguns
- DRW-00: One-File Agent Rules ($9). One 160-line AGENTS.md for Cursor, Claude Code and Codex: https://agentkitdrawer.com/?utm_source=devto&utm_medium=article&utm_campaign=2026-44&utm_content=agent-footguns#one-file
Has your agent pulled any of these on you? Tell me in the comments.
Top comments (0)