Pepper & Carrot AI-powered flipbook · Part 20 — Rebuilding the Red-Teamer on LangGraph Deep Agents: Same Rules, a Batteries-Included Harness
Part 20 of the Pepper & Carrot AI flipbook series. Post 19 built an AI agent that attacks my own reading app, hand-rolled from scratch. This post rebuilds it on LangChain's Deep Agents, which hands you planning, subagents, and human-in-the-loop for free. But the project lives by one rule: the attacker never grades its own attack. A framework makes that rule easy to break, since the obvious move is to give the model a tool for everything — including the judge. The fix takes one line: compute the verdict inside the tool the agent calls, so it can read a pass/fail but never produce one. Then we make the attacker much smarter, without letting it become its own scorekeeper.