Inspiration
I use AI coding agents a lot, and I kept noticing three ways they can hurt you.
- They make up package names. One study of 576,000 code samples found about 1 in 5 had a package that doesn't exist. Attackers now register those names, so the next
pip installgets their code. - A repo you clone can carry instructions for your agent in files like
CLAUDE.mdorAGENTS.md, or a hook config that runs a command on your machine. - Agents paste API keys into code and commit them.
I couldn't find one tool that covered all three, so I built ezco.
What it does
ezco clone <url>clones a repo and checks its agent files (Claude Code, Codex, Gemini CLI, Cursor, Windsurf, Cline, Copilot) before any agent opens the folder. Anything dangerous gets renamed to.quarantined, so the agent never loads it. Hidden Unicode "tag" characters are decoded, so you can read what was smuggled in.ezco install --agentadds a hook to Claude Code, Codex or Gemini CLI. When the agent runspip installornpm i, ezco looks the package up first. If it doesn't exist, looks like a typo of a popular package, or is brand new with almost no downloads, the command is denied and the agent is told why. The hook also deniesgit commit --no-verifyfrom the agent.ezco installadds a git pre-commit hook. It blocks commits that add fake packages, leaked keys (with steps to revoke each one), or poisoned MCP tools and agent files.--deepis optional. It sends the code to an LLM on Groq for a second look, with the secrets it can detect blanked out first. The LLM can only add warnings, never cancel a rule.
The brand-new-package rule is strict on purpose. It also stops real packages under a month old from small projects, like your own new package. The agent is told to ask you, and you can put names you trust in ~/.ezco-allow.
ezco is a guardrail against an agent's mistakes, not a wall. An agent that really wants to get around it can use git -c core.hooksPath, delete the hook, or run a script that installs something.
How I built it
It's plain Python 3.11+, using only the standard library, so installing it pulls in nothing else. Package checks use the public PyPI and npm APIs, plus lists of the top 5,000 packages to spot typos. Secrets and prompt injection are found with regex and keyword rules. The agent hook answers in each tool's documented JSON format instead of relying on exit codes. The tests run on GitHub Actions on Linux, macOS and Windows.
I built it solo with Claude Code. Every AI tool is listed in the table below.
Started after the hackathon opened (Nov 1, 2026):
- First commit: Nov 27, 2026, 10:48 IST (
7c41056, seegit log --reverse). - GitHub repo created: Nov 27, 2026, 07:58 UTC (13:28 IST), recorded by GitHub (
created_atat https://api.github.com/repos/negimedhansh47-jpg/ezco). - First PyPI release: 0.1.0 on Nov 28, 2026, recorded by PyPI (https://pypi.org/project/ezco/#history).
Challenges I ran into
- Commit time is too late for packages. A bad package runs code the moment it's installed. That's why I added the install hook, so the check happens before the install.
- PowerShell broke my first hook. Claude Code reads exit code 2 as "deny", but PowerShell turned it into 1, so nothing was blocked. I switched to the JSON "deny" answer each tool documents.
- Claude Code reads
CLAUDE.mdthe moment it starts, and no hook can stop that. So the clone check has to run before you open the agent. - Cursor's docs don't say whether a hook answering "allow" skips your approval prompt. If it does, my hook would make Cursor less safe, so I left Cursor's install hook out on purpose.
- My own new rule blocked me. On ezco's first day on PyPI, the brand-new-package rule denied
pip install -U ezco. That's what made me add the allow list.
Accomplishments that I'm proud of
- I attacked my own tool on purpose and found 31 ways to sneak an install past the hook (
sudo pip,bash -c "...", Windows paths). I also found 11 secret formats it missed, and a Windows bug where PowerShell's input made the hook allow everything. All fixed, each with a test: stress test report. - A code review on the last day found three ways a key could slip past the commit hook, for example an added line starting with
++. All fixed in 0.2.4. - Clone check: 44 of 47 hand-labelled repos right, using rules alone. It misses two attacks reworded with no trigger phrase, and has one false alarm on a security note that quotes an attack.
- Agent config files (Cursor, Codex, Gemini): 44 of 44.
- Install hook: 120 of 120 commands right. It works live in Claude Code and Gemini CLI on Windows. Codex support is experimental: built from its docs and source, never run live.
- Real repos: on 500 real agent files from 7 public repos, 2 were flagged, both security guides that quote an attack.
- 150 automated tests, passing on Linux, macOS and Windows.
- It's on PyPI:
pip install ezco(0.2.4).
The first test sets were written by a separate AI agent that hadn't seen the code, so I wasn't grading my own homework. Cases added later were written by the sessions that fixed them.
What I learned
Every agent tool has its own hook format and its own odd behaviour on Windows, and reading the official docs closely saved me more time than clever rules did. I also learned to measure before claiming. The brand-new rule "caught" all 20 of the newest PyPI packages, but most of those were real projects, so I now describe it as strict, not accurate.
What's next
- Run the install hook live in Codex.
- Add a Cursor install hook once Cursor documents what "allow" does.
- Close the hole where a line marked
# ezco:ignoreinrequirements.txtgets pastpip install -r.
Limits
- The secret and injection rules are patterns, so clever rewording gets past them. That's what
--deepis for. - The clone check only protects you if it runs before you open an agent (
ezco cloneorezco guard). A plaingit cloneisn't covered. It reads agent files, not READMEs, docs or code comments. - Codex support is experimental.
Built with
python, git, github-actions, groq, pypi, npm
| Tool / library / API | Type | What it was used for |
|---|---|---|
| Claude Code (Anthropic, Claude Opus 5.5) | AI coding assistant | Research, planning, and writing code, tests and docs with me |
| Claude Sonnet and Claude Haiku (Anthropic), run as Claude Code sub-agents | AI assistant | Writing independent test sets, acting as a first-time user, reading competitors' docs, a bug review of five modules and a dead-code check |
Groq API (default model openai/gpt-oss-120b) |
AI API | Optional --deep review. Only when --deep or EZCO_DEEP=1 is used, the file contents (for a commit, the added lines) go to Groq with detected secrets replaced by [REDACTED] |
Python standard library (urllib, difflib, concurrent.futures, unittest, tomllib, shlex) |
Built-in | HTTP calls, lookalike names, parallel lookups, tests, Codex TOML configs, splitting commands |
GitHub Actions (actions/checkout, actions/setup-python, pypa/gh-action-pypi-publish) |
CI | Tests on Linux, macOS and Windows; PyPI releases |
build, twine (PyPA) |
Packaging tools | Building and checking the package (dev only) |
ruff, vulture |
Linters | Checking for unused and dead code (dev only) |
GitHub code search (via gh CLI) |
Public API | Finding real Cursor/Codex/Gemini config files to test false alarms |
| Official docs: Claude Code, Cursor, OpenAI Codex, Gemini CLI | Documentation | Hook and config formats (docs/research-harnesses.md) |
| PyPI JSON API | Public API | Does a Python package exist, and when was it first released |
| pypistats.org API | Public API | Recent download counts for Python packages |
| npm registry | Public API | Does an npm package exist, and when was it created |
| npm downloads API | Public API | Weekly download counts for npm packages |
| top-pypi-packages (hugovk) | Public dataset | Top 5,000 PyPI names, for typo checks; ranks 5,001 to 15,000 sampled to measure false denies |
| npm-high-impact (wooorm, v1.13.0, via jsDelivr) | Public dataset | Top 5,000 npm names, same use |
| PyPI RSS feeds, npm search API | Public API | Real new and less popular packages, to measure the brand-new rule (dev only) |
| Google Fonts (Bricolage Grotesque, JetBrains Mono) | Web fonts | Landing page typefaces |
| GitHub Pages | Hosting | The landing page |
Code: https://github.com/negimedhansh47-jpg/ezco Site: https://negimedhansh47-jpg.github.io/ezco/