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.

Quarantine and Release

A halted agent is quarantined and refused until an operator releases it. quarantined() answers which agents are in that state -- health() only reports a count, and release() needs an id.

listing = client.quarantined()
print(listing["count"], listing["quarantinedAgents"])

client.release("my-agent", operator_id="operator-alice", reason="investigated")

release() clears one agent's quarantine. It does NOT lift a fleet halt: the authorize gate checks the fleet halt first, so under an active halt a released agent stays refused. Call resume() first, then release().

A quarantined agent raises AgentQuarantined, which subclasses AuthorizationDenied -- so existing except AuthorizationDenied handlers keep working, and code that needs to tell a quarantine from a tier denial can now catch the specific one.

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.4.0.tar.gz (21.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.4.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentomy_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 21.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.4.0.tar.gz
Algorithm Hash digest
SHA256 8de2caa299b03f7a960eb318585e0dd1c037dbfbb5ddc555c4ae8853d8c01676
MD5 0a97cd1c3123c5c06bcad8cfc944a507
BLAKE2b-256 06b3e0f64f8db3fc55a86c0cbf286009e19c3bf8ec24c28e29988f953e527d61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentomy_sdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fe0d1696ce237fa3a58b526d6910c08800d285c515c1f4ef189a48d12571cf9
MD5 76303a761549108ad5ef342d6ca1566a
BLAKE2b-256 00955ed98e3cb2dc43f1db1ced6b5cc9769d1d79d803541210be41bab8b2a0cf

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