Skip to main content

PandaProbe Harness

Self-healing for AI agents. The harness wraps any PandaProbe-instrumented agent in an operational envelope that evaluates every turn, alerts the agent when quality degrades, and lets it diagnose its own failures and write — and prove — its own operating rules. Fully automatic, no human in the healing loop.

PyPI CI Python License

📚 Documentation · 📦 PyPI · 💬 Discussions

How it works

  1. Evaluate — after each turn, the harness scores the session on the PandaProbe platform (agent_reliability, agent_consistency) in a detached task that never blocks your agent.
  2. Notice — breaches and declining trends post a structured diagnostic notice to a workspace mailbox. Nothing is ever injected into the agent's conversation.
  3. Heal — guided by a standing protocol in its system prompt, the agent pulls the notice, inspects its own flagged traces, and records a mitigation rule.
  4. Validate — the rule enters as a candidate: the harness replays the captured failure (or watches the next live sessions) and promotes it only when it demonstrably helps. Validated rules re-enter the prompt on every future run; a replayable eval-set guards old wins against regressions.

The core has zero runtime dependencies and reaches the platform exclusively through the pandaprobe CLI.

Installation

pip install pandaprobe-harness
# framework adapters are optional extras:
pip install "pandaprobe-harness[langgraph]"     # [langchain] [deepagents] [crewai]
                                                # [claude-agent-sdk] [openai-agents] [all]

You'll also need the pandaprobe CLI installed and authenticated, and an agent traced with the PandaProbe SDK.

Quickstart

from pandaprobe_harness import Harness
from pandaprobe_harness.agent_tools.native import as_anthropic_tools

harness = Harness.create()                              # provisions the workspace

system_prompt = harness.system_context() + MY_PROMPT    # protocol + references + banner
specs, dispatch = as_anthropic_tools(harness.toolset)   # the self-diagnostic tools
tools = my_tools + specs

async def one_turn(session_id: str, user_input: str) -> str:
    # `settle=True` waits for this turn's evaluation and any notice before
    # returning, so a rule learned now is in force for the next turn.
    async with harness.turn(session_id, settle=True):
        return await my_agent_step(system_prompt, tools, user_input)

The system context carries the protocol, the tool list, and an index of the agent's rule files — never the rule bodies. The agent pulls those on demand with harness_rules_read, so the workspace stays its own.

Using a framework? Harness.for_langgraph(), for_langchain(), for_deepagents(), for_crewai(), for_claude_agent_sdk(), and for_openai_agents() wire turn detection for you.

➡ Full guides, concepts, and the configuration reference live in the documentation.

Try it offline

The examples/ directory ships fully-offline, credential-free demos:

make example                                        # the pull loop, end to end
uv run python examples/closed_loop_self_heal.py     # candidate → validate → promote → regression
uv run python examples/calibration_demo.py          # threshold calibration

Operator CLIs

Command Purpose
pandaprobe-harness-agent The agent-facing toolset for sandboxed shells.
pandaprobe-harness-eval Replay the eval-set against the current rules — the regression guard.
pandaprobe-harness-calibrate Measure and tune the breach thresholds, with or without labels.

Benchmarks

An A/B study measuring the harness's effect on agent reliability across AppWorld, Terminal-Bench (via Harbor), and τ²-bench lives in benchmarks/ — a self-contained uv project that installs the released harness from PyPI. Run it from the repo root with make bench-setup, make bench-smoke, and make bench-report (see benchmarks/README.md).

Development

make install         # uv sync
make test            # full offline suite — no network, no real CLI
make lint typecheck  # ruff + mypy --strict

See CONTRIBUTING.md for the project invariants and PR process, and CHANGELOG.md for release history.

License

MIT © Chirpz AI

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandaprobe_harness-0.7.0.tar.gz (701.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandaprobe_harness-0.7.0-py3-none-any.whl (135.7 kB view details)

Uploaded Python 3

File details

Details for the file pandaprobe_harness-0.7.0.tar.gz.

File metadata

  • Download URL: pandaprobe_harness-0.7.0.tar.gz
  • Upload date:
  • Size: 701.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pandaprobe_harness-0.7.0.tar.gz
Algorithm Hash digest
SHA256 1c4eeed9c9e0b1b025a92662e4d76e6bddefda9f0b1405a8429f7311386b5385
MD5 80fa26a7922cc3ac857285a03b748058
BLAKE2b-256 1239ac708388dccef673a62da8cfaaf57022da7099afad966e547556ba3d53e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandaprobe_harness-0.7.0.tar.gz:

Publisher: release.yml on chirpz-ai/pandaprobe-harness

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pandaprobe_harness-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pandaprobe_harness-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d2ebad50723c471e64fec337916c86278cd43b3c968d96d2280e0c59dd15aa7
MD5 29654831b07e6eaccb6921895c9b342b
BLAKE2b-256 7b0d6741422cf24265c8ba6f9405ed9b4afaa4e89f0556b3179ed64fb46ca7fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandaprobe_harness-0.7.0-py3-none-any.whl:

Publisher: release.yml on chirpz-ai/pandaprobe-harness

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.0

2 files

This release

0.7.0 This release

2 files

0.6.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page