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 agentic red-teamer by hand — a raw loop around the Anthropic SDK. This post rebuilds the same red-teamer on LangChain's Deep Agents (the batteries-included harness on top of LangGraph) and asks the only question that matters: can you adopt a framework that hands you planning, subagents, a filesystem, and human-in-the-loop for free — without losing the one rule the whole project lives by? Explore agentically, judge structurally: the agent decides what to try, but a separate, checkable oracle — never the attacker — decides whether it won. A framework makes that rule *harder* to keep, because it will happily let the model grade its own homework. The fix is one load-bearing move: keep the oracle out of the agent's reach, wired into the tool it calls rather than exposed as a tool it can call. Then, on that clean substrate, we go past Post 19 — teaching the attacker to reflect (a graded gradient, a coverage map, a novelty guard, an explicit reflect step, cross-run memory) while keeping every one of those signals advisory, so the one rule still holds.