ezco
Website: https://negimedhansh47-jpg.github.io/ezco/
A security guard for commits written by AI coding agents. It runs before every git commit and blocks the commit if it finds:
- Fake or suspicious packages. AI tools invent package names that don't exist (about 1 in 5 in one study of 576,000 code samples). Attackers register those names ("slopsquatting"). Blocks packages that don't exist and typos of popular packages that almost nobody uses. Checks
requirements.txt,pyproject.toml,package.jsonand packages launched by MCP configs. - Leaked secrets. API keys (AWS, GitHub, OpenAI, Anthropic, Google, Stripe, Slack, Groq; from 0.2.0 also npm, PyPI, Hugging Face, GitLab, Slack webhooks, and keys split with
+or written in base64), private keys (PGP from 0.2.0), passwords inside database URLs, and random-looking hard-coded secrets, with the exact link and steps to revoke each one. Secrets are masked in the report. Also warns when a.envfile is committed. - Poisoned MCP tools and agent files. Hidden Unicode characters, prompt-injection phrases in MCP tool code,
AGENTS.md,CLAUDE.md,.cursorrulesand Cursor.mdcrules, and risky MCP server configs (unpinned packages,curl | sh, plain-http servers). It scans files in your repo; it does not connect to live MCP servers. --deepmode (optional). An LLM (Groq) second pass for attacks the rules can't see. Secrets are redacted before anything is sent, and the LLM can only add warnings, never cancel a rule.
Install
pip install ezco
cd your-project
ezco install
That's it. Every git commit in that repo is now checked. Only the lines and packages the commit adds are checked, so it stays fast. Needs Python 3.11+.
Versions: pip install ezco gives 0.1.0. The fixes from stress test 3 (docs/stress-test-report.md) are in main as 0.2.0, not released yet. To get them now: pip install git+https://github.com/negimedhansh47-jpg/ezco. Lines below marked "from 0.2.0" need that.
If ezco isn't found (or Windows blocks ezco.exe), use python -m ezco instead: python -m ezco install. If you already have a pre-commit hook, ezco install --force keeps it as pre-commit.old and runs it first.
Use
| Command | What it does |
|---|---|
ezco install |
Turn on the check for every commit in this repo |
ezco scan |
Scan the whole folder now (or ezco scan file.py folder/) |
ezco scan --deep |
Same, plus the LLM review (needs GROQ_API_KEY) |
ezco install --agent [claude|codex|gemini|all] |
Also stop an AI agent from installing a fake package (see below). Default: claude |
ezco clone <url> [folder] |
Clone a repo and quarantine dangerous AI-agent files (see below) |
ezco guard [folder] |
Check a folder's AI-agent files before opening an agent there |
ezco uninstall |
Turn it off |
Why --agent matters: a malicious package can run code the moment it is installed, so catching it at commit time is too late. --agent adds a hook to the agent's project settings (.claude/settings.json, .codex/hooks.json or .gemini/settings.json). Before the agent runs pip install, npm i, uv add, npx and similar, the packages are checked. A fake or typo package gets the command denied, and the agent is told why, so it picks the real package instead. The hook answers with each tool's documented JSON "deny", so the shell's exit-code handling doesn't matter. It runs in PowerShell, sh and bash, not in cmd.exe (cmd can't run the C:/.../python.exe path the hook uses; Claude Code uses Git Bash or PowerShell, and which shell Codex and Gemini CLI use on Windows is unverified). With 0.1.0, the gate let everything through when Windows PowerShell piped the hook JSON with a byte-order mark and Python's UTF-8 mode was off; fixed from 0.2.0. ezco must be pip-installed, because the hook runs python -m ezco. Codex asks you to review and trust a new hook before it runs.
Which agents are covered
| Claude Code | Codex CLI | Gemini CLI | Cursor | Any other agent | |
|---|---|---|---|---|---|
| Commit hook (git) | Yes | Yes | Yes | Yes | Yes, if it commits with git and doesn't use --no-verify |
| Clone guard: instruction files | CLAUDE.md |
AGENTS.md, AGENTS.override.md |
GEMINI.md |
.cursor/rules/*.mdc, .cursorrules, AGENTS.md |
Windsurf, Cline, Copilot files |
| Clone guard: hooks + MCP servers | .claude/settings.json, .mcp.json |
.codex/hooks.json, .codex/config.toml |
.gemini/settings.json |
.cursor/hooks.json, .cursor/mcp.json |
.vscode/mcp.json |
| Install gate | Yes, live-tested (Windows) | Yes, format from Codex docs, not live-tested | Yes, format from Gemini docs, tested by piping its hook JSON through PowerShell and sh. Gemini CLI 0.58 loads the hook ("These hooks will be executed"), but a full live run is not done yet | No (see below) | No |
- No Cursor install gate, on purpose. Cursor's docs don't say whether a hook answering "allow" skips your normal approval prompt. If it does, a gate that allows clean commands would auto-run every command, and Cursor would get less safe. The clone guard still covers Cursor's files.
- Formats and sources: docs/research-harnesses.md. CI runs the tests on Linux, macOS and Windows, with Python 3.11 to 3.13.
- Live tests: Claude Code on Windows (Nov 27, 2026).
pip install reqeusts-toolbeltzwas denied with the reason shown to Claude, andpip install requestsran normally. - Try it yourself in Codex or Gemini: in a throwaway git repo, run
ezco install --agent codex(orgemini) and start the agent there (trust the folder or hook if asked). Ask it to runpip install reqeusts-toolbeltz: it should be denied with the reason. Thenpip install requestsshould run normally. Please report the result in an issue.
Clone guard: protect yourself from repos you pull in
ezco clone https://github.com/someone/repo
A repo you clone can attack you, not just your commits. Its CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules, .windsurfrules, .clinerules, Cursor .mdc rules or copilot-instructions.md can hide instructions for your AI agent (invisible Unicode, "ignore previous instructions..."). Its .mcp.json can launch a server, and its .claude/settings.json, .cursor/hooks.json, .codex/hooks.json, .codex/config.toml or .gemini/settings.json can hold a hook that runs a command on your machine. When a hook runs a script shipped in the repo (bash .cursor/hooks/setup.sh), the script is checked too.
ezco clone runs git clone, then checks every one of those files. Any file with a BLOCK finding is renamed to <name>.quarantined, so no agent loads it. The report says what was found and how to rename it back. Hidden "tag" characters are decoded, so you see the smuggled message. In a cloned repo, ezco:ignore marks and .ezcoignore are not honoured, because the repo's author wrote them.
- Already cloned?
ezco guard path/to/repodoes the same check (--no-quarantineto only report). --deep(oncloneorguard) also sends the agent files, secrets redacted, to the LLM. It catches reworded attacks with no trigger phrases. Unlike at commit time, an LLM hit here quarantines the file it names. The LLM can still only add findings, never clear the rules' findings, and a quarantine is just a rename you can undo.ezco installalso adds apost-mergegit hook that re-checks agent files after everygit pull(warns only).git pull --rebasedoesn't run post-merge hooks, so it's not covered there.- A hardcoded key in a cloned agent file is reported as a WARN from 0.2.0 (a BLOCK and a quarantine in 0.1.0): someone else's leaked key can't attack you.
- Rules are stricter than at commit time, because a stranger wrote these files. Any prompt-injection sign in an agent file quarantines it, and so does a hook that uploads data (
curl -d), runs encoded code (-EncodedCommand,base64 -d | sh) or runs downloaded code. Other hook commands only warn. The catch: aCLAUDE.mdthat quotes an attack as a security example gets quarantined too. Read it and rename it back. - Exit codes:
0clean or warnings only,1something was quarantined (or found, with--no-quarantine),2the folder doesn't exist.ezco clonepasses on git's own exit code if the clone fails. ezco uninstallremoves the commit hook, the post-merge hook and the agent gate.
The honest catch: Claude Code loads CLAUDE.md the moment it starts in a folder, and no Claude Code hook can stop that. So the protection only works if the check runs before you open an agent there: clone with ezco clone, or run ezco guard first. Opening a poisoned folder directly with an agent is not protected. (Claude Code does ask you to trust a new folder first; that is your last chance to run ezco guard.)
Demo (run it in a clone of this repo; demo/ is not in the pip package): python demo/make_trap_repo.py trap builds a booby-trapped repo (hidden Unicode + an injection line in CLAUDE.md, and a .claude/settings.json hook that runs curl ... | sh). Then ezco clone trap victim. The payload points at example.invalid, which can never resolve.
False alarm? Three ways out:
| Way | Works in | Example |
|---|---|---|
ezco:ignore anywhere on the line |
any file with comments (.py, .js, .env, .yaml, requirements.txt, Markdown via <!-- ezco:ignore -->) |
KEY = load() # ezco:ignore |
.ezcoignore file in the repo root |
any file, incl. JSON (no comments allowed there) | demo/ or *.min.js |
| skip once | the whole commit | git commit --no-verify |
- Deep mode on a commit: set
EZCO_DEEP=1(PowerShell:$env:EZCO_DEEP=1) beforegit commit. Get a free key at console.groq.com/keys and setGROQ_API_KEY, or putGROQ_API_KEY=...in a.envfile in the repo folder (keep.envin.gitignore). A real environment variable wins over.env.
BLOCK stops the commit. WARN is printed but lets it through.
Try the demo
python -m ezco scan demo
Run it in a clone of this repo. demo/ has planted problems: a fake package, a typo package, leaked keys, a poisoned MCP tool and a risky .mcp.json. None of the keys are real.
Run tests
python -m unittest discover -s tests
How it compares (honest table)
Taken from each tool's own README, read Nov 27, 2026. "Not stated" means their docs don't say. It does not mean the tool can't do it. slopgate-cli's npm page refused automated reading, so its column comes from Socket.dev's copy of its README and is unverified.
| Feature | ezco | slopscan | depfence | gitleaks | slopgate-cli (unverified) | What's Inherited |
|---|---|---|---|---|---|---|
| Fake (AI-invented) packages | Yes: PyPI + npm, live registry | Yes, live registry check is opt-in | Yes, 14 ecosystems, from curated lists | No | Yes, npm only | No |
| Typos of popular packages | Yes | Not stated | Yes | No | Yes | No |
| Leaked secrets | Yes | Yes | Yes | Yes (the most mature here) | No | No (reads env var names only) |
| Exact revoke steps per key | Yes | Not stated | Not stated | Not stated | No | No |
| Prompt injection / hidden Unicode in agent files | Yes | Partly (in source code) | Yes (zero-width, MCP tool text) | No | No | Lists the files, doesn't judge them |
| MCP config check | Yes | Secrets only | Yes | No | No | Lists servers only |
| Pre-commit hook | Yes | Yes | Yes | Yes | No | No |
| Stops an agent's install before it runs | Yes: Claude Code (live-tested), Codex, Gemini CLI | Not stated | Listed as an integration, no details | No | Yes, Claude Code + Codex, npm only, macOS/Linux builds | No |
Checks .claude/settings.json hook commands |
Yes | Secrets only | Partly (SessionStart hook injection) | No | No | Yes, lists them |
| Quarantines a cloned repo's agent files before an agent opens them | Yes (ezco clone) |
Not stated | Not stated | No | No | No: "Nothing is edited, quarantined or scored" |
| Optional LLM review | Yes, Groq, secrets redacted, can only add warnings | Yes, Gemini | No | No | No | No |
What only ezco does (by these tools' own docs): quarantining a cloned repo's agent files before an agent loads them, and giving revoke steps for each leaked key. It also covers commit time, install time and clone time in one zero-dependency tool.
Where others are stronger: depfence covers far more ecosystems (Cargo, Go, Maven...) and does SBOMs. gitleaks has much deeper secret rules and scans git history. What's Inherited gives a fuller inventory of what a repo hands an agent (skills, subagents, imports).
Limits (honest list)
- Secret detection uses patterns. Unusual secret formats are missed, and deep-mode redaction only hides what the patterns catch.
- Injection phrases are English keyword rules; clever rewording gets past them (that's what
--deepis for). A single phrase only blocks in agent files and MCP tool code; elsewhere (e.g. docs that quote an attack) it warns. - If PyPI/npm can't be reached, unknown packages get a WARN, not a BLOCK, so a network hiccup never stops your work.
- Deep mode is tested offline with a fake LLM, and was run live once on Groq with
openai/gpt-oss-120b. Override the model withEZCO_MODEL. - The clone guard checks only the agent files listed above (from 0.2.0 also
CLAUDE.local.md,.claude/agents,.claude/commands,.claude/skillsand Copilot*.instructions.md). It doesn't checkstatusLinecommands or a repo's normal code. It follows hook commands into scripts inside the repo, but not Windows-style.\script.ps1paths. - The install gate doesn't run if Python is installed in a folder with a space (
C:\Program Files\...) and the agent uses PowerShell: the hook's quoted path needs&there. A per-user Python install has no space. - The install gate fails open: if the registry can't be reached it allows the install. A registry that hangs makes it wait up to 10 s per batch of 8 unknown names before allowing.
- More limits found by the stress test: docs/stress-test-report.md.
Test results
Now (0.2.0 in main, Nov 28, 2026): 127 automated tests. Clone corpus 44 of 47, harness corpus 44 of 44, install-gate corpus 98 of 98. The corpora grew during stress test 3: the added cases (s3_*) were written by the session that fixed them, not by an independent agent. The original 70 repo cases score 67 of 70. On 500 real agent files from 7 public repos, 2 were quarantined, both security guides quoting "ignore previous instructions" as an example. Full report: docs/stress-test-report.md.
Earlier results (Nov 27, 0.1.0):
- Accuracy: 99 of 107 hand-labelled cases correct, written by a separate AI agent that hadn't seen the code. 0 false alarms on 30 normal files (lookalikes like
tokenizer=, UUIDs, lockfile hashes, emoji, Hindi/Arabic text, placeholder keys). - Clone guard (Nov 27): 37 of 40 hand-labelled repos correct with the rules alone (written by a separate AI agent that hadn't seen the code). Misses: two attacks reworded with no trigger phrases, and one false alarm, a
CLAUDE.mdsecurity note quoting an attack. With--deep, both reworded attacks were caught. One more harmless-labelled repo was flagged, a hook that silently runspip install -r requirements.txt. - Cursor / Codex / Gemini files (Nov 27): 30 of 30 hand-labelled cases correct, after adding a rule for script-level attacks (Python/JS that fetch-and-eval, save-and-run, or send secrets out). 0 false alarms on 102 real
.cursor/hooks.json,.codex/config.toml,.codex/hooks.jsonand.gemini/settings.jsonfiles from public GitHub repos. - Rerun them:
python tests/corpus/score.py. The cases are stored as JSON, not as real files, so no agent working on this repo loads the poisoned ones. - Real repos: 0 false alarms on 271 real agent files from awesome-cursorrules (257 Cursor rules), openai/codex, anthropics/claude-code and langfuse, after fixing one hit on "builds do not read
.envfiles". Guarding a 5,000-file repo with a 1 MBCLAUDE.mdtakes about 2 seconds. - Install gate (Nov 27): 40 of 40 commands correct (15 fake or typo installs blocked, 25 real or non-install commands allowed). It takes about 0.4 s per command, or about 1 s when an unknown package needs a registry lookup.
- Speed: a normal commit takes under 1 second. The first commit of a 40-package npm app is instant (popular packages are known-safe). A full scan of 2,000 files takes about 12 seconds. A 1 MB single-line file takes under 1 second.
See AI_USAGE.md for every tool, API and dataset used.
Maintainers: publishing to PyPI
Releases use PyPI Trusted Publishing (.github/workflows/release.yml). No API token is stored anywhere. It runs only when a v* tag is pushed.
- Create an account at pypi.org/account/register and turn on 2FA (PyPI requires it).
- Go to pypi.org/manage/account/publishing and add a pending publisher: PyPI project name
ezco, ownernegimedhansh47-jpg, repositoryezco, workflowrelease.yml, environmentpypi. - On GitHub: repo Settings > Environments > New environment, name it
pypi. (Optional: add yourself as a required reviewer, so each release waits for your click.) - Make sure
versioninpyproject.tomlis the version you want, commit and push. - Tag and push the same version, e.g.
git tag v0.2.0thengit push origin v0.2.0. - Watch the Actions tab. When the
releasejob is green, the package is on pypi.org/project/ezco.
A version number can be published only once. For a fix, bump version and push a new tag.
License
MIT. See LICENSE.
Metadata
Release files for ezco 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezco-0.2.0.tar.gz | 121.5 kB | With provenance | Details for ezco-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezco-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ezco-0.2.0-py3-none-any.whl |
Total release size: 226.6 kB
Release files / ezco-0.2.0.tar.gz
| Download URL | ezco-0.2.0.tar.gz |
|---|---|
| Size | 121.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b32dac380685873a80660e71abfd4f4af8da51c4963ae9d4e318edfca063b413
|
|
BLAKE2b-256 checksum How to use checksums |
4f5d2f087f13be531cfe0894d80aa242c9dc874b8bbc49e7fcc8a96f672b4e89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / ezco-0.2.0-py3-none-any.whl
| Download URL | ezco-0.2.0-py3-none-any.whl |
|---|---|
| Size | 105.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6c5ecba925909749c1627bd6da7d581c3e5a9e61ad2022a744771a421ef1e8c
|
|
BLAKE2b-256 checksum How to use checksums |
f4d4169d79ce5e8b55cf592b11b49e95b5fd21ee59eb46b7ec58b7a433c576be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for ezco 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ezco-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.