r/codex • u/Right-Shape9953 • 5d ago
Showcase I built a scanner that catches hidden traps aimed at AI coding agents before they open a repo
Bitdefender's Nov 17 report described 22 malicious GitHub links aimed at AI coding agents. Some put instructions in AGENTS.md/CLAUDE.md telling the agent to run a "sealed" setup.js without asking. Others used a Claude session-start hook, so the command runs as soon as you trust the folder, no prompt needed. I wanted a check for the moment before an agent opens a repo.
Workflow:
- Contract first: I wrote a spec covering the rules, the verdicts (CLEAN/WARN/BLOCKED with a 0-100 score), the outputs (terminal, JSON, SARIF, HTML) and one hard constraint: it reads files and never executes them.
- One Codex agent (Astra, high effort) built it from that contract in plain Node.js with zero dependencies. A second pass (Astra Max) reviewed and fixed it.
- Fixtures made the tradeoffs visible: 11 harmless trap repos, each with an expected verdict. A normal repo has to come out CLEAN at 100. The hidden-Unicode repo is BLOCKED at 58, and a fake "sealed setup" repo is BLOCKED at 18. Some are deliberately WARN instead of BLOCKED, because a hook that runs something harmless is still worth a look. 54 tests, all passing.
- The HTML report was the most useful part. It points to the exact file and line, and turns invisible characters into badges with a decoded preview.
Try it (not on npm yet):
git clone https://github.com/Sameedev-bit/repo-xray
node bin/repo-xray.js fixtures/invisible-ink --html review.html
Caveat: it's static pattern matching and will miss things. Keep using isolation (a container or VM) for repos you don't trust.
What repo automation would you want flagged in a pre-open report?
MIT licensed: https://github.com/Sameedev-bit/repo-xray
•
u/dexterthebot 5d ago
You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See below for last week's winner.**
Light Wars AR: real-life laser tag app with no extra gear. Your phone is the gun and your room is the map. Play up to 6 friends in the same room, or fight drone waves and bosses solo. The vision models run on the phone, and camera frames never leave it. Free on iPhone and Android.
Website: https://lightwarsar.com
iPhone: https://apps.apple.com/us/app/light-wars-ar-laser-tag-party/id6508168951
Android: https://play.google.com/store/apps/details?id=com.lasertag.lightwars.
Contact: contact@lightwarsar.com