cd /news/ai-agents/orp-turn-ai-agent-failures-into-regr… · home topics ai-agents article
[ARTICLE · art-24520] src=github.com pub= topic=ai-agents verified=true sentiment=↑ positive

ORP – Turn AI agent failures into regression tests and tested lessons

ORP, an open experience layer for AI agents built on OpenTelemetry, converts agent failures into regression tests and retrievable lessons. The tool captures agent traces, challenges unproven claims, and compiles executable artifacts including lessons, evals, and guardrails to prevent repeat failures. In testing, ORP improved task success rates from 14% to 100% and eliminated repeat failures across 100 runs.

read4 min publishedJun 11, 2026

Turn agent failures into regression tests, reusable lessons, and measurable improvements.

Tracing tells you what your agent did. ORP turns what happened into a tested lesson.

A coding agent fixes an auth bug but misses the anonymous user path. Tests fail at 34/35.

orp wrap -- python my_agent.py

orp learn latest

orp mcp-server

orp diff exp_before exp_after

Before:

Task success:  FAILED   (34/35 tests)
Claims:        1 unproven

After:

Task success:  PASSED   (35/35 tests)
Claims:        0 unproven

That's the loop. One mistake, one lesson, one measurable improvement.

ORP is an open experience layer for AI agents, built on OpenTelemetry. It converts agent traces into three executable artifacts:

Artifact What Example
Lesson
Retrievable, scope-scoped experience "Test anonymous, authenticated, and forbidden paths"
Eval
Regression test reproducing the failure pytest tests/test_anonymous_access.py
Guardrail
Preventative rule "Before modifying auth, run full test suite"

Each Lesson goes through a lifecycle:

candidate -> active -> under_review -> deprecated -> rejected
               |
         (only active lessons
          are retrievable)

Evidence-first: ORP distinguishes observed facts (tool output, test results) from agent claims (diagnoses, confidence statements). Claims are never automatically treated as ground truth.Executable experience: Lessons compile to runnable evals and guardrails, not just text.** Outcome-based value**: Lesson quality is determined by whether it actually improves results, measured through effect evaluation.** Built on OpenTelemetry**: ORP extends existing trace infrastructure instead of replacing it.** Default private**: All data stays local, de-identified by default, no prompt/tool output uploaded.

pip install open-reflection-protocol

Requires Python 3.10+.

orp wrap -- python my_agent.py --run-task

ORP automatically captures stdout, exit codes, test results, git diff, and OpenTelemetry spans.

orp learn latest

This generates:

  • A diagnosis of what went wrong Challenged claims(unsupported agent statements)- A Lesson candidate - A regression Eval
orp inspect latest
orp report --open          # HTML report
orp diff exp_before exp_after
orp mcp-server --transport stdio

git clone https://github.com/Fujo930/ORP
cd ORP
uv run python demo/orp_demo.py

Output:

Run 1: Agent misses anonymous user path -> FAILED
ORP analyzes the failure -> challenges 1 unproven claim
ORP compiles Lesson + Eval
MCP delivers Lesson to Agent
Run 2: Agent applies Lesson -> PASSED

Before: 34/35 tests, 1 unproven claim
After:  35/35 tests, 0 unproven claims
Estimated effect: 0.5

10 failure tasks, 5 trials each, 100 total runs.

Metric Control (no ORP) +ORP Improvement
Task success rate 14% 100% +86%
Repeat failure rate high 0% 100% reduction
Lesson application 100%
Eval validity 85%
Go/No-Go: >>> GO — 4/4 checks passed

Run yourself: uv run python exps/runner.py

orp wrap -- python agent.py    Wrap an agent process with ORP
orp inspect [id]               Inspect an experience (default: latest)
orp learn [id]                 Generate lessons from an experience
orp replay <id>                Counterfactual replay
orp lessons list               List lessons
orp lessons validate <id>      Validate lesson integrity
orp lessons conflicts          Auto-detect conflicting lessons
orp lessons rollback <id>      Rollback a lesson
orp lessons deliver <id>       Deliver a lesson
orp effects evaluate <id>      Evaluate lesson effect
orp training candidates        List training candidates
orp training export            Export approved training data
orp mcp-server                 Start MCP lesson server
orp report --open              Generate HTML report
orp diff <id1> <id2>           Compare two experiences
orp export [id]                Export as JSON
Agent / Existing Trace
        |
        v
  Trace Adapters (OTel / OpenAI / LangGraph / Generic JSON)
        |
        v
 Experience Builder -> Evidence Verifier
                    -> Reflection Analyzer  (diagnosis + challenger)
                    -> Counterfactual Replayer
        |
        v
 Experience Compiler
   +----+----+------+
   |         |      |
 Lesson    Eval   Guardrail
   |         |      |
   +---- Delivery Router (MCP Server / Prompt / Policy / Runtime Hook)
             |
             v
    Effect Evaluator + Rollback

Tests (58 total):

uv run pytest -q

Key design documents in this repo:

File What
ROADMAP.md
Project roadmap and strategy
SPEC.md
Protocol specification v0.3
ARCHITECTURE.md
Implementation architecture
demo/orp_demo.py
Standalone demo

MIT

── more in #ai-agents 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/orp-turn-ai-agent-fa…] indexed:0 read:4min 2026-06-11 ·