Catalog PyPI
Back to packageRELEASE DETAILS

0.6.0

PyPI

agent-gov-saas

AI Agent Cost Governance — policy engine, budget enforcement, per-tool cost tracking, multi-tenant workspaces

Published31 May 2026
Direct dependencies7
Transitive dependenciesNot calculated

README

Version 0.6.0 documentation

🛡 agent-gov

AI Agent Cost Governance Platform

PyPI version Python versions License: MIT

A reverse proxy that tracks, budgets, and controls what your AI agents spend. Like a credit card with limits — but for your agents.


What Problem Does This Solve?

AI agents call expensive tools (LLMs, browsers, APIs, email services). Without controls:

  • A recursive agent burns ₹5,000 in one night on GPT-4
  • A buggy loop sends 10,000 emails before you notice
  • You discover the bill when your credit card statement arrives

agent-gov sits between your agents and their tools. Every call goes through us. We check budgets, track costs, and auto-pause overspending agents.


Quick Start

1. Install

pip install agent-gov-saas

2. Start the server

agent-gov start

Server starts at http://localhost:8000.

Alternatively, use Docker: docker compose up (see GitHub repo for docker-compose.yml).

3. Register an Agent

curl -X POST http://localhost:8000/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name": "My Bot", "daily_budget": 500}'

Response:

{
  "api_key": "ag-abc123...",
  "name": "My Bot",
  "daily_budget": 500,
  "message": "Save this API key — it won't be shown again!"
}

4. Route Agent Calls Through the Proxy

Instead of calling tools directly, your agent calls our proxy:

# BEFORE (no governance):
response = call_openai(prompt)

# AFTER (with agent-gov):
gov_response = requests.post("http://localhost:8000/proxy/call", json={
    "agent_key": "ag-abc123...",
    "tool_name": "openai-gpt4",
    "estimated_cost": 12.50   # ₹12.50 for this call
})
if gov_response.status_code == 429:
    print("Budget exceeded! Agent auto-paused.")
else:
    response = call_openai(prompt)  # Proceed with actual call

5. Watch the Dashboard

Open http://localhost:8000/dashboard — live view of all agents, their spend, and budget status.

6. (Optional) Pre-Register Common Tools

# Register 24 common AI tools with realistic costs (₹)
python seed_tools.py

# Preview before registering:
python seed_tools.py --list

API Reference

MethodEndpointDescription
GET/Health check + stats
POST/agents/registerCreate agent, get API key
POST/proxy/callProxy a tool call (budget checking + real cost lookup)
POST/agents/{key}/resumeResume a paused agent (resets budget)
POST/agents/{key}/resetReset daily budget counters (no unpause)
POST/workspacesCreate a workspace (returns API key)
GET/workspacesList all workspaces
POST/tools/registerRegister a tool with its known cost per call
GET/toolsList all registered tools
GET/analytics/toolsPer-tool spend statistics
GET/dashboardLive HTML dashboard
GET/docsInteractive OpenAPI docs (Swagger)

Features

FeatureWhat it does
Budget enforcementAuto-pause agents that exceed their daily budget
Tool registryRegister tools with known costs — agents can't lie about pricing
Real cost lookupProxy uses registered tool cost, not client estimate
Per-tool analyticsSee spend broken down by tool, not just by agent
Daily auto-resetBudgets reset automatically at midnight
Multi-tenancyWorkspaces for teams, projects, or clients
DashboardLive HTML dashboard with per-agent and per-tool views
CLIagent-gov start / status / version
DockerReady-to-run Docker Compose setup

Architecture

Agent (your code)
    │
    │ POST /proxy/call { agent_key, tool_name, estimated_cost }
    ▼
┌──────────────────────────────┐
│         agent-gov             │
│                                │
│  1. Auth: Is key valid?       │
│  2. Budget: Will this exceed? │
│  3. Log: Track cost + tool    │
│                                │
│  If approved → return 200     │
│  If denied  → return 429     │
└──────────────────────────────┘
    │
    │ Agent calls actual tool
    ▼
┌──────────────────────────────┐
│   Actual Tool (OpenAI, etc.)  │
└──────────────────────────────┘

Technology Stack

ComponentTechnologyWhy
API FrameworkFastAPIFast, async, auto-docs
ValidationPydanticType-safe input validation
ServerUvicornProduction ASGI server
StorageSQLite via aiosqlitePersistent, zero setup
TemplatesJinja2Server-rendered dashboard
Tool RegistrySQLite + UPSERTKnown tool costs, agents can't lie
WorkspacesSQLite + migrationsMulti-tenancy with workspace isolation
Testingpytest + httpxFast, isolated tests

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
fastapi
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
fastapi>=0.100.0runtime
uvicorn
Environment
{
  "extras": "standard",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
uvicorn[standard]>=0.20.0runtime
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.24.0runtime
jinja2
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
jinja2>=3.0.0runtime
aiofiles
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
aiofiles>=23.0.0runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest>=7.0.0; extra == "dev"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.21.0; extra == "dev"runtime

Distribution files

2 collected
agent_gov_saas-0.6.0-py3-none-any.whl

bdist_wheel · 24.04 KB · Python py3

Source file
agent_gov_saas-0.6.0.tar.gz

sdist · 22.52 KB · Python source

Source file

Repository

PENDING
sschelliah2026-source/agent-gov

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:04 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:0080a78595d1ef66bfca66ec84eb4286b577d5840ea1dad2ddd3280c9085753d

Other collected versions

View all collected versions →