Skip to main content

External effect-admission gate for LLM-agent frameworks (Rust core, Python bindings)

Project description

SOUNDGATE for Python

Use the SOUNDGATE effect-admission gate from Python LLM-agent frameworks (LangGraph, LlamaIndex, CrewAI, OpenAI Agents SDK, …). Two options:

Option A — pure-Python client (zero build)

No Rust toolchain needed. Run the soundgate gate binary, then:

from soundgate_client import GateClient
gate = GateClient(("127.0.0.1", 8796))            # secret=b"..." if the gate has one
v = gate.submit("run1", "send_email", needs_approval=True)
if v.released:
    send_the_email()

Files: soundgate_client.py. This talks the exact JSON/TCP protocol of the gate server and computes the same HMAC-SHA256 decision tag.

Option B — native PyO3 extension (pip install soundgate)

A compiled Rust extension with an identical API, plus an optional in-process mode. Build:

pip install maturin
cd soundgate && maturin develop --release --features python
from soundgate import GateClient, Gate, decision_tag
gate = GateClient("127.0.0.1:8796")     # external gate — recommended
# or, in-process (shares the agent's address space; see below):
g = Gate(); g.submit("run1", "x", True)

See INSTALL_pyo3.md for the three crate edits and build details.

Which mode?

Isolation Latency Deploy Use when
GateClient (external) Full — gate is a separate process; namespace/eBPF mediation holds one socket round-trip (~53 µs) run the gate binary default / production
Gate (in-process) Reduced — gate shares the agent's memory function call none single-process / low-stakes

The external client preserves the paper's environment-external reference-monitor model. The in-process Gate is faster and simpler but forgoes that isolation.

API (both clients)

  • submit(run_id, effect_key, needs_approval=False) -> Verdict
  • decide(run_id, effect_key, approved) -> Verdict (signed if a secret is set)
  • cancel(run_id) -> Verdict
  • ping() -> Verdict
  • Verdict: .released, .held, .refused, and v == "release"
  • decision_tag(secret, run_id, effect_key, approved) -> str

Verified

test_protocol.py drives the pure-Python client against a mock gate that reimplements the admission core, checking all four properties (hold-until- decided, reject-stickiness, dedup-on-replay, fence-on-cancel), cross-run key independence, HMAC-authenticated decisions, forged-MAC rejection, and the decision-tag byte format. All pass. The PyO3 GateClient sends the identical protocol and reuses hmac.rs, so the same guarantees apply.

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

soundgate-0.1.3.tar.gz (320.1 kB view details)

Uploaded Source

Built Distributions

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

soundgate-0.1.3-cp38-abi3-win_amd64.whl (211.5 kB view details)

Uploaded CPython 3.8+Windows x86-64

soundgate-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (308.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

soundgate-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (292.8 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

soundgate-0.1.3-cp38-abi3-macosx_11_0_arm64.whl (277.1 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file soundgate-0.1.3.tar.gz.

File metadata

  • Download URL: soundgate-0.1.3.tar.gz
  • Upload date:
  • Size: 320.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for soundgate-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4c4297d1c58b39d58947d81520a44ede2068f90741f8ffb56facf5a10fde6e5e
MD5 e4f7dfef1ffe0c9f0604803ed2ab8fbe
BLAKE2b-256 434409843e0cc104e036269943bb995e10033b2d682953d77293d71cb5ed45f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for soundgate-0.1.3.tar.gz:

Publisher: release.yml on sajjadanwar0/soundgate-paper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file soundgate-0.1.3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: soundgate-0.1.3-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 211.5 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for soundgate-0.1.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 489465f1a3b4448d4fc6d76705fedd3f2103971ea6204a6938fbeaba1ca2b77e
MD5 764e621b575e05743bc1480f52518b8b
BLAKE2b-256 0562868e8245edddd8e84f3c66b00f896e4e67cc49365b17cf4b4620f54390a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for soundgate-0.1.3-cp38-abi3-win_amd64.whl:

Publisher: release.yml on sajjadanwar0/soundgate-paper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file soundgate-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for soundgate-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db7d01201565d33b060250f839b40ef7168043697070ade8ec2fafccc8adbfd7
MD5 14d89fc1c629f89952b78071cc8c62c9
BLAKE2b-256 372263fe453316406b6625c97236a947d67f5bd84f9a507192bb3db9765b92bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for soundgate-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on sajjadanwar0/soundgate-paper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file soundgate-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for soundgate-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 768bc99f803160f73bd61f2d82fb6786a2665c044b97cb5527eb870124630e9a
MD5 a2faf9d3f26a29496cbeb3592531681b
BLAKE2b-256 428bfe3a53189914b97cc80e1b57376b05700019be1bf3b42f30d070814748c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for soundgate-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on sajjadanwar0/soundgate-paper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file soundgate-0.1.3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for soundgate-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac6eab23d33dbb6311b39c95f13b0ed34e31a52c8804432d2b2db39852bdc558
MD5 2ce1a94c31eecbad7267c5f1ef6c1d5a
BLAKE2b-256 5a0176f70c611d61b214593b5097a30ffa99d130c691decb7a1c5e2f1288af99

See more details on using hashes here.

Provenance

The following attestation bundles were made for soundgate-0.1.3-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on sajjadanwar0/soundgate-paper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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