Skip to main content

PIC Standard: Provenance & Intent Contracts for agentic side-effect governance

Project description

PIC Standard: Provenance & Intent Contracts

The Open Protocol for Causal Governance in Agentic AI.

PIC closes the causal gap: when untrusted inputs (prompt injection, user text, web pages) influence high‑impact side effects (payments, exports, infra changes), PIC forces a machine‑verifiable contract between what the agent claims and what evidence actually backs it.

License Status


Quickstart

# Install core (schema + verifier + CLI)
pip install pic-standard

# Verify an example proposal
pic-cli verify examples/financial_irreversible.json
# ✅ Schema valid
# ✅ Verifier passed

Optional extras:

pip install "pic-standard[langgraph]"  # LangGraph integration
pip install "pic-standard[mcp]"        # MCP integration
pip install "pic-standard[crypto]"     # Signature evidence (Ed25519)

From source (contributors):

git clone https://github.com/madeinplutofabio/pic-standard.git
cd pic-standard && pip install -e .
pytest -q  # run tests

The PIC Contract

PIC uses an Action Proposal JSON (protocol: PIC/1.0). The agent emits it right before executing a tool:

Field Purpose
intent What the agent is trying to do
impact Risk class (money, privacy, irreversible, …)
provenance Which inputs influenced the decision (and their trust level)
claims + evidence What the agent asserts and which evidence IDs support it
action The actual tool call being attempted (tool binding)

Verifier rule: For high‑impact proposals (money, privacy, irreversible), at least one claim must reference evidence from TRUSTED provenance. Fail‑closed.


Evidence Verification

PIC supports deterministic evidence verification that upgrades provenance trust in-memory.

Version Type Description
v0.3 hash SHA-256 verification of file artifacts (file://...)
v0.4 sig Ed25519 signature verification via trusted keyring
# Verify hash evidence
pic-cli evidence-verify examples/financial_hash_ok.json

# Verify signature evidence
pic-cli evidence-verify examples/financial_sig_ok.json

# Full pipeline: schema → evidence → verifier
pic-cli verify examples/financial_hash_ok.json --verify-evidence

📖 Full guide: docs/evidence.md


Keyring (Trusted Signers)

Signature evidence requires a keyring of trusted public keys.

# Inspect current keyring
pic-cli keys

# Generate starter keyring
pic-cli keys --write-example > pic_keys.json

PIC loads keys from PIC_KEYS_PATH env var, or ./pic_keys.json, or empty (no signers).

📖 Full guide: docs/keyring.md — key formats, expiry, revocation, rotation


Integrations

LangGraph

Enforce PIC at the tool boundary with PICToolNode:

pip install "pic-standard[langgraph]"
python examples/langgraph_pic_toolnode_demo.py
  • Requires __pic proposal in each tool call
  • Validates schema + verifier + tool binding
  • Returns ToolMessage outputs

MCP (Model Context Protocol)

Enforce PIC at the MCP tool boundary with production defaults:

pip install "pic-standard[mcp]"
python -u examples/mcp_pic_client_demo.py
  • Fail‑closed (blocks on verifier/evidence failure)
  • Debug gating (PIC_DEBUG=1 for diagnostics)
  • Request tracing, DoS limits, evidence sandboxing

OpenClaw

Plugin for OpenClaw AI agents via the hook API:

# 1. Start the PIC bridge
pip install pic-standard
pic-cli serve --port 7580

# 2. Build and install the plugin
cd integrations/openclaw
npm install && npm run build
openclaw plugins install .
# Or manually: cp -r . ~/.openclaw/extensions/pic-guard/
  • pic-gate — verifies proposals before tool execution
  • pic-init — injects PIC awareness at session start
  • pic-audit — structured audit logging

📖 Full guide: docs/openclaw-integration.md


How It Works

graph TD
    A[Untrusted Input] --> B{AI Agent / Planner}
    C[Trusted Data/DB] --> B
    B --> D[Action Proposal JSON]
    D --> E[PIC Verifier Middleware]
    E --> F{Valid Contract?}
    F -- Yes --> G[Tool Executor]
    F -- No --> H[Blocked / Alert Log]

Why PIC?

Guardrails constrain what the model says. PIC constrains what the agent is allowed to do (side effects) based on verifiable provenance + evidence.


Versioning

  • PIC/1.0 — the proposal protocol (schema)
  • Python package follows Semantic Versioning

Roadmap

  • [✅] Phase 1: Standardize money and privacy Impact Classes
  • [✅] Phase 2: Reference Python verifier + CLI
  • [✅] Phase 3: Anchor integrations (LangGraph + MCP)
  • [✅] Phase 4: Evidence verification (hash + signature)
  • [✅] Phase 5: OpenClaw integration
  • [⬜] Phase 6: Additional SDKs (TypeScript) + case studies + audit

Community

We're actively seeking:

  • Security researchers to stress‑test causal logic
  • Framework authors to build native integrations
  • Enterprise architects to define domain Impact Classes

Maintained by Linkedin @fmsalvadori   GitHub MadeInPluto

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

pic_standard-0.5.3.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

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

pic_standard-0.5.3-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file pic_standard-0.5.3.tar.gz.

File metadata

  • Download URL: pic_standard-0.5.3.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for pic_standard-0.5.3.tar.gz
Algorithm Hash digest
SHA256 feb679e0049cfc68bea0ef83b726732d6d22473697259da5d6e3608f547aee0e
MD5 0d8eadca14cc830ae0e3f0e42700691f
BLAKE2b-256 7ef0993e80980f96f72e61c039315e9fd8521b60a63a2d5445a3675c3e192177

See more details on using hashes here.

File details

Details for the file pic_standard-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: pic_standard-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 38.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for pic_standard-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32e5ee2c8158f12fc884ed79955c7c96389ee25971b02dc65f674dd45bd63ba9
MD5 c250ad9e88c9d5c9ffef51b6ff1cb608
BLAKE2b-256 564b8214d3b62e852ca198f2585680c5c8defbe39e4c8179f24c0053baccbb5f

See more details on using hashes here.

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