Skip to main content

Governance SDK for AI Agents - Runtime policy enforcement, activity capture, and approval workflows

Project description

Agendex SDK

Resource-Level Governance for AI Agents - Dynamic task-scoped access control, parameter inspection, and tamper-evident audit trails.

What Makes Agendex Different

Traditional IAM Agendex
"Agent can use payment tool" "Agent doing vendor_payment task can call payments API if amount < $1000"
Static permissions Dynamic, task-scoped
No parameter inspection Full body/query inspection
Tool-level control Resource-level control

Installation

pip install agendex

Quick Start: Resource-Level Governance (~30 lines)

from agendex import AgendexClient, GovernedDBClient, GovernedS3Client, GovernedHTTPSession
from agendex.errors import DeniedError, PendingApprovalError

# 1. Create client (reads config from env vars)
client = AgendexClient()

# 2. Create governed resource clients
db = GovernedDBClient(client, task="monthly_report")
s3 = GovernedS3Client(client, task="monthly_report")
http = GovernedHTTPSession(client, task="monthly_report")

# 3. Use in your tools - governance happens automatically
def fetch_revenue(month: str) -> str:
    try:
        result = db.query("monthly_revenue", {"month": month})
        return json.dumps(result.get("rows", []))
    except DeniedError as e:
        return f"[DENIED] {e.reason}"
    except PendingApprovalError as e:
        return f"[APPROVAL REQUIRED] ID: {e.approval_id}"

def initiate_payment(amount: float, vendor: str) -> str:
    try:
        result = http.post(
            "https://payments.api/v1/pay",
            json={"amount": amount, "vendor": vendor}
        )
        return json.dumps(result)
    except DeniedError as e:
        return f"[DENIED] {e.reason}"  # e.g., "amount > 5000"

Environment Variables

Variable Description Default
AGENDEX_URL Proxy URL http://localhost:8000
AGENDEX_AGENT_ID Agent identifier required
AGENDEX_TOKEN Bearer token required

How It Works

┌─────────────────────────────────────────────────────────────────┐
│  Agent Process                                                  │
│                                                                 │
│  Tool: fetch_revenue("2025-01")                                 │
│         │                                                       │
│         ▼                                                       │
│  GovernedDBClient.query("monthly_revenue", {month: "2025-01"})  │
│         │                                                       │
└─────────┼───────────────────────────────────────────────────────┘
          │
          ▼
┌─────────────────────────────────────────────────────────────────┐
│  Agendex Proxy                                                  │
│                                                                 │
│  /evaluate: {                                                   │
│    action: "db.query.run",                                      │
│    params: {query_id: "monthly_revenue"},                       │
│    task: "monthly_report"                                       │
│  }                                                              │
│         │                                                       │
│         ▼                                                       │
│  Policy: Allow db.query.run IF query_id=monthly_revenue         │
│          AND task IN [monthly_report, demo]                     │
│         │                                                       │
│         ▼                                                       │
│  /invoke → DBQueryAdapter → SQLite → rows                       │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Policy Examples

agents:
  finance_bot:
    allow:
      # DB: Only specific queries, scoped by task
      - action: "db.query.run"
        resources:
          - type: db_query
            query_id: "monthly_revenue"
        tasks: ["monthly_report", "demo"]
      
      # S3: Only specific buckets/prefixes
      - action: "s3.reports.fetch"
        resources:
          - type: s3
            bucket: "reports-bucket"
            key_prefix: "monthly/"
      
      # HTTP: Parameter-aware decisions
      - action: "http.service.call"
        condition: "body.amount < 1000"
      
      - action: "http.service.call"
        condition: "1000 <= body.amount <= 5000"
        require_approval: true
    
    deny:
      - action: "http.service.call"
        condition: "body.amount > 5000"

Resource Clients

Client Action What It Governs
GovernedDBClient db.query.run Query ID, parameters
GovernedS3Client s3.reports.fetch Bucket, key prefix
GovernedHTTPSession http.service.call Domain, path, method, body

Integration Overhead

~31 lines to add Agendex to an existing agent:

  • 2 lines: imports
  • 3 lines: config
  • 3 lines: tool signatures
  • 18 lines: error handling (6 per tool)
  • 5 lines: initialization

Documentation

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

agendex-0.2.0.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

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

agendex-0.2.0-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agendex-0.2.0.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agendex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0f8c442953bf0701223df6b873125a5aca1864812791be5f441d0802ada04de8
MD5 69077b22c13cf634cc4873d049b0e505
BLAKE2b-256 da9427e2a9284b08e4684560581f7c6b4ee59d6ee275afa1802f40361cb10b4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for agendex-0.2.0.tar.gz:

Publisher: publish-sdk.yml on IshanTiwari0112/agent-governance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: agendex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agendex-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faae12a2cc0b8adf07b4d83e5b7d498af69e54f3902589572d50c4f62f342a05
MD5 c803103245f07fd0f32db356f28d4bec
BLAKE2b-256 6c0de28d9a7c67a139ada41ceccd8ff7bae4ef3282ba81c799ccfd2cc75b8d0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for agendex-0.2.0-py3-none-any.whl:

Publisher: publish-sdk.yml on IshanTiwari0112/agent-governance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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