Meta-cognitive diagnostic sandbox harness for PandaProbe-instrumented agents.
Project description
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.
📚 Documentation · 📦 PyPI · 💬 Discussions
How it works
- 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. - Notice — breaches and declining trends post a structured diagnostic notice to a workspace mailbox. Nothing is ever injected into the agent's conversation.
- 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.
- 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 # rules + protocol + banner
specs, dispatch = as_anthropic_tools(harness.toolset) # the 14 self-diagnostic tools
tools = my_tools + specs
async def one_turn(session_id: str, user_input: str) -> str:
async with harness.turn(session_id): # evaluates on exit
return await my_agent_step(system_prompt, tools, user_input)
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. |
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pandaprobe_harness-0.6.3.tar.gz.
File metadata
- Download URL: pandaprobe_harness-0.6.3.tar.gz
- Upload date:
- Size: 377.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95d747f762e89b74dcc3a0d71a7c5bc9f40f0208119f2e8d13c6a6979e8a9d5e
|
|
| MD5 |
345311d4e434f2aada120ed2ed74e42d
|
|
| BLAKE2b-256 |
c050e5042f5ee11398750f988a40a29f5e98913df292f5fddcb2df9f2a63c284
|
Provenance
The following attestation bundles were made for pandaprobe_harness-0.6.3.tar.gz:
Publisher:
release.yml on chirpz-ai/pandaprobe-harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pandaprobe_harness-0.6.3.tar.gz -
Subject digest:
95d747f762e89b74dcc3a0d71a7c5bc9f40f0208119f2e8d13c6a6979e8a9d5e - Sigstore transparency entry: 2083138789
- Sigstore integration time:
-
Permalink:
chirpz-ai/pandaprobe-harness@edf70ee582c802271a050690c74b418b32ddb3d0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chirpz-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@edf70ee582c802271a050690c74b418b32ddb3d0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pandaprobe_harness-0.6.3-py3-none-any.whl.
File metadata
- Download URL: pandaprobe_harness-0.6.3-py3-none-any.whl
- Upload date:
- Size: 114.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d6f031cd6c654bbb8f870094f57424ccf1cb34d7e96c89a6622e9ed54a859f9
|
|
| MD5 |
ea68017615df282da2dba9d84f20639e
|
|
| BLAKE2b-256 |
0ef6bc2e1a409b9b5696a9201548dddfcc1eb359550cc16316715d4ef6f5ba7d
|
Provenance
The following attestation bundles were made for pandaprobe_harness-0.6.3-py3-none-any.whl:
Publisher:
release.yml on chirpz-ai/pandaprobe-harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pandaprobe_harness-0.6.3-py3-none-any.whl -
Subject digest:
9d6f031cd6c654bbb8f870094f57424ccf1cb34d7e96c89a6622e9ed54a859f9 - Sigstore transparency entry: 2083138837
- Sigstore integration time:
-
Permalink:
chirpz-ai/pandaprobe-harness@edf70ee582c802271a050690c74b418b32ddb3d0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chirpz-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@edf70ee582c802271a050690c74b418b32ddb3d0 -
Trigger Event:
push
-
Statement type: