Deterministic semantic contracts, receipts, and flight-recorder traces for autonomous agents.
Project direction is anchored in docs/product-framing.md. Current implementation priorities are tracked in docs/implementation-roadmap.md.
A2A lets agents talk. MCP lets agents use tools. Telemetry records what services did. Agent Pidgin focuses on a different layer: what an agent action means, whether that meaning is allowed, how it changed, and what receipts prove the resolution path.
Agent Pidgin is not an execution engine, A2A clone, MCP clone, or generic observability product. It sits beside those layers as the meaning and provenance layer: semantic pointers, versioned catalogs, policy checks, semantic diffs, receipts, and hash-chained flight-recorder traces.
Useful docs:
- Wow landing page
- Non-technical assessment
- What Agent Pidgin does now
- Autonomous Agent Flight Recorder
- Why this is not telemetry
- Why this is not just an auditor agent
- Blog: Catching an Agent Before It Sends the Wrong Email
- OpenClaw-class agent strategy
- Architecture
- JSON schemas for resolve messages, handshakes, catalogs, receipts, and AAFR traces.
- Trusted catalog loading for core, clinical-safety, and agent-ops semantic pointers.
- Deterministic policy enforcement for pinned revisions, artifact kinds, raw-execution denial, and sensitive pointer receipts.
- Semantic diffing that flags removed safety primitives, removed control guardrails, artifact drift, and implementation changes.
- Resolution receipts with pointer, type signature, catalog ID/version/hash, implementation hash, artifact revision, resolver version, timestamp, and receipt ID.
- CLI commands for validation, policy checks, resolution, catalog introspection, hashing, semantic diffing, and LLM-assisted authoring/review.
- MCP-style receiver tools and A2A JSON wrapper examples.
- Autonomous Agent Flight Recorder support for goals, memory updates, proposed tool calls, semantic drift, policy decisions, full resolution receipts, and hash-chained traces.
- Dependency-free HTTP sidecar for local preflight gates before skill install, memory update, tool call, and trace rendering.
- Catalog trust helpers for trusted catalog IDs, key revocation, pinned hashes, and HMAC-SHA256 signature verification.
- Reproducible showpiece demos and automated tests.
- Deterministic supplement-coach domain-boundary benchmark with status accuracy, autonomy-tier accuracy, and unsafe-prompt catch-rate metrics.
Use Agent Pidgin when an agent is about to do something important and a log line is not enough.
A normal service trace can tell you that an agent proposed email.send_customer. Agent Pidgin can tell you whether that proposal was represented by a schema-valid contract, which semantic guardrails were present, whether any were removed since the last safe plan, whether the artifact revision was pinned, which catalog defined each pointer, and which receipts prove the resolution.
That matters for agent systems because bugs are no longer only exceptions and latency spikes. They can be subtle changes in intent: a memory update weakens a boundary, a tool proposal drops human review, a contract switches from a pinned revision to main, or a model says "everything is fine" while the semantic contract says safety steps disappeared.
Telemetry is still useful. Agent Pidgin is not trying to replace OpenTelemetry-style spans, logs, metrics, or traces.
The distinction:
| Telemetry | Agent Pidgin |
|---|---|
| Records what happened in services | Checks what an agent action means before or around execution |
| Tracks spans, logs, metrics, errors, latency | Tracks semantic contracts, policy findings, diffs, catalog resolution, receipts |
| Accepts event names as labels | Resolves meaning from trusted catalogs |
| Helps debug runtime behavior | Helps audit agent intent and semantic drift |
| Usually after-the-fact observation | Can block high-risk proposed actions before tools run |
The intended architecture is complementary: Pidgin can emit or feed telemetry, but its job is deterministic semantic verification.
A prompted auditor agent gives a model opinion. Agent Pidgin gives a reproducible verdict with provenance.
LLMs may help author, explain, or review contracts. They do not define pointer truth. The trust-critical path is deterministic: schema validation, policy enforcement, catalog lookup, hashing, semantic diffing, receipt generation, and trace-integrity checks.
The project includes structured service logging:
- Enable Debug Logs: Set
VERBOSE=1in your environment or use the--verboseflag with CLI commands to see detailed debug output onstderr. - Timing: Each resolution request logs duration in milliseconds (
duration_ms) for basic performance monitoring. - Safety: All sensitive fields (like
HF_TOKEN) are sanitized and never appear in the logs.
For maximum security, the project supports three ways to handle Hugging Face tokens:
- Environment Variable: Set
HF_TOKENin your.envfile for automated environments. - System Login: If
HF_TOKENis not set,hf-mountwill automatically attempt to use the token stored byhuggingface-cli login. - Implicit: For public repositories, no token is required.
python3 -m unittest discover -s tests -vCI also runs coverage and currently fails under 85% line coverage.
These tests use the real FastMCP stdio path and hf-mount, so they are skipped by default unless explicitly enabled.
AGENT_PIDGIN_RUN_STDIO_INTEGRATION=1 \
AGENT_PIDGIN_DATA_REPO=openai-community/gpt2 \
AGENT_PIDGIN_DATA_REVISION=main \
AGENT_PIDGIN_ARTIFACT_REPO=openai-community/gpt2 \
AGENT_PIDGIN_ARTIFACT_REVISION=main \
AGENT_PIDGIN_MOUNT_ROOT=/tmp/agent-pidgin \
.venv/bin/python -m unittest tests.test_stdio_integration -vThe live integration coverage verifies both:
- a real stdio handshake plus resolve round-trip
- payload
artifactprecedence over conflicting legacydataset_*fields
PYTHONPATH=src python3 -m agent_pidgin.cliThe CLI now supports schema validation, catalog validation, policy checks, resolution, catalog hashing, and semantic diffs.
agent-pidgin validate-message examples/contracts/sample_message.json --json
agent-pidgin validate-catalog catalogs/core.json --json
agent-pidgin list-catalog --json
agent-pidgin show-pointer clinical.phi.scrub --json
agent-pidgin hash-catalog catalogs/core.json --json
AGENT_PIDGIN_CATALOG_HMAC_SECRET="dev-only-example-secret-do-not-use-in-production" \
agent-pidgin sign-catalog-hmac catalogs/core.json \
--key-id key-agent-pidgeon-labs-2026-001 \
--out /tmp/core.signed.json \
--json
agent-pidgin verify-catalog-trust /tmp/core.signed.json \
--trust-root examples/openclaw_class/catalog_trust_root.json \
--json
agent-pidgin list-catalog \
--catalog /tmp/core.signed.json \
--catalog-trust-root examples/openclaw_class/catalog_trust_root.json \
--json
agent-pidgin policy-check examples/contracts/sample_message.json --json
agent-pidgin resolve examples/contracts/sample_message.json --json
agent-pidgin resolve examples/contracts/sample_message.json --gateway hf --json
agent-pidgin diff examples/contracts/sample_diff.json --jsonresolve uses the default policy unless --no-policy is passed. The default policy rejects unpinned revisions such as main, so production-style examples should use a pinned 40-character commit SHA.
By default, resolve uses the explicit simulated gateway for deterministic preflight. Pass --gateway hf to use hf-mount; pass --gateway auto only when local environments should select hf-mount if the configured binary exists.
Optional LLM-assisted authoring is available through OpenRouter:
export OPENROUTER_API_KEY="..."
export OPENROUTER_MODEL="qwen/qwen3.6-flash"
agent-pidgin author-contract examples/llm_authoring/plain_language_request.txt \
--artifact-repo waynesatz/agent-pidgin-data \
--artifact-revision aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
--jsonLLM-assisted commands draft, explain, or review contracts. They do not define pointer truth and do not bypass schema validation.
OpenClaw-class sidecar preflight commands are available for local gateways and skill-driven agents:
agent-pidgin preflight-tool examples/agent_flight_recorder_demo/corrupted_tool_contract.json \
--previous-contract examples/agent_flight_recorder_demo/safe_tool_contract.json \
--tool-name email.send_customer \
--json
agent-pidgin record-memory-update examples/openclaw_class/memory_drift_payload.json --json
agent-pidgin verify-skill examples/openclaw_class/dangerous_skill_manifest.json --json
agent-pidgin verify-skill examples/openclaw_class/dangerous_skill_manifest.json \
--trust-root examples/openclaw_class/trust_root.json \
--jsonpreflight-tool and record-memory-update return non-zero when a proposed action is blocked. verify-skill returns non-zero for blocked skill manifests.
--trust-root adds publisher, signing-key, and revocation checks to skill verification.
Run the end-to-end OpenClaw-class sidecar showpiece:
PYTHONPATH=src python3 examples/openclaw_class/run_openclaw_showpiece.py --out-dir /tmp/pidgeon-openclawThat writes a trace JSON file, a text replay, and a static HTML replay report with integrity status, grouped findings, receipt drilldown, and before/after drift panels. You can also export the same trace as OTLP-style JSON for telemetry ingestion:
agent-pidgin render-trace /tmp/pidgeon-openclaw/openclaw_trace.json \
--html-out /tmp/pidgeon-openclaw/openclaw_trace.html \
--otel-out /tmp/pidgeon-openclaw/openclaw_trace.otel.jsonRun the offline OpenClaw-class gateway adapter:
PYTHONPATH=src python3 examples/openclaw_gateway_adapter/run_adapter.py --jsonRun the local HTTP preflight sidecar:
PYTHONPATH=src python3 -m agent_pidgin.http_sidecar --host 127.0.0.1 --port 8765Then point the gateway adapter at it:
PYTHONPATH=src python3 examples/openclaw_gateway_adapter/run_adapter.py \
--mode http \
--sidecar-url http://127.0.0.1:8765 \
--jsonRun the showpiece regression check used by CI:
PYTHONPATH=src python3 scripts/check_openclaw_showpiece.pyRun the supplement-coach domain-boundary benchmark:
PYTHONPATH=src python3 scripts/check_supplement_guard_benchmark.pyRun a reusable domain-boundary policy benchmark:
agent-pidgin benchmark-domain-policy \
examples/supplement_coach/domain_policy.json \
examples/supplement_coach/benchmark_cases.jsonl \
--jsonPreflight one prompt:
agent-pidgin guard-prompt /tmp/prompt.txt \
--domain-policy examples/supplement_coach/domain_policy.json \
--trace-out /tmp/prompt-boundary-trace.json \
--jsonThe showpiece demonstrates the intended product shape end to end: plain-language authoring, schema validation, policy findings, trusted catalog resolution, semantic diff risk review, and receipts.
PYTHONPATH=src python3 examples/showpiece_demo/run_showpiece.py --jsonOptional live LLM-assisted authoring uses OpenRouter:
export OPENROUTER_API_KEY="..."
export OPENROUTER_MODEL="qwen/qwen3.6-flash"
PYTHONPATH=src python3 examples/showpiece_demo/run_showpiece.py --live-llm --jsonThe demo intentionally returns an auditable implementation plan. It does not execute the resolved implementation strings.
AAFR is the bigger showpiece direction: a replayable semantic audit layer for autonomous agent goals, memory/context updates, proposed tool calls, policy decisions, semantic drift, and receipts.
PYTHONPATH=src python3 examples/agent_flight_recorder_demo/run_flight_recorder.pyFull JSON trace:
PYTHONPATH=src python3 examples/agent_flight_recorder_demo/run_flight_recorder.py --jsonThis demo shows a safe agent goal, a corrupted context update, and a later unsafe tool proposal. Pidgeon blocks the unsafe proposal and preserves the trace for replay.
The flight recorder trace is hash-chained. The demo also detects unapproved memory guardrail weakening, high-risk semantic drift, removed control guardrails, and unpinned artifact revisions.
Render a saved trace:
agent-pidgin render-trace trace.json --html-out trace.html --otel-out trace.otel.jsonThis launches the MCP receiver over stdio, performs a Pidgin handshake, then sends a resolve message through the real MCP client path.
PYTHONPATH=src python3 scripts/poc_stdio_send.pyCopy .env.example to your local environment setup, then run:
PYTHONPATH=src python3 scripts/poc_real_mount.pyYou can override the target artifact with environment variables such as:
export AGENT_PIDGIN_DATA_REPO=openai-community/gpt2
export AGENT_PIDGIN_DATA_REVISION=main
export AGENT_PIDGIN_ARTIFACT_REPO=openai-community/gpt2
export AGENT_PIDGIN_ARTIFACT_REVISION=mainThis requires fastmcp to be installed in your project environment.
PYTHONPATH=src python3 -m agent_pidgin.receiver_climessage_type=handshakerequests receiver capabilities and artifact defaultsmessage_type=resolverequests pointer resolution- resolve payloads may include an
artifactobject withkind,repo, andrevision - schema-validated resolve payloads require
pidgin_version,message_type,artifact, and non-emptysteps - legacy
dataset_repo/dataset_revisionfields may still be included as compatibility metadata, but theartifactobject is authoritative - AAFR trace payloads are validated with
schemas/pidgin-trace.schema.jsonand include hash-chained events
Agent A
|
| Pidgin semantic contract
v
A2A/MCP transport
|
v
Agent Pidgin Receiver
|
| validate schema
| enforce policy
| mount artifact
| resolve pointers
v
Receipts + resolved implementation plan