Skip to main content

The reliability layer for AI agents in production

Project description

AgentGuard Python SDK

The reliability layer for AI agents in production. Trace executions, enforce guardrails, and monitor agent behavior — with zero changes to your agent's core logic.

Installation

pip install agentx-sdk

Quick Start

from agentguard import AgentGuard, GuardConfig

guard = AgentGuard(
    api_key="your-api-key",
    config=GuardConfig(api_url="https://api.agentguard.dev"),
)

# 1. Decorator — auto-capture input/output/latency
@guard.watch(agent_id="my-agent")
def run_agent(prompt: str) -> str:
    return call_llm(prompt)

# 2. Context manager — fine-grained step tracing
with guard.trace(agent_id="my-agent", task="summarize") as ctx:
    result = call_llm(prompt)
    ctx.step("llm", "summarize", input=prompt, output=result)
    ctx.record(result)

# 3. Session — group related executions
session = guard.session(agent_id="chat-bot")
with session.trace(task="turn 1", input_data=user_msg) as ctx:
    response = call_llm(user_msg)
    ctx.record(response)

Configuration

GuardConfig(
    mode="async",           # "async" (fire-and-forget) or "sync" (inline verification)
    api_url="https://api.agentguard.dev",
    flush_interval_s=1.0,   # Batch flush interval (async mode)
    flush_batch_size=50,    # Max events per flush batch
    timeout_s=2.0,          # HTTP timeout for API calls
)

Requirements

  • Python 3.9+
  • Dependencies: httpx, pydantic (v2)

Documentation

Full documentation: docs.oppla.ai/agentguard

License

Apache 2.0 — see LICENSE for details.

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

agentx_sdk-0.1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

agentx_sdk-0.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentx_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4a42357618c79f2527fe0020be98639593c4e726c93e6ae186518dc997b0c3d
MD5 29a8c0501c8253b8102bd7cb40132209
BLAKE2b-256 ea2ec3f3f501dfe92988347ec8b0833d0c4e49e994158f3a90a8814f2ea9e3b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentx_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for agentx_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1153090fa537ed952e8e3f46b4acc101fff066daf50ae098636f0c4d9dd59040
MD5 eb7c4143beee95f992dbd3a0875ce902
BLAKE2b-256 7c407dea25523bf29aea81166d297071ba9117436036658c8faeb19a5453db45

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