Stop Letting AI Agents Run Wild! Use AgentGate Instead
Your AI agent just sent a $50,000 wire transfer to a vendor. It deleted your production database. It emailed your entire customer list without approval. Sound like a nightmare? For teams deploying autonomous agents in 2025, this isn't science fiction—it's Tuesday.
Here's the dirty secret most AI vendors won't tell you: giving agents unlimited autonomy is a ticking time bomb. Every unchecked action is a potential incident waiting to happen. But here's the twist—adding human oversight doesn't have to mean killing productivity. What if you could automate the safe stuff, flag the risky stuff, and keep humans in control without slowing everything down?
Enter AgentGate, the open-source approval workflow system that top engineering teams are quietly adopting. Built by amitpaz1 and the AgentKit ecosystem, AgentGate lets your agents request permission, your policies auto-decide routine actions, and your humans approve the rest—via Slack, Discord, email, or a sleek web dashboard. This isn't about trusting AI less. It's about trusting it intelligently.
Stop gambling with autonomous agents. Let's dive into how AgentGate keeps you in control.
What is AgentGate?
AgentGate is a human-in-the-loop approval system for AI agents. Born from the AgentKit ecosystem and created by Amit Paz, it solves one of the most critical gaps in modern AI infrastructure: who decides what your agent can actually do?
The repository lives at github.com/amitpaz1/agentgate and has quickly become a trending solution for teams building production-grade agent systems. Unlike brittle hardcoded permission systems, AgentGate introduces a policy engine that dynamically evaluates every agent action against configurable rules—auto-approving the harmless, auto-denying the dangerous, and escalating everything else to human reviewers.
Why is this exploding in popularity right now? Three forces are colliding:
- Agent capabilities are skyrocketing — GPT-4, Claude, and open-source models can now execute complex multi-step workflows with tool use
- Production deployments are scaling — Teams are moving from demos to real systems that touch real data and real money
- Regulatory pressure is mounting — EU AI Act, SOC 2, and enterprise procurement all demand explainable human oversight
AgentGate sits at this intersection. It's not another agent framework competing with LangChain or CrewAI. It's the governance layer that wraps around any agent system—giving you audit trails, approval workflows, and policy enforcement without rewriting your existing code.
The architecture is refreshingly clean: a Hono-based TypeScript server, SQLite or PostgreSQL↗ Bright Coding Blog storage, a React dashboard, and SDK/CLI/MCP integrations that slot into whatever you're already building. Docker-ready. Production-hardened with SSRF protection, ReDoS defense, and structured logging. This isn't a toy—it's infrastructure.
Key Features That Make AgentGate Insane
AgentGate isn't a basic "approve/reject" button slapped on a webhook. It's a comprehensive governance platform with depth that becomes apparent the moment you dig in.
🛡️ Policy Engine with Rule-Based Intelligence
The heart of AgentGate is its policy engine. You define rules with priorities, conditions, and decisions. A rule might auto-approve all send_email actions to internal domains, auto-deny any delete_database command, and route deploy_production to on-call engineers. Policies are stored in the database and hot-reloadable via API—no server restarts needed.
👥 Multi-Channel Human Approvals
Humans shouldn't have to babysit a dashboard. AgentGate meets them where they are: Slack DMs, Discord channels, email notifications, or the web dashboard. Each channel supports one-click decision links—approve or deny without logging into anything. The Slack and Discord bots are first-class packages, not afterthoughts.
🔌 Universal Integration: SDK, CLI, and MCP
AgentGate speaks every language your stack does. The TypeScript SDK drops into Node.js agents with five lines of code. The CLI enables scripting and CI/CD integration. The MCP server plugs directly into Claude Desktop, letting Claude itself request approvals through AgentGate. Framework-agnostic by design.
🪝 Webhooks with Exponential Backoff
Real-time notifications are useless if they fail silently. AgentGate's webhook system retries with exponential backoff (2^attempts * 1000ms), signs payloads with HMAC-SHA256, and provides full delivery tracking. Your external systems stay in sync even during transient failures.
📝 Immutable Audit Trail
Every request, every decision, every policy change is logged with timestamps, actors, and reasons. Search and filter by event type, action, actor, and date range. For compliance teams, this is gold. For debugging, it's essential.
🔐 Production-Hardened Security
SSRF protection prevents agents from using AgentGate to attack internal services. ReDoS defense guards against catastrophic regular expression backtracking. Graceful shutdown ensures in-flight requests complete cleanly. Structured logging with Pino gives you observability without noise.
Real-World Use Cases Where AgentGate Shines
1. Financial Operations Agents
Your agent monitors invoice payments and initiates wire transfers. Without AgentGate: a prompt injection or hallucination sends $100K to the wrong account. With AgentGate: transfers under $5K auto-approve based on vendor whitelist, larger amounts route to CFO Slack with one-click approval. Audit trail satisfies SOX requirements automatically.
2. DevOps↗ Bright Coding Blog and Infrastructure Automation
An agent manages Kubernetes deployments, database migrations, and incident response. Without AgentGate: it deletes a production namespace at 2 AM because a monitoring alert looked like a command. With AgentGate: kubectl delete commands always require human approval, scaling operations auto-approve within defined bounds, and rollback decisions escalate to the on-call engineer via PagerDuty-integrated webhooks.
3. Customer-Facing Support Bots
Your agent handles refunds, account modifications, and escalation routing. Without AgentGate: it grants unauthorized refunds to social engineering attacks. With AgentGate: refunds under $20 auto-approve for established customers, account closure requests require manager approval via email, and suspicious patterns trigger automatic policy blocks with fraud team notification.
4. Content Publishing and Social Media↗ Bright Coding Blog
An agent drafts and schedules posts across company channels. Without AgentGate: it publishes a controversial take during a sensitive news cycle. With AgentGate: posts with sentiment scores below threshold route to communications team, scheduled posts during crisis windows require explicit approval, and all published content has immutable audit history for legal discovery.
Step-by-Step Installation & Setup Guide
Ready to lock down your agents? AgentGate deploys in minutes, whether you're hacking locally or shipping to production.
Prerequisites
- Node.js 18+ and pnpm
- Docker and Docker Compose (for containerized deployment)
- A Slack or Discord bot token (optional, for chat integrations)
Local Development Setup
Step 1: Clone and install dependencies
git clone https://github.com/amitpaz1/agentgate.git
cd agentgate
pnpm install
Step 2: Initialize the database
pnpm --filter @agentgate/server db:migrate
This creates your SQLite database with the full schema—requests, policies, audit logs, API keys, and webhooks.
Step 3: Create your admin API key
pnpm --filter @agentgate/server bootstrap
Critical: Save the displayed API key immediately. It's shown once only. This key has full admin scope.
Step 4: Configure your environment
export AGENTGATE_API_KEY="agk_..."
Step 5: Start the development environment
pnpm dev
This launches the API server on port 3000 and the React dashboard on port 5173.
Step 6: Run the demo
# In a new terminal with API key set
export AGENTGATE_API_KEY="agk_..."
pnpm demo
Visit http://localhost:5173 to see pending approval requests in real-time.
Production Docker Deployment
For production, AgentGate provides a complete Docker Compose stack:
# 1. Copy and configure environment
cp .env.example .env
# 2. Generate secure secrets
echo "ADMIN_API_KEY=$(openssl rand -hex 32)" >> .env
echo "JWT_SECRET=$(openssl rand -hex 32)" >> .env
# 3. Launch the full stack↗ Bright Coding Blog
docker-compose up -d
Services deployed:
| Service | Port | Purpose |
|---|---|---|
| Server | 3000 | API and webhook receiver |
| Dashboard | 8080 | Nginx-served React UI |
| PostgreSQL | internal | Persistent data (not host-exposed in production) |
| Redis | internal | Rate limiting and queue processing |
Enable bot integrations:
# Add Slack/Discord tokens to .env first
docker-compose --profile bots up -d
Production hardening checklist:
- Use a reverse proxy (nginx, Caddy, Traefik) for TLS termination
- Restrict
CORS_ORIGINSto your domain - Mount secrets via Docker
_FILEvariables instead of plain env vars - Configure PostgreSQL backups for the data volume
- Monitor
/healthendpoint for uptime checks
REAL Code Examples from the Repository
Let's examine actual implementation patterns from AgentGate's codebase. These aren't toy examples—they're production patterns you can adapt immediately.
Example 1: SDK Integration for Agent Approval Flow
This is the core pattern: your agent creates a request, waits for human decision, then acts. From the SDK README:
import { AgentGateClient } from '@agentgate/sdk';
// Initialize client with server endpoint and authentication
const client = new AgentGateClient({
baseUrl: 'http://localhost:3000', // Your AgentGate server
apiKey: process.env.AGENTGATE_API_KEY, // Admin or scoped key
});
// Create an approval request before executing sensitive action
const request = await client.request({
action: 'send_email', // Identifier for the action type
params: {
to: 'customer@example.com',
subject: 'Order shipped!',
},
urgency: 'normal', // Affects notification priority and escalation
});
// Block execution until human reviews (with timeout to prevent indefinite hangs)
const decided = await client.waitForDecision(request.id, {
timeout: 60000, // 60 seconds; throws or returns 'expired' if exceeded
});
// Conditional execution based on human decision
if (decided.status === 'approved') {
// Safe to proceed—human explicitly authorized
await sendEmail(decided.params);
} else {
// Log denial reason for debugging and audit purposes
console.log('Action denied:', decided.decisionReason);
// Optionally: notify agent's error handler, retry with different params, etc.
}
What's happening here? The agent doesn't execute directly. It delegates the decision to AgentGate, which evaluates policies and potentially involves humans. The waitForDecision pattern is blocking by design—your agent pauses, consumes no resources, and resumes only when governance completes. The timeout prevents zombie agents from hanging forever.
Example 2: MCP Server Configuration for Claude Desktop
AgentGate's MCP integration lets Claude itself request approvals. Add this to your claude_desktop_config.json:
{
"mcpServers": {
"agentgate": {
"command": "npx", // Uses npx to run without global installation
"args": ["@agentgate/mcp"], // The MCP server package
"env": {
"AGENTGATE_URL": "http://localhost:3000", // Server endpoint
"AGENTGATE_API_KEY": "agk_..." // Scoped key for Claude's requests
}
}
}
}
Why this matters: Claude Desktop becomes a governed agent. When Claude wants to use a tool that maps to an AgentGate action, it transparently creates approval requests. Humans see these in their normal channels. The agent doesn't need custom code—it's pure configuration.
Example 3: CLI Workflow for Operations Teams
The CLI enables scripting and emergency interventions without writing code:
# Configure once
agentgate config set serverUrl http://localhost:3000
agentgate config set apiKey agk_your_api_key
# Create urgent request with structured parameters
agentgate request send_email \
--params '{"to": "user@example.com", "subject": "Hello"}' \
--urgency high
# Monitor queue status
agentgate list --status pending
# Direct approval with audit trail reason
agentgate approve req_abc123 --reason "Verified with customer via phone"
# Deny and document why
agentgate deny req_abc123 --reason "Not authorized—outside business hours"
# Export for compliance reporting
agentgate list --json > audit_export.json
Power user pattern: The --json flag enables pipeline integration. Pipe approvals into Slack notifications, feed denials into SIEM tools, or automate weekly compliance reports.
Example 4: Webhook Configuration for External Systems
// Create webhook with HMAC signature verification
POST /api/webhooks
{
"url": "https://your-server.com/webhook",
"events": ["request.created", "request.decided"], // Filter to relevant events
"secret": "whsec_..." // Shared secret for payload signing
}
Verification in your receiver:
import crypto from 'crypto';
function verifyWebhook(body: string, signature: string, secret: string): boolean {
const expected = crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(`sha256=${expected}`)
);
}
Resilience built-in: Failed deliveries retry automatically with exponential backoff. Your systems recover without manual intervention.
Advanced Usage & Best Practices
Policy Design Patterns
Start permissive, tighten gradually. Begin with auto_approve for everything and audit_log all requests. Analyze patterns for 48 hours, then implement targeted auto-deny rules for genuinely dangerous actions. This prevents approval fatigue that leads to rubber-stamping.
Use priority ordering strategically. AgentGate evaluates policies by priority (lower number = higher precedence). Place your most specific rules first, catch-all defaults last. A common pattern: emergency overrides (priority 1), explicit denylist (priority 10), department-specific rules (priority 50), default allow (priority 999).
Rate Limiting for Agent Safety
POST /api/keys
{
"name": "Production Agent",
"scopes": ["request:create"],
"rateLimit": 120 // 2 requests per second sustained
}
Agents gone haywire generate request spikes. Rate limiting contains blast radius. Monitor X-RateLimit-Remaining in your agent code to implement graceful degradation.
Secret Management in Production
Never commit .env files. Use Docker secrets or your platform's secret manager:
# docker-compose.yml
services:
agentgate:
environment:
ADMIN_API_KEY_FILE: /run/secrets/admin_api_key
secrets:
- admin_api_key
secrets:
admin_api_key:
file: ./secrets/admin_api_key.txt
AgentGate's _FILE suffix convention reads secrets from files at startup, keeping credentials out of environment dumps and process listings.
Comparison with Alternatives
| Feature | AgentGate | OPA/Gatekeeper | AWS IAM + Lambda | Custom Webhook |
|---|---|---|---|---|
| Purpose-built for AI agents | ✅ Native | ❌ Generic policy | ❌ Infrastructure focus | ⚠️ DIY |
| Human-in-the-loop UI | ✅ Dashboard + chat | ❌ None | ❌ None | ⚠️ Build yourself |
| Multi-channel approvals | ✅ Slack, Discord, email | ❌ None | ❌ None | ⚠️ Partial |
| Policy engine | ✅ Built-in | ✅ Powerful | ⚠️ IAM conditions only | ❌ None |
| Audit trail | ✅ Full history | ✅ With external store | ✅ CloudTrail | ⚠️ Your responsibility |
| MCP integration | ✅ Native | ❌ No | ❌ No | ❌ No |
| Self-hosted / air-gapped | ✅ Docker, SQLite | ✅ Yes | ❌ AWS only | ✅ Yes |
| Setup complexity | Low | High | Medium | High |
| Time to first approval | 5 minutes | Days | Hours | Weeks |
When to choose AgentGate: You need governance with human oversight specifically designed for agent workflows, not generic policy enforcement. The out-of-box dashboard, chat integrations, and MCP support eliminate months of custom development.
FAQ
Is AgentGate free for commercial use?
Yes. AgentGate is MIT licensed. Self-host without restrictions. The GitHub repository includes everything you need.
Does AgentGate work with Python↗ Bright Coding Blog agents or only TypeScript?
The SDK is TypeScript, but the REST API is language-agnostic. Python agents can use requests or httpx directly. Community Python SDK contributions are welcome.
Can I use AgentGate with LangChain, CrewAI, or AutoGPT?
Absolutely. AgentGate is framework-agnostic. Integrate at the tool-execution layer—before your agent calls external APIs, create an AgentGate request. The MCP server enables Claude Desktop integration without code changes.
How does AgentGate handle high-throughput scenarios?
SQLite handles thousands of requests per minute. For enterprise scale, switch to PostgreSQL (one env var change). The Hono server is lightweight and horizontally scalable behind a load balancer.
What happens if the AgentGate server goes down?
Design your agents with graceful degradation. The SDK throws on connection errors—catch these and implement circuit breakers or queue for retry. AgentGate's webhook retry handles its own delivery failures.
Is there a hosted/SaaS version?
Currently self-hosted only. This keeps your approval data in your infrastructure—critical for regulated industries. Monitor the repository for future announcements.
How do I contribute or report issues?
Fork github.com/amitpaz1/agentgate, follow the development setup, and open pull requests. All tests must pass (pnpm test) and code must be formatted (pnpm format:check).
Conclusion: Take Back Control of Your AI Agents
Autonomous agents are the future. Uncontrolled autonomous agents are a liability. AgentGate gives you the governance layer that lets you ship agent-powered features with confidence—automating the routine, escalating the risky, and never losing sight of who decided what.
The AgentGate repository is production-ready today: Docker deployment in five minutes, SDK integration in ten, and a policy engine that grows with your needs. Whether you're running financial operations, DevOps automation, or customer-facing bots, the pattern is the same—agents request, policies decide, humans approve.
Don't wait for your first agent incident to implement oversight. Star the repo, spin up the Docker Compose stack, and experience what controlled autonomy feels like. Your future self—and your compliance team—will thank you.