Overview
AgentGuard is a Human-as-a-Service (HaaS) governance layer that sits between AI agents and their tool calls. It validates every MCP tool invocation, classifies risk, and routes high-risk actions to qualified human reviewers for approval before execution.
Risk Classification
Policy-driven 4-tier system: LOW → MID → HIGH → CRITICAL. Each tier has configurable approval thresholds.
Multi-Sig Approval
Cross-pool consensus with threshold-based quorum. Higher risks need more approvers from diverse pools.
Credential Verification
Approvers authenticate via LinkedIn, GitHub, SSO, or OIDC. Skills are verified before review access.
AIOps Learning
Learns from approval patterns to auto-adjust risk tiers. Consistently-approved tools get downgraded.
MCP Protocol
Official MCP SDK server exposing governance tools. Drop-in integration with Claude, Cursor, and others.
Admin Dashboard
Light-themed admin console for queue monitoring, policy management, and audit log review.
System Architecture
AgentGuard operates as a transparent proxy between AI agents and tool servers. The core validates tool calls, classifies risk, and manages the approval lifecycle.
Components
HaaS Core (packages/haas-core)
The central governance engine. Contains the risk classifier, state machine, consensus aggregator, identity verification, AIOps learning, and MCP server implementations.
| Module | File | Purpose |
|---|---|---|
| Risk Classifier | classifier/risk-classifier.ts | Policy-driven tool name + argument matching → risk tier |
| State Machine | state/state-machine.ts | Request lifecycle: PENDING → WAITING → APPROVED/REJECTED/TIMEOUT |
| Consensus | consensus/aggregator.ts | Signature collection, threshold checks, multi-pool quorum |
| MCP Tool Validator | mcp/interceptor.ts | Transparent tool call validation and governance routing |
| MCP Server | mcp/mcp-server.ts | Official SDK server exposing governance tools |
| HTTP Server | mcp/server.ts | REST API for dashboard, approval, and admin operations |
| AIOps | aiops/feedback-loop.ts | Auto-tunes risk tiers from approval/rejection patterns |
| Skill Framework | aiops/skill-framework.ts | Maps IdP claims to HaaS approval pools |
| Auth Factory | auth/factory.ts | Pluggable identity providers (GitHub, LinkedIn, OIDC, etc.) |
| Persistent Store | storage/persistent-store.ts | File-backed JSON storage for settings and audit |
Admin Dashboard (packages/haas-dashboard)
React + Vite + Tailwind admin console. Monitors governance queue, manages policies and identity providers, and provides shareable approval links for SMEs.
Approval Page (/approve/:requestId)
Standalone page for SME/specialist review. Three-step flow: Authenticate → Verify Skills → Review & Decide. Accessed via shareable links generated from the dashboard.
Request Flow
Every tool call from an AI agent flows through the following lifecycle:
Approval Flow
When a request needs human approval, the admin dashboard generates a shareable link. The SME/specialist follows this flow:
Risk Classification
Every tool call is classified into one of four tiers based on configurable policies:
| Tier | Threshold | Default Timeout | Pools | Example |
|---|---|---|---|---|
| LOW | Auto-approve | — | — | read_customer_data |
| MID | 1 signature | 3 min | general | update_customer_notes |
| HIGH | 2 signatures | 5 min | finance | apply_discount |
| CRITICAL | 3 signatures | 15 min | finance + security + legal | transfer_funds |
Policy Configuration
Policies are defined as JSON arrays, editable via the dashboard Settings page or loaded from config/risk-policies.example.yml:
[
{
"tool": "transfer_*",
"tier": "CRITICAL",
"threshold": 3,
"pools": ["finance", "security", "legal"],
"timeout": "15m",
"conditions": [
{ "field": "amount", "operator": ">", "value": 10000 }
]
},
{
"tool": "read_*",
"tier": "LOW",
"autoApprove": true
}
]
AIOps Feedback Loop
AgentGuard learns from approval patterns and progressively adjusts risk tiers to reduce friction for consistently-approved operations.
Safety Guardrails
- CRITICAL tier is protected — never auto-downgraded, only flagged for manual review
- Configurable thresholds — default: 50 approvals to downgrade, 5 rejections to upgrade
- Full audit trail — every adjustment is logged with timestamp and reason
- Manual override — admins can lock any tool's tier via the dashboard
Skill Framework
The Skill Framework maps identity provider claims to HaaS approval pools, ensuring only qualified personnel can review specific risk categories.
| Pool | Required Skills | Minimum Seniority |
|---|---|---|
| finance | Financial Analysis, Treasury, Budget Approval, Compliance | Senior |
| security | Security Architecture, Incident Response, Threat Assessment | Senior |
| engineering | Software Engineering, DevOps, Cloud Architecture | Mid-level |
| legal | Contract Review, Regulatory Compliance, Data Privacy | Senior |
| executive | Strategic Planning, Executive Oversight, Risk Management | Director+ |
| general | General Approval | Any |
Quickstart
Clone & Install
git clone https://github.com/anthropics/agentguard.git
cd agentguard
npm install
Build
cd packages/shared-proto && npx tsc && cd ../..
cd packages/haas-core && npx tsc && cd ../..
Start Everything
Use the deploy script to start the API server + dashboard:
./deploy-mcp.sh
Open Dashboard
Visit http://localhost:5173 for the admin dashboard.
Trigger Demo
Click "Trigger Demo" in the dashboard, or run:
./deploy-mcp.sh demo
Test Approval Flow
Click "Open" next to a pending request → authenticate → verify skills → approve or reject.
Connect MCP Client
For Claude Desktop or Cursor, add to your mcp_config.json:
{
"mcpServers": {
"agentguard": {
"command": "npx",
"args": ["tsx", "packages/haas-core/src/mcp/mcp-server.ts"],
"cwd": "/path/to/agentguard"
}
}
}
Deployment Modes
| Command | Description |
|---|---|
./deploy-mcp.sh | API server (port 3100) + Dashboard (port 5173) |
./deploy-mcp.sh http | API server only |
./deploy-mcp.sh mcp | MCP stdio server for Claude Desktop / Cursor |
./deploy-mcp.sh demo | API server + trigger sample scenarios |
Persistent Data
Settings and audit logs are stored in .agentguard/ directory:
.agentguard/providers.json— Identity provider configuration.agentguard/audit-log.json— Governance decision history.agentguard/policies.json— Risk policy overrides
REST API Reference
All endpoints are served from the HaaS Core HTTP server (default port 3100).
Core Endpoints
Validate a tool call. Body: { method, params: { name, arguments } }
Submit approval/rejection. Body: { requestId, signature: { approverId, pool, decision, reason } }
List all pending approval tasks.
Health check. Returns { status: "ok", uptime }
Settings Endpoints
Get current risk policies.
Update risk policies. Body: { policies: [...] }
Get all identity provider settings.
Save identity provider settings. Body: { providers: [{ name, enabled }] }
Get only enabled providers (used by approval page).
Monitoring Endpoints
AIOps learning statistics: tracked tools, adjustments, pending recommendations.
Governance audit log (last 100 entries from persistent storage).
Trigger demo scenarios. Body: { scenario: "all" | "low" | "mid" | "high" | "critical" }
MCP Server Tools
The MCP server exposes five governance tools via the official MCP SDK:
| Tool | Description | Parameters |
|---|---|---|
haas_evaluate | Classify a tool call's risk without executing | toolName, toolArgs |
haas_submit | Submit a tool call for governance | toolName, toolArgs, agentId |
haas_status | Check approval status of a request | requestId |
haas_approve | Submit approval/rejection signature | requestId, approverId, pool, decision |
haas_policies | List current risk policies | none |
Configuration
MCP Client Config
Add to Claude Desktop or Cursor's mcp_config.json:
{
"mcpServers": {
"agentguard": {
"command": "npx",
"args": ["tsx", "packages/haas-core/src/mcp/mcp-server.ts"],
"cwd": "/path/to/agentguard"
}
}
}
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT | 3100 | HTTP server port |
HOST | 0.0.0.0 | HTTP server bind address |
GITHUB_CLIENT_ID | — | GitHub OAuth client ID |
GITHUB_CLIENT_SECRET | — | GitHub OAuth client secret |
OIDC_ISSUER | — | OIDC issuer URL |
Project Structure
agentguard/
├── packages/
│ ├── haas-core/ # Governance engine
│ │ ├── src/
│ │ │ ├── aiops/ # AIOps + Skill Framework
│ │ │ ├── auth/ # Identity providers
│ │ │ ├── classifier/ # Risk classification
│ │ │ ├── consensus/ # Multi-sig consensus
│ │ │ ├── mcp/ # Validator + servers
│ │ │ ├── state/ # State machine + store
│ │ │ ├── storage/ # Persistent file store
│ │ │ └── telemetry/ # OpenTelemetry spans
│ │ └── tests/
│ ├── haas-dashboard/ # React admin console
│ └── shared-proto/ # Shared types + schemas
├── docs/ # This documentation
├── config/ # Example configurations
├── deploy-mcp.sh # Deployment script
└── mcp-config.json # MCP client config