AI Cost Intelligence CLI AG

Your AI agent might cost $100k/month.

Find out before you run it.

Get Started → ↓ View Example

See exactly what AgentGuard catches.

Run it on any Python project. Get a cost projection in seconds.

agentguard — bash — 120×50
    /\                    __  ______                     __
   /  \   ____ ____  ____/ /_/ ____/__  ______ __________/ /
  / /\ \ / __ `/ _ \/ __  __/ / __/ / / / __ `/ ___/ __  /
 / ____ / /_/ /  __/ / / / / /_/ / /_/ / /_/ / /  / /_/ /
/_/    \_\__, /\___/_/ /_/  \____/\__,_/\__,_/_/   \__,_/
         /____/
Pre-execution Cost Estimator for Agentic AI Systems

FILE ANALYSIS

main.py  [ 🔄 py]
Calls: 1  •  Loops: 1  •  Risk: ⚡ MEDIUM
Loop Depth Simulation:
N=  1 $0.0020 $0.0068 (1 calls)
N=  5 $0.0301 $0.1325 (5 calls)
N= 20 $0.4221 $1.86   (20 calls)
N=100 $10.15   $44.62 (100 calls) ⚠ BANKRUPTCY RISK
Risk Flags:
API calls inside loops — cost grows with loop depth
No loop depth limiter found — unbounded execution risk
Optimizations:
Add max_iterations/max_steps guard to bound loop depth
Consider model downgrade: frontier → flash/haiku (10-20× cheaper)

COST SUMMARY

Model:gpt-4o
Files scanned:1
Files with LLM activity:1

Total Cost Range (N=1 → N=100): $0.0020 $44.62
Upper Bound (worst case, no opt):$44.62
Optimized Estimate (w/ caching):$44.62
Savings Alpha:$0.00 (0%)

TOP RISK FILES

main.py  (2 risk flags)
API calls inside loops — cost grows with loop depth
No loop depth limiter found — unbounded execution risk

RECOMMENDATIONS

1. Add max_iterations/max_steps guard to bound loop depth
2. Consider model downgrade: frontier → flash/haiku (10-20× cheaper)
$

Three steps. No config needed.

01

Install AgentGuard

One pip command. No API key, no sign-up, no PATH config required.

pip install agentguard-cli
02

Navigate to your project

Point your terminal at any Python project directory containing agent code.

cd your_project
03

See cost risks instantly

Run AgentGuard. Get a projected cost, risk severity, and exact file/line references.

agentguard --root_dir .

One command to get started.

No API key needed. No sign-up. No PATH configuration required — works everywhere Python works.

$ pip install agentguard-cli
If the command doesn't work on your system, run:
$ python -m agentguard.cli --root_dir .

Run it. That's it.

Navigate into your project folder, then run AgentGuard. It recursively scans all Python files and subfolders — no config needed.

⭐ Recommended — if PATH is configured
$ agentguard --root_dir .
Fallback — works everywhere without PATH
$ python -m agentguard.cli --root_dir .
// WHAT DOES "." MEAN?
"." = current folder. AgentGuard will recursively scan:
All .py files in the current folder
All subfolders inside it, automatically
💡
TIP — Run from your project root.
python -m agentguard.cli --root_dir . crawls subfolders automatically, so running it from the root directory gives you full coverage in one pass. Running it from a subfolder only scans that subfolder and below.
Method Works Without PATH Recommended
agentguard --root_dir . ❌ Needs PATH ⭐ Best
python -m agentguard.cli --root_dir . ✅ Yes Fallback
Scans all .py files in the current directory and all subdirectories

Built for the failure modes that hurt.

AgentGuard catches the patterns that quietly turn a $10/day agent into a $100k/month disaster.

🔁

LLM Calls in Loops

Detects any LLM API call inside a for, while, or recursive function. Flags the exact line.

📈

Context Growth Analysis

Identifies whether your context window grows linearly or quadratically across agent iterations.

🌀

Recursion Risk

Finds recursive tool use and estimates worst-case call depth at production scale.

💸

Cost Scaling Simulation

Projects monthly costs under linear vs quadratic scaling assumptions, benchmarked to model pricing.

O(n²)
Context growth in most naive agent loops
$133k
Projected monthly cost for one unoptimized agent
< 2s
Time to scan a typical project with AgentGuard

AI agents silently compound costs until it's too late.

Most agent frameworks make it trivially easy to write a loop that calls an LLM on every iteration, appending the output to a growing context. At small scale, it's fine. At production scale, it's catastrophic.

A context that grows by 1,000 tokens per step reaches 1M tokens in 1,000 steps. At GPT-4 pricing, that single run costs over $1,000. Run it hourly and you've burned $24k before you've noticed.

AgentGuard exists to prevent expensive mistakes before deployment — not after the invoice arrives.