Skip to main content

AgentGuard

Real-time cost observability and guardrails for AI agents.

Track LLM spend, set budget thresholds, and auto-pause agents before they blow up your bill.

Install

pip install agentguard

Quick Start

from agentguard import AgentGuard, AgentEvent

guard = AgentGuard(
    api_key="ag_...",
    agent_id="my-sales-agent",
    cost_threshold=10.0,          # auto-pause at $10/day
    slack_webhook="https://...",  # optional alert
)

# Custom agent — wrap with decorator
@guard.track
def run_my_agent():
    # your agent logic here
    alive = guard.send_event(AgentEvent(
        agent_id="my-sales-agent",
        event_type="llm_call",
        model="gpt-4o",
        input_tokens=500,
        output_tokens=300,
    ))
    if not alive:
        print("Agent paused — cost threshold reached")
        return

LangChain / LangGraph

from agentguard import AgentGuard

guard = AgentGuard(api_key="ag_...", agent_id="my-agent", cost_threshold=5.0)

# Drop-in callback — tracks every LLM call automatically
chain = my_chain.with_config(callbacks=[guard.callback])
result = chain.invoke({"input": "do something"})

Supported Models

Model Input (per 1M) Output (per 1M)
gpt-4o $2.50 $10.00
gpt-4o-mini $0.15 $0.60
claude-3-5-sonnet $3.00 $15.00
claude-3-5-haiku $0.80 $4.00
gemini-1.5-pro $1.25 $5.00

Dashboard

View live costs, event feed, and manage agents at agent-guard-nine.vercel.app.

Links

Release files for agentguard-ram 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-ram 0.1.0
File Size Uploaded
agentguard_ram-0.1.0.tar.gz 56.5 kB Details

Built distribution (wheel)

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

Total release size: 61.6 kB

Release files / agentguard_ram-0.1.0.tar.gz

Download URL agentguard_ram-0.1.0.tar.gz
Size 56.5 kB
Tags Source
SHA-256 checksum
How to use checksums
93e24cba98094355efd4f9bf192fb1a8049260f27f5dc357fe0f01ac35e24828
BLAKE2b-256 checksum
How to use checksums
fff81f74709cebe590fdfcad255733c48c23516c246ec7bc753192ab6b5259d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL agentguard_ram-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02b074a5da1011d08969eda49998e72e5d879067ba04bd55c64d3771a5b28f5e
BLAKE2b-256 checksum
How to use checksums
6e103e38257e00c844353b2a204d24f2ca5a153467205b0bda3a623584a2c37b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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