Skip to main content

Agentomy Python SDK

Python client for the Agentomy AI Governance Platform -- wraps the Claw Bridge API for authorization, audit logging, emergency halt, status, and health checks.

Install

pip install agentomy-sdk

The platform itself is a hosted service and its repository is not public, so there is no source install for the SDK outside the platform checkout.

Quick Start

from agentomy import AgentomyClient

# An API key is required -- an Agentomy instance answers 401 without one. The client reads
# AGENTOMY_API_KEY from the environment, so keys stay out of your source:
#     export AGENTOMY_API_KEY=<key from your workspace dashboard>
client = AgentomyClient("http://localhost:3000")

# Or pass it explicitly, if you are loading it from a secret manager:
#     client = AgentomyClient("http://localhost:3000", api_key=my_secret_manager.get(...))

# Check if action is permitted
result = client.authorize("my-agent", "read", scope="customer-data")
print(result.tier)       # Analyst
print(result.audit_id)   # claw_1712345678_abc123

# Log an action
log = client.log("my-agent", "read", input_data="query", output_data="result")
print(log.chain_position)

# Emergency halt
halt = client.halt("my-agent", reason="Security incident")
print(halt.agents_affected)

# Fleet-wide halt (no agent_id)
client.halt(reason="Full fleet lockdown")

# Check status
status = client.status("my-agent")
print(status.quarantined)  # True after halt

# Bridge health
health = client.health()
print(health.bridge)  # "active"

Authentication

In production (when ENABLE_AUTH is set on the bridge), pass your API key:

# The client reads AGENTOMY_API_KEY from the environment when no api_key is passed.
client = AgentomyClient("https://your-instance.agentomy.com")

# Passing api_key="" asks for an explicitly UNAUTHENTICATED client, which ignores the
# environment. Only the public health surface answers without a key.

Error Handling

from agentomy import AuthorizationDenied, AgentQuarantined, ConnectionError, AgentomyError

try:
    client.authorize("my-agent", "delete")
except AuthorizationDenied as e:
    print(f"Denied: {e}")
except ConnectionError:
    print("Bridge unreachable")
except AgentomyError as e:
    print(f"API error: {e}")

Tier Permissions

Tier Allowed Actions
Analyst read, query, list, search, status
Builder Analyst + write, create, update, execute
Operator Builder + delete, deploy, configure
Strategist Operator + halt, override, admin

Governed Execution

The SDK provides two helpers that combine authorize + execute + log into a single call:

# governed() -- pass a callable
result = client.governed(
    "my-agent",
    fn=lambda: my_agent.run_task(),
    action="read",
    scope="documents"
)
print(result["authorized"])   # True
print(result["result"])       # whatever my_agent.run_task() returned

# governance() -- context manager (Pythonic style)
with client.governance("my-agent", action="write", scope="reports") as auth:
    if auth.authorized:
        report = generate_report()
        # log is called automatically on context exit

Both helpers: authorize before execution, log the result after, and raise AuthorizationDenied if the agent is not permitted.

Running Tests

The SDK's tests run against a live Agentomy instance at localhost:3000 and live in the platform repository alongside the source, so they are not part of this distribution.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentomy_sdk-0.3.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

agentomy_sdk-0.3.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file agentomy_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: agentomy_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for agentomy_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 094d572d8f93344c7744cdb4dfdc13da4f2cfe9c5dc7acd7e1e363a6d232c010
MD5 71e13606f4b85d057c12950889b78404
BLAKE2b-256 7d8f661f21e470409c145e892659ffb67b40dc1a4ed9bf4ae72bb7b4359cf6e3

See more details on using hashes here.

File details

Details for the file agentomy_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: agentomy_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for agentomy_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7e1ad5464c5d897a24ef0d623636937d1b78c6cc54cb549e4bd676ca7a807a8
MD5 82583c3f3fd298ee98bc4114346da734
BLAKE2b-256 e0fc28f446a3a986f5e56c603ffeaacdb0e21668ea9dd1ceeccbaf7fa6466bba

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