Catalog PyPI
PACKAGE EXPLORERView in registry

agentgate-firewall

PyPI

Firewall for AI coding agents. Intercepts Bash/Read/Write/Edit, blocks outbound HTTP, asks humans via Slack/Telegram for risky ops. Works with Claude Code, Cursor, Continue.dev, Aider, and GitHub Actions.

agentaianthropicclaude-codeclifirewallpolicy-as-codesecurity
Versions collected1
Direct dependencies5From release 0.14.0
Last observed20 Oct, 22:01 UTC

README

Version 0.14.0 documentation

AgentGate — Firewall for AI Coding Agents

PyPI version CI License: Apache 2.0

AgentGate sits between AI coding agents (Claude Code, Cursor, Continue.dev, Aider, Gemini CLI, OpenAI Codex) and your machine. It intercepts every Bash / Read / Edit / Write call, applies a policy, scans outgoing HTTP for data-exfiltration patterns, and asks a human via Telegram / Discord / Slack when the call is risky.

Why

Without AgentGateWith AgentGate
Agent can rm -rf / with no warningDeny rules block destructive ops before they run
Agent can leak API keys to pastebin.comDLP scanner rejects outgoing bodies containing sk-ant-…
Agent can fetch arbitrary URLsAllowlist / blocklist of domains
No record of what the agent didTamper-evident SQLite audit chain, optionally Ed25519-signed
Prompt-injection payloads slip through28+ injection patterns scanned on every request

Install

pip install agentgate-firewall
agentgate doctor        # check pre-requisites
agentgate init          # write a starter policy.yaml
agentgate start         # launch the proxy on :18790

Then install the Claude Code / Cursor / Aider hook:

agentgate install-hook           # Claude Code
agentgate install-cursor-hook    # Cursor
agentgate install-continue-hook   # Continue.dev
agentgate install-aider-hook      # Aider
agentgate install-gemini-hook     # Gemini CLI
agentgate install-codex-hook      # OpenAI Codex CLI

Policy example

version: 1
default: deny

rules:
  # Read access to dotfiles is OK
  - id: allow-read-configs
    match: {tool: Read, file_glob: "~/.config/*"}
    action: allow

  # Block destructive Bash commands
  - id: deny-rm-rf
    match: {tool: Bash, command_regex: "rm\\s+-[rf]+.*"}
    action: deny
    reason: "Recursive delete blocked"

  # Allow `kubectl apply` but require human approval
  - id: ask-kubectl-apply
    match: {tool: Bash, command_regex: "kubectl apply.*"}
    action: ask

  # CEL-lite `when` conditions
  - id: deny-rm-elsewhere
    match: {tool: Bash, command_regex: "rm -rf.*"}
    action: deny
    when: 'event.cwd != "/srv"'

  # Rate-limit noisy rules
  - id: ask-deploy
    match: {tool: Bash, command_regex: "kubectl apply.*"}
    action: ask
    rate_limit: {capacity: 5, refill_per_sec: 0.1}

network:
  allowed_domains:
    - "*.github.com"
    - "*.anthropic.com"
    - "registry.npmjs.org"
  require_https: true

Subcommands

CommandPurpose
agentgate startRun the mitmproxy-based intercept proxy
agentgate scanStatic security scanner for AI agent configs
agentgate auditRead the audit log
agentgate audit verifyVerify the SHA-256 audit chain
agentgate receipts verifyVerify Ed25519-signed receipts
agentgate coverageDead-rule + uncovered-tool report
`agentgate env adduse
agentgate policy testReplay events against a policy (dry-run)
agentgate doctorPre-flight health check

Security features

  • Bash/Read/Edit/Write intercept — every tool call passes through policy.evaluate().
  • CEL-lite when — gate matches on event fields (event.cwd != "/srv").
  • Token-bucket rate limiting — per-rule throttling without bricking the agent.
  • DLP egress scan — 50+ API-key patterns, JWTs, private keys, DB connection strings.
  • Prompt-injection scanner — 28+ markers (ignore previous instructions, role overrides, etc.).
  • Network allow/block lists — domain + HTTPS enforcement + per-rule exemptions.
  • Tamper-evident audit chain — SHA-256 chained rows; integrity verifiable.
  • Ed25519-signed receipts — optional cryptographic proof of audit entry provenance.
  • HMAC-signed webhooks — verify callbacks actually came from AgentGate.
  • Multi-channel approval — Telegram / Discord / Slack / approval server / file.
  • Multi-environment manager — dev / staging / prod switching.

Supported agents

AgentHookInstall
Claude CodePreToolUse → JSONagentgate install-hook
CursorbeforeShellExecutionagentgate install-cursor-hook
Continue.devbeforeCommand etc.agentgate install-continue-hook
Aiderpre-commit adapteragentgate install-aider-hook
Gemini CLIBeforeToolagentgate install-gemini-hook
OpenAI Codex CLIBefore hookagentgate install-codex-hook

Contributing

See CONTRIBUTING.md. Run agentgate doctor first to verify your environment.

License

Apache 2.0 — see LICENSE.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.14.015 Aug 20265

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
felixma01/agentgate

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:01 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:59b597cd8fb690f3424957b48b9d9707660f825524965943fae96c571116d9e9