Skip to main content

agentgate

The security gateway for AI agents. Enforce authentication, rate limiting, and policy controls between users and AI agents — in one line of code.

Install

pip install agentgate

With LangChain:

pip install "agentgate[langchain]"

With OpenAI Agents SDK:

pip install "agentgate[openai]"

Everything:

pip install "agentgate[all]"

Quickstart

Get your free API key at https://agent-gate-rho.vercel.app/

Any agent (generic)

from agentgate import with_agent_gate, AgentGateOptions

secured = with_agent_gate(my_agent, AgentGateOptions(
    api_key="ag_your_key_here"
))
result = secured.run("delete_file", {"path": "/etc/passwd"})

LangChain

from agentgate import AgentGateLangChainCallback, AgentGateOptions
from langchain.agents import AgentExecutor

callback = AgentGateLangChainCallback(
    AgentGateOptions(api_key="ag_your_key_here")
)
agent_executor = AgentExecutor(
    agent=agent,
    tools=tools,
    callbacks=[callback],
)

OpenAI Agents SDK

from agentgate import wrap_openai_agent, AgentGateOptions
from agents import Agent, Runner

secured = wrap_openai_agent(agent, AgentGateOptions(
    api_key="ag_your_key_here"
))
result = await Runner.run(secured, "Send email to all users")

MCP middleware

from agentgate import AgentGateMiddleware, AgentGateOptions

gate = AgentGateMiddleware(AgentGateOptions(api_key="ag_your_key_here"))

# Inline check
result = gate.check("send_email", args, lambda: send_email(args))

# As a decorator
@gate.guard()
def delete_user(user_id: str):
    ...

Fail-open vs Fail-closed

# Development (default)
AgentGateOptions(api_key="ag_xxx", on_network_error="fail-open")

# Production (recommended)
AgentGateOptions(api_key="ag_xxx", on_network_error="fail-closed")

Policy decisions

Decision Behaviour
ALLOW Tool executes normally
DENY Tool blocked, error string returned
REQUIRE_APPROVAL Tool paused, human approves in dashboard

Links

Dashboard: https://agent-gate-rho.vercel.app/ GitHub: https://github.com/wiserautomation/agentgate Issues: https://github.com/wiserautomation/agentgate/issues

Metadata

Release files for agentgate-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentgate-sdk 0.1.0
File Size Uploaded
agentgate_sdk-0.1.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentgate-sdk 0.1.0
File Interpreter ABI Platform
agentgate_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / agentgate_sdk-0.1.0.tar.gz

Download URL agentgate_sdk-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
79da5cc8f73420ba61192a54932d76c41c860cd588c4b0db1ee92b0d134f87f2
BLAKE2b-256 checksum
How to use checksums
bbea4edfe7a9b111b1f35a8fe0de73a09e56c658a618c34b3ba134398f39c9e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / agentgate_sdk-0.1.0-py3-none-any.whl

Download URL agentgate_sdk-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d97478aba3933b4117424c38f4326ec2393ec466abc5c38c1e1a7dc8ae9afa3
BLAKE2b-256 checksum
How to use checksums
861a6e409e2b77da1aa3cd50c1ff3d3ece5e5ff6b2c3b0b5fffd72d54e128d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page