Skip to main content

Stdlib-only Python client for the Sovest Agent Honesty Firewall HTTP surface (claim <= evidence, action <= authority).

Project description

sovest-firewall (Python SDK)

Stdlib-only Python client for the Sovest Agent Honesty Firewall HTTP surface. It calls one pre-action gate before your agent does anything consequential.

Honest claim ceiling: the firewall enforces a policy — claim ≤ evidence, action ≤ authority. It does not make an agent correct, safe, or aligned, and it is not a guarantee of safe outcomes. It blocks unsupported claims from becoming actions and makes admitted ones scoped, verifiable, disputable, and correctable.

Status: v0.1.0. Not yet published to PyPI. Dependency-free (uses urllib from the standard library). Requires Python >= 3.9.

Install

From this directory (editable install):

pip install -e .

That exposes the sovest_firewall package importably. No third-party packages are pulled in.

Usage

from sovest_firewall import FirewallClient, NotAdmitted, guard

fw = FirewallClient("http://127.0.0.1:8787")

# 1. Get a verdict (never raises on a refusal — the refusal IS the answer):
v = fw.check(
    claim_text="Refund approved for order 4821",
    claim_type="LIVE_PROCESS",
    scope="refunds:order_4821",
    requested_action="REFUND_APPROVE",
    action_impact="consequential",
    evidence_refs=["sha256:order_record", "sha256:customer_chatlog"],
    authority_refs=["refund_policy_v2"],
)
print(v["verdict"], v["admitted"])

# 2. Admit + record (returns the receipt, raises NotAdmitted on refusal):
try:
    receipt = fw.admit(
        claim_text="Refund approved for order 4821",
        scope="refunds:order_4821",
        requested_action="REFUND_APPROVE",
        action_impact="consequential",
        evidence_refs=["sha256:order_record"],
        authority_refs=["refund_policy_v2"],
    )
    print(receipt["admissibility_id"])
except NotAdmitted as e:
    print("refused:", e.verdict["reason"])

# 3. Guard a callable — runs it ONLY if the firewall admits the action:
def do_refund():
    ...  # the real side effect
result = guard(
    do_refund, fw,
    claim_text="Refund approved for order 4821",
    scope="refunds:order_4821",
    requested_action="REFUND_APPROVE",
    evidence_refs=["sha256:order_record"],
    authority_refs=["refund_policy_v2"],
)

API surface (stable for v0.1.0)

symbol purpose
FirewallClient(base_url, timeout) client bound to a firewall server
.check(**fields) -> dict get a verdict; does not raise on refusal
.admit(**fields) -> dict admit + record; raises NotAdmitted on refusal
.build_request(path, fields) build the urllib request without sending (offline tests)
guard(action, client, **fields) run action only if admitted
NotAdmitted exception carrying the full refusal verdict (.verdict)
FirewallError transport / unexpected-status error

Running the examples and checks

  • examples/quickstart.py — runnable end-to-end when a firewall server is up (start python3 ../../server.py first), prints the verdict.
  • tests/test_offline.py — offline check; constructs a client and validates request serialization (URL, method, headers, JSON body) with no network call.

See SDK_PY_CHECK.txt for captured proof of the import + offline checks.

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

sovest_firewall-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

sovest_firewall-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sovest_firewall-0.1.0.tar.gz
Algorithm Hash digest
SHA256 145e9787f6a07ba7f95c314aaa52abd90a264a179660e6a7a6926b80b6819f01
MD5 7e25a3bbbb5c918bd516039ccd7aa9ac
BLAKE2b-256 52c243abea4c3a42ccadda629639033c8a4e7bf67b351943c7077e11730bacb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sovest_firewall-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20cadf59f23ab3d67b980157661d5536a3fce2bc8fab326a02f1d746f26442eb
MD5 a9d1cd71f523c5a23d82d73362ff1ba4
BLAKE2b-256 f6bf4ce20ce7198428c8d8791f048c2cf35be88f0ab1ac7a13ed6061f5f16fd1

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