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.1.0.tar.gz (4.8 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.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: occ_openai_agents-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 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.1.0.tar.gz
Algorithm Hash digest
SHA256 a009c920569d7258c6f0b6bcffdee367052938207980c4f46617e5cc178cdbf6
MD5 1cae16fd0a1407f1835b8b657f04fe20
BLAKE2b-256 350df5ee3fa3f8dc67daa4dd4ce24329d41307bcf668e1e83119babd6734299e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for occ_openai_agents-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41def98ce016879e95ab76e757f83b652b8e487f3a1669386efad51ded4d88d6
MD5 1ada51d4b90709c784c86d5a55605f7f
BLAKE2b-256 6b3507b41e4067b723842b80d256621b0c716129c9d0c84c2c853c0ba6f9b428

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