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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentgate_sdk-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentgate_sdk-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file agentgate_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: agentgate_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for agentgate_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 79da5cc8f73420ba61192a54932d76c41c860cd588c4b0db1ee92b0d134f87f2
MD5 25c8dd0f0d5f5b1ea66931525ff6d6f0
BLAKE2b-256 bbea4edfe7a9b111b1f35a8fe0de73a09e56c658a618c34b3ba134398f39c9e5

See more details on using hashes here.

File details

Details for the file agentgate_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentgate_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for agentgate_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d97478aba3933b4117424c38f4326ec2393ec466abc5c38c1e1a7dc8ae9afa3
MD5 139d92ddf4df94cbefd5dfceae307c7f
BLAKE2b-256 861a6e409e2b77da1aa3cd50c1ff3d3ece5e5ff6b2c3b0b5fffd72d54e128d08

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page