Documentation
v1.0.0
SDK reference, REST API specification, CLI guide, and architectural concepts for AgentGuard.
Base URL: http://127.0.0.1:8000
Installation
AgentGuard is designed to be lightweight. The core package has zero runtime dependencies beyond Python 3.11+. Install only what you need.
Core (zero deps)
pip install agentguard
With dashboard server
pip install agentguard[server]
With LLM providers
pip install agentguard[openai,gemini,anthropic]
All extras
pip install agentguard[all]
Initialize the Control Plane
Create a single `AgentGuard` instance and use `@guard.protect()` to wrap any agent entrypoint. The decorator intercepts every outbound tool call and context exchange.
main.py
from agentguard import AgentGuard
guard = AgentGuard(mode="strict")
@guard.protect(agent_id="orchestrator_v1", trust_level="HIGH")
def run_agent(task: str) -> str:
# Your agent logic here
return agent.run(task)Enforcement Modes
Three built-in enforcement modes control how strictly the policy engine acts. All modes produce full evidence records.
modes.py
# STRICT — Block all policy violations. Zero AI override. guard = AgentGuard(mode="strict") # MONITOR — Log and alert but do not block. Safe for staging. guard = AgentGuard(mode="monitor") # AUDIT — Read-only. Record decisions without enforcement. guard = AgentGuard(mode="audit")