How I built a prompt injection scanner with Kiro CLI (Kiroween 2026)
I wrote this post as part of the Kiroween 2026 hackathon. The project is InjectGuard, built by Manadger Tech with Kiro.
The problem
AI agents read emails, web pages, support tickets and files. Attackers can hide instructions inside that content, for example "ignore all previous instructions" in an HTML comment, in zero-width characters, or in a base64 string. This is called indirect prompt injection. The agent reads it as if it were a normal instruction.
What InjectGuard does
InjectGuard is a small scanner for that text. You give it the content an agent is about to read. It returns a risk level, a score, and the exact spans that look wrong. It also has a sanitizer that strips hidden characters, a command line tool, and a browser demo that runs offline. It has zero dependencies and needs Node.js 20 or newer.
- Code (MIT): https://github.com/ManadgerTech/injectguard
- Live demo: https://manadgertech.github.io/injectguard/web/
- Demo video: https://youtu.be/tJJtdpMpySI
How Kiro built it
I used Kiro CLI (v3.7) in headless mode. The .kiro/ folder in the repo is the real record of the build.
Steering first. Before any code, three steering files (product.md, tech.md, structure.md) fixed the goals and limits: no dependencies, no network calls, no secrets in the repo.
Specs next. The spec folder has requirements in EARS style, a design with the full list of detection rules, and a task list. Kiro worked through the tasks one by one and ticked them off. Compared with prompting freely, it was easy to see what was done and what was still missing.
A hook for tests. An agent hook (.kiro/hooks/test-on-save.json) runs the test suite whenever a file in src/ is saved.
Kiro writes, runs and repairs. Kiro wrote the scanner, the CLI, the sanitizer, the web demo and 99 tests. It ran the tests and fixed failures itself.
The bug that taught me something
One test used the string '\uE0041'. JavaScript reads that as the character U+E004 followed by the digit 1, not as the Unicode tag character U+E0041. Attackers can hide text in the Unicode tag block (U+E0000 to U+E007F), so this mattered. The failing test showed that the scanner did not handle that block correctly. The fix was to work with code points (String.fromCodePoint(0xE0041)) and to use the u flag in the regular expressions. Without a test loop I would likely have missed it.
Tests and one long session
Besides example tests, I used property-style tests: mutate known attacks with zero-width characters and different casing, and check that random harmless text never gets a high score. These found gaps that plain examples did not.
At one point the service throttled a long run. kiro-cli chat --resume continued the same session with its context, so I did not lose the work.
What I did not use
I did not use custom agents, MCP servers or Kiro powers in this project. I used steering, specs, one hook, the CLI, session resume and test-driven repair.
Known limits
InjectGuard is a rule-based scanner, not a guarantee. For example, a sample email that asks to forward an inbox to a URL is not flagged as data exfiltration yet. Treat it as one layer, not the only defense.
Takeaway
The written spec and steering files did the most for quality. Kiro was fast, but the spec and tests kept it honest. Next I want to add more rules for exfiltration and test it on real agent inputs.
Built by Manadger Tech. Feedback and issues are welcome on GitHub.