Skip to main content

AgentGuard Python SDK

Python SDK for the AgentGuard AI Agent Authorization API.

AgentGuard provides an authorization and policy layer between AI agents and the tools or resources they interact with. It evaluates requested actions and returns one of three decisions:

  • ALLOW
  • BLOCK
  • REQUIRE_APPROVAL

Installation

pip install agentguard

Quick Start

from agentguard import AgentGuard

client = AgentGuard(api_key="ag_live_your_api_key")

result = client.authorize(
    agent_id="sales-agent",
    action="send_email",
    resource="customer_123",
    parameters={
        "recipient": "customer@example.com"
    }
)

print(result.decision)
print(result.risk_score)
print(result.reason)

Decision Helpers

The returned EvaluationResult provides convenient properties:

if result.allowed:
    print("Action is allowed")

if result.blocked:
    print("Action is blocked")

if result.requires_approval:
    print("Human approval is required")

Approval Status

For actions requiring approval:

if result.requires_approval:
    approval = client.get_approval_status(result.approval_id)
    print(approval)

Custom API URL

The SDK defaults to the hosted AgentGuard API, but a custom API URL can be supplied:

client = AgentGuard(
    api_key="ag_live_your_api_key",
    base_url="https://your-agentguard-instance.example.com"
)

Security

Keep your AgentGuard API key secret. Do not commit API keys to source control or expose them in client-side applications.

Use environment variables or a secret manager in production.

License

AgentGuard is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for agentguard-auth 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentguard-auth 0.1.0
File Size Uploaded
agentguard_auth-0.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentguard-auth 0.1.0
File Interpreter ABI Platform
agentguard_auth-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / agentguard_auth-0.1.0.tar.gz

Download URL agentguard_auth-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1aec4f87d976653aae6bb43ecfa1a73bde684964a0e4e77e055fc776fdc59cf
BLAKE2b-256 checksum
How to use checksums
604e53940df268d7a2aeee47f5565302c337d362fc9442eabb6d285f834b0bdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / agentguard_auth-0.1.0-py3-none-any.whl

Download URL agentguard_auth-0.1.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de0e9282524e6f5d809c24ac0ae069eb3f11725b227311e31a43aaf40f1997bb
BLAKE2b-256 checksum
How to use checksums
362b3ca1e6145076358ba2d73e13156c1a73dd50b5e07162ee7032983538395a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page