Skip to main content
Glama

AgentGate — Identity, Permissions & Safe-Web Gateway for AI Agents

AgentGate is a FastAPI gateway and MCP server that gives AI agents verifiable identity, scoped permissions, hard spending caps, human-in-the-loop approvals, and a sanitized web-browsing layer that uses Olostep for reliable page extraction and AgentGate's own middleware for prompt-injection defense.

Project Scope

  • Who it is for: Developers and teams deploying autonomous AI agents that browse the web, call APIs, or spend money on behalf of users.

  • What it does: Sits between an AI agent and external tools/websites to enforce identity, budgets, domain rules, prompt-injection filtering, and human approval before high-risk actions execute.

Related MCP server: suprawall

AI Tools, Models & Libraries Used

  • Backend & Validation: FastAPI, Pydantic, SQLModel (SQLite)

  • Web Layer for Agents: Olostep Python SDK

  • Demo Agent & Orchestration: Pydantic AI, Model Context Protocol (MCP)

  • LLM Models: Gemini 3.5 Flash Lite / Gemini Flash Lite (via Google AI Studio API)

  • Testing & Evaluation: Keploy, custom Python red-team eval harness


Getting Started & Setup

1. Prerequisites

  • Python: Version 3.12+ (or 3.14 via uv)

  • API Keys:

    • Gemini API Key: Obtain a free key from Google AI Studio.

    • Olostep API Key: Obtain an API key from Olostep for reliable web extraction.


2. Setup

Clone the repository and navigate into the project directory:

git clone https://github.com/priyanshux-git/agent_gate.git
cd agent_gate

Option A: Using uv (Recommended)

uv sync

Option B: Using standard Python venv and pip

python -m venv .venv

# On Windows (PowerShell):
.venv\Scripts\Activate.ps1
# On Linux/macOS:
source .venv/bin/activate

pip install "fastapi[standard]>=0.165.0" "olostep>=1.2.3" "pydantic-ai>=2.71.0" python-dotenv httpx

3. Environment Configuration

Copy the example .env file and configure your credentials:

cp .env.example .env

Update .env with your API keys:

OLOSTEP_API_KEY=your_olostep_api_key_here
GEMINI_API_KEY=your_gemini_api_key_here

4. Running the Project

Step 1: Start the FastAPI Gateway Server

In your first terminal, launch the gateway:

# Using uv:
uv run fastapi dev

# Or with virtual environment activated:
fastapi dev
  • Gateway URL: http://127.0.0.1:8000

  • Interactive Swagger Docs: http://127.0.0.1:8000/docs

  • Proxy Endpoint: POST /v1/proxy/fetch

Step 2: Run the Demo Research Agent

In a separate terminal, run the Pydantic AI research agent test script:

# Using uv:
uv run python agent_test.py

# Or with virtual environment activated:
python agent_test.py

This runs two test cases:

  1. TEST 1 (Allowed Domain): The agent routes a request through AgentGate to scrape https://books.toscrape.com/ and extracts the first two book titles.

  2. TEST 2 (Blocked Domain): The agent attempts to access an unapproved domain (https://evil-unapproved-site.com/), which is rejected by the gateway with HTTP 403 Forbidden.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Provides a trust and governance layer for AI agents, enabling secure API access, credential vaulting, paid execution with human approval, and automatic call resume.
      2
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables deterministic zero-trust security for AI agents, providing prompt injection protection, PII scrubbing, and policy enforcement before agentic actions reach production systems.
      2
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to securely invoke tools by enforcing identity proof, capability verification, and risk scoring on every request, blocking unsafe calls before they execute.
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enforces policy controls for AI agents, including spend limits, action approvals, kill switch, scoped credentials, dry-run diffs, loop prevention, and auditable hash-chained logs.
      MIT