PandaProbe: Agents That Learn From Mistakes via Validated Rule Revisions

PandaProbe (arXiv:2612.05227) is an open-source tracing, evaluation, and reflection platform where agents inspect failed execution traces and propose edits to `/rules/**/*.md`, but cannot self-approve them. Validated across 16 paired runs on tau2-bench and Terminal-Bench, PandaProbe improved mean scores in every pairing and nearly tripled Kimi K2.5 pass^4 on retail (7.9% to 21.1%).
PandaProbe: Agents That Learn From Mistakes via Validated Rule Revisions: PandaProbe (arXiv:2612.05227) is an open-source tracing, evaluation, and reflection platform where agents inspect failed execution traces and propose edits to `/rules/**/*.md`, but cannot self-approve them. Validated across 16 paired runs on tau2-bench and Terminal-Bench, PandaProbe improved mean scores in every pairing and nearly tripled Kimi K2.5 pass^4 on retail (7.9% to 21.1%). Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 16/16 Paired Benchmark Wins: Beat the baseline agent in mean score across all 16 model-benchmark pairings (GPT-OSS 20B, Kimi K2.5, Nemotron 120B, Qwen3 32B).
- Dramatic Multi-Trial Reliability (pass^4): Kimi K2.5 pass^4 on tau2-bench retail jumped from 7.89% to 21.05%, and GPT-OSS 20B on airline rose from 20.0% to 32.0%.
- Strict Separation of Proposal & Approval: Agents edit working copies in `/rules/**/*.md`, while an independent validator enforces >=0.05 mean gain and <=0.02 regression.
- Zero Weight Fine-Tuning: Improves Terminal-Bench sample@2.0 GPT-OSS 20B mean score by +33.4% relative (0.2360 to 0.3148) strictly through validated rule retrieval.
import { createAgent } from '@smoke-monkey/harness';// Enforce read-only inbox evidence & gated rule promotion in Smoke Monkey Harnessconst agent = createAgent({agentId: 'pandaprobe-rule-reflection-agent',provider: 'openai-compatible',baseUrl: 'http://127.0.0.1:8000/v1',model: 'moonshotai/Kimi-K2.5',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'ask', // Require external gate before promoting /rules/**/*.mdrun_command: 'ask',},});async function main() {const result = await agent.run('Read /inbox/notice.json and /inbox/evidence.txt, propose a concise rule patch in /rules/retry-guard.md, and halt for validation.');console.log('Proposed Rule Revision:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
Build Self-Improving Agents: LangMem Procedural Memory Tutorial
How To Build Self-Improving AI Agents (Full Walkthrough)
How PandaProbe Prevents Bad Rules From Poisoning Future Sessions
PandaProbe (arXiv:2612.05227) is an open-source agent reliability framework that turns execution failures into versioned operating rules without model weight updates. When an evaluation detects a task completion or coherence failure (default threshold $\tau_j = 0.5$), the SDK mounts a sandboxed virtual filesystem containing read-only trace evidence (/inbox/notice.json, /inbox/evidence.txt) and writable rule files (/rules/**/*.md, max 8 KiB each, up to 256 files / 512 KiB).
Critically, the agent cannot approve its own rule edits. Proposed rule patches must clear an independent validation gate—either paired replay against at least 3 distinct historical cases requiring mean improvement $\eta \ge 0.05$ with regression tolerance $\epsilon \le 0.02$, or forward validation monitoring subsequent session flags. Across 4 open-weight models and 4 trials per task:
| Benchmark & Model | Baseline Mean Score | PandaProbe Mean Score | Baseline pass^4 | PandaProbe pass^4 |
|---|---|---|---|---|
| tau2 airline — GPT-OSS 20B | 0.6100 | 0.6375 | 20.00% | 32.00% |
| tau2 airline — Kimi K2.5 | 0.6650 | 0.6750 | 22.00% | 24.00% |
| tau2 airline — Qwen3 32B | 0.5075 | 0.5375 | 2.00% | 6.00% |
| tau2 retail — GPT-OSS 20B | 0.5011 | 0.5461 | 7.02% | 7.89% |
| tau2 retail — Kimi K2.5 | 0.6239 | 0.6601 | 7.89% | 21.05% |
| tau2 retail — Nemotron 120B | 0.6557 | 0.6657 | 14.04% | 14.91% |
| Terminal-Bench (10) — GPT-OSS 20B | 0.2360 | 0.3148 (+33.4%) | — | — |
Operating Budgets, Latency Overhead, and Virtual Reflection Workspace
Reliability gains carry a measurable compute cost: PandaProbe reported 2.81x baseline model spend and a 7.22x median trial latency increase due to reflection checkpoints (60 s deadline, up to 8 shell calls, 12 KiB/call output cap) and validation replays (120 s replay timeout). To bound runtime cost in production, trigger reflection only on high-severity failures and enforce the 60-second cooldown between duplicate failure notices.
# Scaffold a PandaProbe-style rule validation harness check in CI
mkdir -p .pandaprobe/rules .pandaprobe/inbox .pandaprobe/decisions
cat << 'EOF' > .pandaprobe/validate_rule.py
BASELINE_SCORES = [0.40, 0.45, 0.50]
CANDIDATE_SCORES = [0.55, 0.50, 0.60]
mean_gain = sum(c - b for c, b in zip(CANDIDATE_SCORES, BASELINE_SCORES)) / len(BASELINE_SCORES)
max_drop = max(0.0, *(b - c for c, b in zip(CANDIDATE_SCORES, BASELINE_SCORES)))
assert len(BASELINE_SCORES) >= 3 and mean_gain >= 0.05 and max_drop <= 0.02, "Rule rejected"
print(f"Rule APPROVED: mean_gain={mean_gain:.3f}, max_drop={max_drop:.3f}")
EOF
python3 .pandaprobe/validate_rule.pyNever Allow Self-Approved Prompt or Rule Edits
Unvalidated agent self-edits cause prompt bloat and silent regressions on edge cases. Always require >=3 paired validation cases and an explicit regression floor (<=0.02) before publishing rules.
Frequently Asked Questions
Q:How does PandaProbe differ from standard Reflexion or prompt memory?
PandaProbe separates rule authoring from rule approval: the agent writes candidate patches to /rules/**/*.md after inspecting trace evidence, and an independent validator must verify improvement across paired or forward runs before publishing.
Q:What are the default validation thresholds in PandaProbe?
The paper specifies at least 3 distinct paired validation cases, a minimum mean improvement eta of 0.05, a regression tolerance epsilon of 0.02, an 8 KiB rule-file cap, and a 120-second replay deadline.
Q:What is the compute and latency overhead of PandaProbe?
Across the evaluated benchmarks, PandaProbe averaged 2.81x the baseline model spend and a 7.22x median increase in time per trial due to reflection checkpoints and validation.
Q:Which models showed the largest gains with PandaProbe?
Kimi K2.5 pass^4 on tau2-bench retail jumped from 7.89% to 21.05%, GPT-OSS 20B pass^4 on airline rose from 20.0% to 32.0%, and GPT-OSS 20B mean score on Terminal-Bench increased 33.4% relative (0.2360 to 0.3148).
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.