Skip to main content

OCC cryptographic proof signing for AutoGen

Project description

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

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_autogen-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

occ_autogen-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for occ_autogen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92d10986473f13af4f9a661117f15546b09662158d48b03ddecedebc228c8b58
MD5 71efe528dc9583a4c564b16f69ee0bf4
BLAKE2b-256 099de6193178c8bb8fd781ee3a088a643ac9cbc5d4fc8de304fd1e92c111bad2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: occ_autogen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for occ_autogen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd8b37af4fdde7aec83add26a058697734484e7b8ff61fdef21576152b7e5d0a
MD5 803311c6f462e2d4fa1a26d2b9a5b7d5
BLAKE2b-256 ad30c2407b067fec8f45480a0e27357ada81bca3ae9c00fe8c90ace03da533f7

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