Skip to main content

OCC cryptographic proof signing for Google ADK

Project description

occ-google-adk

OCC cryptographic proof signing for Google Agent Development Kit (ADK).

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-google-adk

Quick Start

Tool Hook (recommended)

from google.adk.agents import Agent
from occ_google_adk import OccToolHook

hook = OccToolHook()
agent = Agent(
    name="my_agent",
    tools=[get_weather],
    before_tool_callback=hook.before_tool,
    after_tool_callback=hook.after_tool,
)

Decorate Individual Tools

from occ_google_adk import occ_tool

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

Wrap All Agent Tools

from google.adk.agents import Agent
from occ_google_adk import wrap_agent_tools

agent = Agent(name="my_agent", tools=[get_weather, search])
wrap_agent_tools(agent)

Custom Signer

from occ_google_adk 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_google_adk-0.2.0.tar.gz (5.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_google_adk-0.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for occ_google_adk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d1ab4be08bd085e172e043639b4d25ba35325fb17362e3401de1b6d52546ac8
MD5 f13a91929845846c3e3268076bfe7924
BLAKE2b-256 73e745ea31a760f7eccaf8342c7db2baf79cfff044931fb268652d8a6b3308a0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for occ_google_adk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c8dfb2260f6acc1be0901e72851b6815d4f8c5a256a8ca8a2e52ffae8611f16
MD5 4f56cdf5f830296bccd7a23da6fb6824
BLAKE2b-256 e2a4b18c591c8708217aad7beb8f3af43c28d24fddce09edfd817c1d7b4f25b7

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