Observed since 21 Oct, 09:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
The reliability layer for AI agents in production
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.
pip install agentx-sdk
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)
Run inline verification with pass/flag/block decisions. When the verification engine determines an output is unreliable, the SDK raises AgentGuardBlockError so your application can handle it gracefully.
from agentguard import AgentGuard, GuardConfig, AgentGuardBlockError
guard = AgentGuard(
api_key="your-api-key",
config=GuardConfig(
mode="sync",
api_url="https://api.agentguard.dev",
),
)
@guard.watch(agent_id="my-agent")
def run_agent(prompt: str) -> str:
return call_llm(prompt)
try:
result = run_agent("Summarize this document")
# result is a GuardResult with confidence score
print(result.output, result.confidence, result.action)
except AgentGuardBlockError as e:
print(f"Blocked: confidence={e.result.confidence}")
Automatically correct unreliable outputs instead of blocking. When enabled, the verification engine attempts to fix issues and returns the corrected output.
guard = AgentGuard(
api_key="your-api-key",
config=GuardConfig(
mode="sync",
correction="cascade", # Enable correction
transparency="transparent", # Include correction details in result
),
)
result = run_agent("Summarize this document")
if result.corrected:
print(f"Output was corrected: {result.output}")
print(f"Original: {result.original_output}")
Group related executions into sessions with automatic conversation history for multi-turn verification (hallucination, drift, coherence).
session = guard.session(agent_id="chat-bot")
# Turn 1
with session.trace(task="greeting", input_data="Hello") as ctx:
response = call_llm("Hello")
ctx.record(response)
# Turn 2 — conversation history from turn 1 is sent automatically
with session.trace(task="follow-up", input_data="Tell me more") as ctx:
response = call_llm("Tell me more")
ctx.record(response)
The session maintains a sliding window of conversation history (configurable via conversation_window_size), enabling cross-turn verification checks like self-contradiction detection and goal drift analysis.
from agentguard import GuardConfig
from agentguard.models import ThresholdConfig
GuardConfig(
mode="async", # "async" (fire-and-forget) or "sync" (inline verification)
correction="none", # "none" or "cascade" (auto-correct unreliable outputs)
transparency="opaque", # "opaque" or "transparent" (include correction details)
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
conversation_window_size=10, # Max conversation turns retained per session
confidence_threshold=ThresholdConfig(
pass_threshold=0.8, # >= 0.8 → pass
flag_threshold=0.5, # >= 0.5 → flag (warning logged)
block_threshold=0.3, # < 0.3 → block (raises AgentGuardBlockError)
),
)
mode="sync" with configurable confidence thresholdscorrection="cascade", dual-timeout transport (2s verify / 12s correction), and transparent/opaque modesGuardResult Model: Structured verification results with confidence, action, corrected, original_output, and corrections fieldsAgentGuardBlockError: Exception raised when verification blocks output, with the full GuardResult attachedConversationTurn Model: First-class conversation turn representation for multi-turn agentshttpx, pydantic (v2)Full documentation: docs.oppla.ai/agentguard
Apache 2.0 — see LICENSE for details.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.2 | 12 Feb 2026 | 6 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:0f58c79b0edb88b7355ac931df8b79289b823107421167a7b65a51c9870988bd