Skip to main content

AI Governance: Constitution + Audit for Agent Builders

Project description

Citadel SDK for Python

AI governance for agent builders — one primitive to control, audit, and approve every action your agents take.

Installation

pip install "citadel-sdk @ git+https://github.com/casss20/ledger-sdk.git#subdirectory=packages/sdk-python"

Quickstart

import citadel

citadel.configure(
    base_url="https://ledger-sdk.fly.dev",
    api_key="your-api-key",
    actor_id="my-agent",
)

result = await citadel.execute(
    action="email.send",
    resource="user:123",
    payload={"to": "user@example.com", "subject": "Hello"},
)

if result.status == "executed":
    print("Sent!")
elif result.status == "pending_approval":
    print("Waiting for human review")
else:
    print(f"Blocked: {result.reason}")

Decorator

@citadel.guard(action="stripe.refund", resource="charge:{charge_id}")
async def refund(charge_id: str, amount: int):
    return stripe.refund.create(charge=charge_id, amount=amount)

Context manager

async with citadel.CitadelClient(base_url="https://ledger-sdk.fly.dev") as client:
    result = await client.execute(action="db.write", resource="users")

Dashboard

Monitor all agent activity, approve requests, and manage policies at: https://casss20-ledger-sdk-6nlu.vercel.app

License

MIT

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

citadel_governance-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

citadel_governance-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for citadel_governance-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f88316ad426acd019694cec06c14f637d49bebf6894891554bfd596aaba32aad
MD5 8cc4d1b4016ce0f69ab2f4500aeabda3
BLAKE2b-256 6f0a1575b13fff361b6013a4d28f56a83e5ff8cc69f0b78545d5316f1ed7d59c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for citadel_governance-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8e14e4ac124a860d49feee2e1813c3749beb6a53020aa61b2d1d5ab430ccfd4
MD5 cf01bbeef787478ae7213105edfee5d5
BLAKE2b-256 d84336cd74986b38ceb9f8e6e182a451268a8b76e99d78a9ec2d8487d152d5c2

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