Skip to main content

The Execution Firewall for AI Agents - Official Python SDK for SOVR

Project description

SOVR SDK for Python

The Execution Firewall for AI Agents — Official Python SDK for SOVR.

SOVR is the Responsibility Layer that sits between AI intent and real-world execution, providing policy enforcement, decision auditing, and trust verification for autonomous AI systems.

Installation

pip install sovr-sdk

Quick Start

from sovr_sdk import SOVRClient

# Initialize client
client = SOVRClient(
    api_key="your-api-key",
    tenant_id="your-tenant-id",
    endpoint="https://sovr.inc"
)

# Evaluate a decision
result = client.evaluate_decision(
    action="payment",
    resource="order/12345",
    context={"amount": 1000, "currency": "USD"}
)

print(f"Verdict: {result.verdict}")
print(f"Risk Score: {result.risk_score}")
print(f"Value Score: {result.value_score}")

# Act on the decision
if result.verdict == "approved":
    print("✓ Action approved, safe to execute")
elif result.verdict == "pending_approval":
    print("⏳ Human approval required")
else:
    print("✗ Action blocked")

Core Features

Decision Evaluation

result = client.evaluate_decision(
    action="payment",
    resource="order/12345",
    context={"amount": 1000},
    metadata={"trace_id": "abc123"}
)

Trust Bundle Management

# Create a trust bundle
bundle = client.create_trust_bundle(
    name="Payment Decision Bundle",
    description="Evidence package for order #12345 payment decision"
)

# Add evidence
client.add_evidence(
    bundle_id=bundle.id,
    evidence_type="document",
    content={"title": "Contract", "url": "https://..."},
    weight=0.3
)

# Evaluate sufficiency
evaluation = client.evaluate_sufficiency(bundle.id)
print(f"Sufficiency Score: {evaluation.score}")

Audit Log Query

# Query audit logs
logs = client.get_audit_logs(
    start_date="2026-01-01",
    end_date="2026-01-25",
    limit=100
)

for log in logs:
    print(f"{log.created_at}: {log.event_type} - {log.action}")

Environment Variables

The SDK supports configuration via environment variables:

export SOVR_API_KEY="your-api-key"
export SOVR_TENANT_ID="your-tenant-id"
export SOVR_API_ENDPOINT="https://api.sovr.example.com"
# Automatically reads from environment variables
client = SOVRClient()

Error Handling

from sovr_sdk.exceptions import SOVRError, AuthenticationError, RateLimitError

try:
    result = client.evaluate_decision(...)
except AuthenticationError:
    print("Authentication failed. Please check your API key.")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds.")
except SOVRError as e:
    print(f"SOVR Error: {e.message}")

Documentation

License

MIT License

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

sovr_sdk-7.0.1.tar.gz (55.2 kB view details)

Uploaded Source

Built Distribution

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

sovr_sdk-7.0.1-py3-none-any.whl (49.4 kB view details)

Uploaded Python 3

File details

Details for the file sovr_sdk-7.0.1.tar.gz.

File metadata

  • Download URL: sovr_sdk-7.0.1.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for sovr_sdk-7.0.1.tar.gz
Algorithm Hash digest
SHA256 4941665d208b16539f728a5a1d3ba972c524f186fa9eb62209dde790f3f76349
MD5 6a24120b8b3672db9ad04de92ddc9f21
BLAKE2b-256 d200317e5bca7535a56af5ca0b0f89b05acad6638fcc5fc0b058801f971dbefe

See more details on using hashes here.

File details

Details for the file sovr_sdk-7.0.1-py3-none-any.whl.

File metadata

  • Download URL: sovr_sdk-7.0.1-py3-none-any.whl
  • Upload date:
  • Size: 49.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for sovr_sdk-7.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 691a73c8db99f3da112176a5982d02391f9f11ffd1e20f936dfe33e560147a0d
MD5 ee5077e11c2006a029e91d1830414695
BLAKE2b-256 9a17f227e2aa3d682e64efbd8a95b9f0c3967c9d865cf213d48a54b21b9eb745

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