Skip to main content

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.

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    # 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

MIT © Chirpz AI

Project details


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.6.3.tar.gz (377.7 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.6.3-py3-none-any.whl (114.5 kB view details)

Uploaded Python 3

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

Hashes for pandaprobe_harness-0.6.3.tar.gz
Algorithm Hash digest
SHA256 95d747f762e89b74dcc3a0d71a7c5bc9f40f0208119f2e8d13c6a6979e8a9d5e
MD5 345311d4e434f2aada120ed2ed74e42d
BLAKE2b-256 c050e5042f5ee11398750f988a40a29f5e98913df292f5fddcb2df9f2a63c284

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandaprobe_harness-0.6.3.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.6.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pandaprobe_harness-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9d6f031cd6c654bbb8f870094f57424ccf1cb34d7e96c89a6622e9ed54a859f9
MD5 ea68017615df282da2dba9d84f20639e
BLAKE2b-256 0ef6bc2e1a409b9b5696a9201548dddfcc1eb359550cc16316715d4ef6f5ba7d

See more details on using hashes here.

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

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page