How hariprasath-dlh/agentguard works
AgentGuard is a runtime governance control plane: agents submit proposed tool calls through an HTTP API, which authenticates the caller and evaluates governance controls before returning ALLOW, DENY, or PENDING. The Python SDK wraps this decision boundary; the web dashboard supports administration, audit, and human approval. The README documents the major capabilities, while source excerpts confirm API registration, persistence setup, authentication, policy evaluation, and SDK structure. Several route and frontend connections are documented rather than verified in sampled implementation.
Main entry points: main.py FastAPI service · policy_engine.py Policy evaluation · hitl.py Human approvals · auth.py Authentication API
Components 22
Agent SDK
- SDK client
sdk/agentguard/client.py - Dispatch guard
sdk/agentguard/guard.py
Governance API
- FastAPI service
backend/app/main.py - Authentication API
backend/app/api/auth.py - Identity checks
backend/app/security/deps.py - Agent registry API
backend/app/api/agents.py - Guard endpoint
backend/app/api/guard.py - Policy evaluation
backend/app/services/policy_engine.py - Budget controls
backend/app/services/budget_guard.py - Rate limiting
backend/app/services/rate_limiter.py - Human approvals
backend/app/api/hitl.py - Audit API
backend/app/api/audit.py - Dashboard API
backend/app/api/dashboard.py
Control Plane
- Admin dashboard
frontend/src/routes/dashboard.tsx - Web authentication
frontend/src/lib/auth.tsx - Web API client
frontend/src/lib/api.ts
State and Audit
- PostgreSQL
backend/app/core/database.py - Audit vault
backend/app/services/audit_vault.py - Redis
backend/app/core/redis.py
Other components
- AI agent
- External tools
- Administrator / reviewer
Connections 26
- AI agent → SDK client: proposes call
README.md - SDK client → Dispatch guard: wraps dispatch
sdk/agentguard/client.py - Dispatch guard → FastAPI service: requests decision
README.md - FastAPI service → External tools: allows execution
README.md - FastAPI service → Authentication API: routes requests
backend/app/main.py - FastAPI service → Agent registry API: routes requests
backend/app/main.py - FastAPI service → Guard endpoint: routes requests
backend/app/main.py - FastAPI service → Human approvals: routes requests
backend/app/main.py - FastAPI service → Audit API: routes requests
backend/app/main.py - FastAPI service → Dashboard API: routes requests
backend/app/main.py - Authentication API → Identity checks: uses identity checks
backend/app/api/auth.py - Identity checks → PostgreSQL: loads identity
backend/app/security/deps.py - Guard endpoint → Identity checks: authenticates caller
- Guard endpoint → Policy evaluation: evaluates request
- Policy evaluation → Budget controls: checks spend
- Policy evaluation → Rate limiting: checks limits
- Policy evaluation → Human approvals: can require approval
README.md - Human approvals → Audit vault: records decision
backend/app/api/hitl.py - Audit API → Audit vault: verifies audit chain
- Admin dashboard → Web API client: loads dashboard data
- Web API client → Dashboard API: requests dashboard
- Web authentication → Web API client: uses API client
frontend/src/lib/auth.tsx - Administrator / reviewer → Admin dashboard: reviews governance
README.md - Administrator / reviewer → Human approvals: approves pending calls
README.md - FastAPI service → PostgreSQL: uses sessions
backend/app/core/database.py - Authentication API → Redis: OAuth state storage