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, deliberately home-grown "to show the engineering." This post rebuilds the exact same red-teamer on LangChain's Deep Agents (the batteries-included agent harness on top of LangGraph), and asks the only question that matters: can you adopt a framework that gives you planning, subagents, a virtual 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 model — decides whether it won. The framework makes that rule *harder* to keep, because it will happily let the model grade its own homework. The answer is a single load-bearing move: keep the oracle out of the agent's reach, wired into the tool the agent calls rather than exposed as a tool the agent can call. Written from zero: what a "deep agent" is, what LangGraph adds, and every design decision the migration forced — including the rate-limit cascade that only a concurrent framework could have caused.