Kestrel — an autonomous red-teaming agent for tool-using AI agents

About this project
About this project
Kestrel registers an HTTP chat target you own, picks an attack family, and runs single-turn or adaptive multi-turn conversations against it, scoring each reply with hard evidence first — a planted canary string, a detected unsafe-output pattern — before ever asking a model to judge subjectively. Every run is logged, mapped to the OWASP LLM Top 10, and remembered, so later attacks try what worked on similar targets before.
What it is for. Teams building tool-using AI agents need to know where they break before someone else finds out for them, but testing prompt injection and jailbreaks by hand doesn't scale across dozens of attack families and multi-turn strategies. Kestrel runs the attacks and keeps the receipts — what was sent, what came back, why it counts — so you get a report instead of a transcript to re-read.
What it does. Pick a target, pick an attack family — direct injection, indirect injection, jailbreak, and others — and Kestrel either sends one crafted message or runs an adaptive loop that adjusts its next message from the target's last reply and from patterns that worked on similar targets before. Hard evidence — a planted canary, a detected unsafe-output pattern such as SQL injection or credential leakage — ends a run "confirmed" with no judge call needed; without it, a judge model reads the exchange and calls it "suspected" or "held." A demo login lets a visitor try one attack against a sacrificial target with no account, under a daily limit; real use needs a signed-in, allow-listed identity, with every user's targets and runs invisible to every other user.
How it is kept honest. Every behavioural requirement is written as a numbered spec before any code, with a named test citing it; a CI gate refuses a pull request that touches application code with no spec behind it. No auth header value or prompt text is ever written in plain text to a log, a report, or the store that remembers past attack patterns — a test asserts this directly. Attack-prompt text itself never lives in code, comments, or commit messages, only the behaviour it produces.
Built with. Python 3.12, FastAPI, Streamlit, LangGraph, SQLite, ChromaDB, pytest; attacker and judge models via OpenRouter; Auth0 for hosted-mode sign-in; GitHub Actions for CI; Railway for hosting. Developed with Claude Code.
What would help most. A real tool-using agent you're willing to have attacked, with permission and its own account — Kestrel's adaptive strategies and remembered patterns sharpen fastest against targets that aren't the same sacrificial demo app every time.