Before you begin, make sure you have:
- A PandaProbe account. Sign up at app.pandaprobe.com.
- A PandaProbe API key + project name.
- The
pandaprobeCLI installed and authenticated — the harness reaches the platform exclusively through it. - An agent traced with the PandaProbe SDK, so its turns produce scoreable traces.
- A model for the repair agent, plus its provider credentials. It is a real LLM call, and no default is chosen for you.
1
Install the package
- pip
- uv
pip install "pandaprobe-harness[langgraph]".2
Install and authenticate the CLI
Every platform call the harness makes — listing traces, running evaluations, polling scores — shells out to
pandaprobe. It never talks to the REST API directly.3
Pick a workspace root
The harness maintains its diagnostic workspace (mailbox, journal, rules, eval cases) on disk. The default is
/harness; point it anywhere writable:4
Choose a repair model
Diagnosis runs on a separate, package-owned repair agent, so it needs a model. Any LiteLLM identifier works, and that provider’s own credentials must be present:
5
Wire the harness into your agent loop
Any custom loop integrates in a handful of lines — no adapter required:Using LangGraph, CrewAI, or another supported framework? A
Harness.for_<framework>() factory wires turn detection for you — see Framework adapters.6
Watch a healing cycle
Nothing else is required — the loop is fully automatic:Or read the repair outcome straight off settlement:
- Each turn, the harness scores the new traces on
task_completionandcoherence. Low scores early are fine; what it watches is the trajectory. - The trajectory stalls (no progress across
gate_windowturns) or regresses (a drop from the session’s best). That opens the gate. - Tier 2 runs on the latest trace only —
tool_correctness,argument_correctness— to find which step was wrong. - Tier 2 confirms it, so a
breachnotice is posted. (Had Tier 2 come back clean, it would be an advisorytrendnotice instead.) - The repair agent picks it up: it reads the notice, inspects the flagged trace, checks whether an existing rule already covers this, then writes at most one rule — an unproven candidate — and chooses which scope it belongs in. Your task agent is not involved and loses no turns to this.
- The harness validates the candidate (by replaying the captured failure, or by watching the next live sessions) and promotes it to active — or retires it. Neither agent can promote its own rule.
- The validated rule is readable by your agent, on demand, in every future run.
Optional, and worth it
Two developer-supplied seams turn a good loop into a rigorous one:- A replay function upgrades rule validation from statistical to counterfactual and unlocks regression runs.
- An outcome verifier — anything that can score a finished task — becomes the metric that decides promotion, instead of a judged proxy.
Try it offline first
The repository ships runnable, fully-offline demos — no credentials, no network:What’s next?
Concepts
What self-healing means here, and the ideas behind the closed loop
The repair agent
The repair agent: episodes, capabilities, and scope selection
Framework adapters
LangGraph, LangChain, DeepAgents, CrewAI, Claude Agent SDK, OpenAI Agents

