Skip to main content

occ-autogen

OCC cryptographic proof signing for AutoGen.

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

Quick Start

Decorate Individual Tools

from occ_autogen import occ_tool

@occ_tool
def get_weather(location: str) -> str:
    return f"Sunny in {location}"

# Register in AutoGen:
assistant.register_function(
    function_map={"get_weather": get_weather}
)

Tool Hook (wrap a function map)

from occ_autogen import OccToolHook

hook = OccToolHook()
function_map = {
    "get_weather": get_weather,
    "search": search,
}
signed_map = hook.wrap_function_map(function_map)
user_proxy.register_function(function_map=signed_map)

Wrap All Functions

from occ_autogen import wrap_functions

# From a list:
signed_map = wrap_functions([get_weather, search])

# From a dict:
signed_map = wrap_functions({"get_weather": get_weather})

user_proxy.register_function(function_map=signed_map)

Custom Signer

from occ_autogen import OCCSigner, OccToolHook

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

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": "get_weather",
    "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

Metadata

Release files for occ-autogen 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for occ-autogen 0.2.0
File Size Uploaded
occ_autogen-0.2.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for occ-autogen 0.2.0
File Interpreter ABI Platform
occ_autogen-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / occ_autogen-0.2.0.tar.gz

Download URL occ_autogen-0.2.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
95706deaa153f3240a8ba4a0aad63f98997b08f42d0bcb04302cf22da7a58def
BLAKE2b-256 checksum
How to use checksums
8b7ad391f82a31190748dbd299cdc53cad1449627c4e40ea2469fe03fe15bf2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / occ_autogen-0.2.0-py3-none-any.whl

Download URL occ_autogen-0.2.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d76bf8ef4f00824eec1d012e34ad7030013067a7b656ea04e1bcac5a9ae01ebb
BLAKE2b-256 checksum
How to use checksums
b70839e86b4b60a198128ff9a9c4e57bb17817ad60809b70d9b90f244d0e6f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page