Skip to content

Repository files navigation

πŸ›‘οΈ AgentGate β€” AI Agent Security Firewall & Approval Hub

Deploy with Vercel Vite React TypeScript Supabase Tailwind CSS License

Security for the Autonomous Era: AgentGate is a real-time security firewall, command center, and approval hub for autonomous AI agents. Intercept, evaluate, and control high-risk agent actions before they execute in the real world.


🌟 Live Demo & Deployment


πŸ“– Overview

As autonomous AI agents (powered by LangChain, AutoGPT, CrewAI, or custom LLM loops) gain access to real-world APIs, databases, and financial endpoints, the risk of unmonitored actions increases exponentially.

AgentGate acts as an inline security gateway between your AI agents and external tools:

  1. Interception: Agents submit proposed actions to AgentGate before executing them.
  2. AI Evaluation: Built-in Sentry AI Evaluators stream risk assessments and determine whether an action is safe or high-risk.
  3. Human-in-the-Loop: High-risk actions are paused and routed to an interactive Approval Queue for human verification.
  4. Audit Trail: Every attempt, risk score, approval, and rejection is recorded in immutable database logs.

πŸ— System Architecture

flowchart TD
    subgraph Autonomous Environment
        A[Python / LangChain / CrewAI Agent]
    end

    subgraph AgentGate Security Platform
        B[Supabase Edge Function: submit-proposal]
        C{Sentry AI Evaluator}
        D[Approval Queue Dashboard]
        E[(Supabase Database: audit_log)]
        F[Supabase Edge Function: tool-executor]
    end

    subgraph External Systems
        G[REST APIs / Databases / SendGrid / Stripe]
    end

    A -->|1. Submit Proposed Action| B
    B -->|2. Stream Action Context| C
    C -->|Auto-Approved: Low Risk| F
    C -->|High Risk Flagged| D
    B -->|3. Log Decision Request| E
    D -->|4. Human Manager Approves / Rejects| E
    F -->|5. Safe Execution| G
Loading

✨ Key Features

  • πŸ›‘οΈ Real-Time Action Interception: Intercept dangerous actions (e.g. mass marketing blasts, budget changes, schema alterations) before execution.
  • 🧠 Sentry AI Risk Evaluator: Server-sent events (SSE) stream step-by-step reasoning from evaluator LLMs analyzing action risk.
  • 🚦 Human Approval Queue: Clean, intuitive interface for security admins to review risk justifications, inspect parameters, and approve or reject pending requests.
  • πŸ“Š Analytics Dashboard: Real-time stats on total active agents, pending proposals, trust scores, and system health metrics.
  • πŸ€– AI Agent Builder & Wizard: Prompt-based generator that crafts custom agent specifications, system prompts, and security policies.
  • πŸ”Œ Tools & Data Sources Registry: Manage REST read/write tools, database connections, and Bright Data zone configurations.
  • πŸ“œ Comprehensive Audit Logging: Filterable, immutable ledger of all agent activities and human interventions.
  • 🐍 Python SDK & API Integration: Simple REST endpoint integration compatible with any Python LLM framework.

πŸ›  Tech Stack

Frontend

Backend & Storage

  • Database: Supabase PostgreSQL with Row Level Security (RLS)
  • Serverless Functions: Supabase Edge Functions (Deno / TypeScript)
  • AI Provider Integrations: AIML API / OpenAI / Anthropic compatible endpoints

πŸ“ Repository Structure

AgentGate/
β”œβ”€β”€ index.html                   # HTML Entry point
β”œβ”€β”€ package.json                 # Frontend dependencies & scripts
β”œβ”€β”€ tsconfig.json                # TypeScript configuration
β”œβ”€β”€ vite.config.ts               # Vite build configuration
β”œβ”€β”€ vercel.json                  # Vercel SPA routing rules
β”œβ”€β”€ .vercelignore                # Vercel deployment exclusions
β”œβ”€β”€ demo_agent.py                # Python SDK integration test script
β”œβ”€β”€ requirements.txt             # Python dependencies for demo script
β”œβ”€β”€ public/                      # Static assets & icons
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.tsx                  # Client router & navigation structure
β”‚   β”œβ”€β”€ main.tsx                 # React entry point
β”‚   β”œβ”€β”€ index.css                # Master Tailwind & glassmorphism theme
β”‚   β”œβ”€β”€ components/              # Core UI components & step wizards
β”‚   β”œβ”€β”€ context/                 # Application context providers
β”‚   β”œβ”€β”€ constants/               # Global configuration constants
β”‚   β”œβ”€β”€ lib/                     # Supabase client & Edge Function helpers
β”‚   └── pages/                   # Application views
β”‚       β”œβ”€β”€ LandingPage.tsx      # High-impact Hero landing page
β”‚       β”œβ”€β”€ Dashboard.tsx        # Command Center dashboard
β”‚       β”œβ”€β”€ ApprovalQueue.tsx    # Human approval management
β”‚       β”œβ”€β”€ AuditLog.tsx         # Immutable decision logs
β”‚       β”œβ”€β”€ Agents.tsx           # Active agent list & trust scores
β”‚       β”œβ”€β”€ BuilderAgents.tsx    # Agent builder hub
β”‚       β”œβ”€β”€ AgentBuilderWizard.tsx # Multi-step agent setup
β”‚       β”œβ”€β”€ AgentDetail.tsx      # Single agent breakdown & telemetry
β”‚       β”œβ”€β”€ BuilderTools.tsx     # Tool integration registry
β”‚       └── BuilderDataSources.tsx # Data source connections
└── supabase/
    β”œβ”€β”€ migrations/              # Database schema definition files
    └── functions/               # Serverless Edge Functions
        β”œβ”€β”€ build-agent/         # AI-assisted agent prompt generator
        β”œβ”€β”€ generate-proposal/   # Mock proposal generator for testing
        β”œβ”€β”€ resolve-approval/    # Approval status update handler
        β”œβ”€β”€ run-agent/           # Agent execution loop
        β”œβ”€β”€ sentry-orchestrator/ # Multi-agent AI risk evaluation stream
        β”œβ”€β”€ submit-proposal/    # External agent action interception endpoint
        └── tool-executor/      # Controlled REST tool runner

πŸš€ Getting Started

Prerequisites

  • Node.js: v18.0.0 or higher
  • npm: v9.0.0 or higher
  • Python: 3.9+ (optional, for running demo_agent.py)

1. Clone & Install

# Clone the repository
git clone https://github.com/ranazain9/AgentGate.git
cd AgentGate/AgentGate

# Install dependencies
npm install

2. Configure Environment Variables

Create a .env file in the project root based on .env.example:

VITE_SUPABASE_URL=https://<your-supabase-ref>.supabase.co
VITE_SUPABASE_ANON_KEY=<your-supabase-anon-key>

3. Run Development Server

npm run dev

Open http://localhost:5173 in your browser to launch AgentGate.

4. Build for Production

npm run build

The output bundle will be generated inside the dist/ directory.


🐍 Python Agent Integration Example

Autonomous agents can request permission from AgentGate via a simple HTTP POST request:

import requests

AGENTGATE_WEBHOOK = "https://<your-supabase-ref>.supabase.co/functions/v1/submit-proposal"
API_KEY = "your-agent-api-key"

response = requests.post(
    AGENTGATE_WEBHOOK,
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "agentName": "marketing-agent",
        "action": "Execute 50% discount blast to 850,000 users via SendGrid API",
        "riskJustification": "Boost Q3 sales despite exceeding daily promo limit of $500"
    }
)

result = response.json()

if result.get("status") == "APPROVED":
    print("βœ… Auto-approved by Sentry AI! Executing action...")
elif result.get("status") == "PENDING_APPROVAL":
    print("⏳ High risk detected! Action routed to AgentGate Approval Queue.")

Run the provided demonstration script:

pip install -r requirements.txt
python demo_agent.py

🌐 Deploying to Vercel

Option 1: Vercel CLI (Quickest)

npx vercel --prod

Option 2: Vercel Dashboard (GitHub Integration)

  1. Import your GitHub repository (ranazain9/AgentGate) in Vercel.
  2. Set Root Directory to AgentGate (if deploying from a nested folder).
  3. Configure the required Environment Variables:
    • VITE_SUPABASE_URL
    • VITE_SUPABASE_ANON_KEY
  4. Click Deploy.

πŸ“œ License & Acknowledgments

This project was built for the AI Factory Hackathon presented by lablab.ai.

Distributed under the MIT License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages