Start with pip install agentguard47. Provider clients come later when you wire a real loop.
Install the SDK, trip a guard, generate a starter, and inspect the trace before any hosted setup.
Three-step path
If this works, the rest makes sense.
Start with pip install agentguard47. Provider clients come later when you wire a real loop.
Run doctor and demo so budget, loop, retry, or timeout enforcement is visible before signup.
Generate a starter file, run it, then copy the guard pattern into a real coding-agent loop.
Run this
OpenAI is the default path.
pip install agentguard47 openai
Smallest OpenAI path: init once, keep the proof local, and let AgentGuard auto-patch the client.
import agentguard
from openai import OpenAI
agentguard.init(
service="openai-agent",
budget_usd=5.00,
trace_file="traces.jsonl",
local_only=True,
)
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Give me a one-line summary of AgentGuard."}],
)
print(response.choices[0].message.content)
print("Traces saved to traces.jsonl")
agentguard doctorpython agentguard_openai_quickstart.pyagentguard incident traces.jsonlHosted handoff
The SDK stays first. Hosted is for shared operations.
pip install agentguard47 openai
from agentguard import BudgetGuard, HttpSink, Tracer, patch_openai
from openai import OpenAI
guard = BudgetGuard(max_cost_usd=50.00, warn_at_pct=0.8)
http_sink = HttpSink(
url="https://app.agentguard47.com/api/ingest",
api_key="ag_YOUR_KEY_HERE",
batch_size=5,
flush_interval=0.5,
)
tracer = Tracer(
sink=http_sink,
service="openai-agent",
)
patch_openai(tracer, budget_guard=guard)
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Summarize the latest support ticket."}],
)
print(response.choices[0].message.content)
Links
Only the essentials.