I attacked my own repo — my PR bot blocked the attack before merge
Description and use
AgentGuard detected and blocked 12 hidden attacks in agent configuration, prevented a dangerous push via GitHub Secret Scanning, and stopped an attack in a live PR without human intervention.
Problem
Coding agents can execute malicious instructions hidden in repo files, risking security breaches before code review.
Outcome
AgentGuard successfully detected all crafted attacks, prevented a malicious push via GitHub secret scanning, and blocked an attack in a live PR, demonstrating effective security gating for coding agents.
Workflow
- 1. Build AgentGuard CI gate to scan AGENTS.md, skills, MCP servers, hooks.
- 2. Inject 12 targeted attacks into a test repo.
- 3. Run AgentGuard unit tests to confirm detection of all attacks.
- 4. Scan 30 public repos for AGENTS.md; identify 5 with critical findings.
- 5. Manually verify findings and refine rules to eliminate false positives.
- 6. Push a test commit containing a fake Slack token; GitHub secret scanning blocks the push.
- 7. Deploy AgentGuard GitHub App (Pro) to comment on PRs and run check‑runs.
- 8. Create a harmless PR; observe green check‑run and merge allowed.
- 9. Create an attack PR; observe failure check‑run and merge blocked.
Evidence
AgentGuard detects all 12 — deterministically, no LLM oracle — with 36 unit tests that prove it forever (12/12 detected, 0 false positives on the clean control repo).
GitHub's secret scanning caught it and blocked the push.
PR #2 (attack: hidden instruction with exfil in AGENTS.md): comment Note E (1 findings), check-run failure → merge blocked.
- Record date: 2026-09-15T05:15:54.724Z