Skip to main content

OCC cryptographic proof signing for the OpenAI Agents SDK

Project description

occ-openai-agents

OCC cryptographic proof signing for the OpenAI Agents SDK.

Every tool call produces an Ed25519-signed proof entry in proof.jsonl, creating a tamper-evident audit log of agent actions.

Install

pip install occ-openai-agents

Quick Start

Decorator

from agents import Agent, function_tool, Runner
from occ_openai_agents import occ_tool

@occ_tool
@function_tool
def search(query: str) -> str:
    """Search the web."""
    return f"Results for: {query}"

agent = Agent(name="my-agent", tools=[search])
result = Runner.run_sync(agent, "Search for OCC proofs")

Wrap All Tools

from occ_openai_agents import wrap_agent_tools

agent = Agent(
    name="my-agent",
    tools=wrap_agent_tools([search, calculator]),
)

Hook Class

from occ_openai_agents import OccToolHook, OCCSigner

signer = OCCSigner(state_dir=".occ", proof_file="audit.jsonl")
hook = OccToolHook(signer=signer)

agent = Agent(
    name="my-agent",
    tools=hook.wrap_tools([search, calculator]),
)

Proof Format

Each line in proof.jsonl is a JSON object:

{
  "version": "occ/proof/1",
  "timestamp": "2026-03-20T12:00:00.000Z",
  "signer": "<base64url-ed25519-public-key>",
  "payload": {
    "type": "tool-call",
    "tool": "search",
    "inputHash": "<sha256-hex>",
    "outputHash": "<sha256-hex>"
  },
  "signature": "<base64url-ed25519-signature>",
  "prev": "<sha256-hex-of-previous-proof>"
}

Proofs are chained: each proof's prev field contains the SHA-256 hash of the previous proof's canonical JSON.

Configuration

  • State directory: Keypair stored in .occ/signer-state.json (defaults to CWD)
  • Proof file: Defaults to proof.jsonl in CWD
  • Both configurable via OCCSigner(state_dir=..., proof_file=...)

License

Apache-2.0

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

occ_openai_agents-0.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

occ_openai_agents-0.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file occ_openai_agents-0.2.0.tar.gz.

File metadata

  • Download URL: occ_openai_agents-0.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for occ_openai_agents-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8df4a3e38ec207bba18e96d279804cc777393475b94e098cc5a617ff83953c79
MD5 bbf3f4c7f4c2ea4520540231d4c0e7cc
BLAKE2b-256 5c48e9848ea67f6d1340b3aea9e5c3c322b9a0f746ef096dd09038ca50ee48da

See more details on using hashes here.

File details

Details for the file occ_openai_agents-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for occ_openai_agents-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32e5c45314a67e48a3a997bff198c3c2ddda309d872e22d54318cb4e0e0524d8
MD5 5c6501173c665f2b7e394a235266c975
BLAKE2b-256 4c7d2670fc2ced900371d219c4703240dc24120d1a9642cfad83c8e0baebe4cd

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