Skip to main content

Official Python SDK for the Enforgate MCP gateway — action-boundary security for AI agents.

Project description

enforgate (Python)

Official Python SDK for the Enforgate gateway — action-boundary security for AI agents. Pure standard library, no dependencies.

Install

pip install enforgate   # once published; for now: pip install -e packages/sdk-python

Usage

import os
from enforgate import EnforgateClient, EnforgateError

client = EnforgateClient(
    api_key=os.environ["ENFORGATE_API_KEY"],
    base_url=os.environ.get("ENFORGATE_GATEWAY_URL", "http://localhost:3000"),
)

# Advisory check — get a verdict, decide what to do.
verdict = client.check("demo", "send_email", {"to": "person@example.com"})
print(verdict.decision, verdict.reason)

# Or guard inline — raises EnforgateError unless the call is allowed.
try:
    client.guard("demo", "delete_file", {"path": "/etc/passwd"})
    do_the_thing()
except EnforgateError as err:
    print("blocked:", err)

check() returns a CheckResult with decision (allow / deny / require_approval), reason, policy_id, tool_call_id, latency_ms, and a convenience .allowed property.

Arguments are evaluated at the gateway in memory only — they are never stored; the audit log keeps a hash. See the main docs for the enforcing MCP-proxy mode.

Project details


Download files

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

Source Distribution

enforgate-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

enforgate-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for enforgate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 04afac282ba3d7ce62588d5697ab4e6cf59ebebfa65e5a56e738957539685282
MD5 0deac038331cc59e65354f75679ebd19
BLAKE2b-256 b718b05b2fa0c278ba348e50c51602474c9f22770e93d51b4309d21add652e3f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for enforgate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05dc254cb1d84cae48616d2e5a347be9c429338b6b82f2a9294f030c15e280b9
MD5 70b54eea8cf600a4be1e66b53798027a
BLAKE2b-256 e301a9317b7e4f5b9938f08ea523edb1d5fa50fa5610691f0038ee77cb8cf42f

See more details on using hashes here.

Supported by

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