Skip to main content

sovereign-sdk-airlock

Model-neutral outbound governance boundary for the Sovereign Systems SDK.

Inspects, evaluates, minimises, and records structured payloads before they cross a sovereign perimeter and enter an external computational system.


Architecture

sovereign-sdk-airlock implements the four-component lifecycle defined in the Airlock Specification (SAR-0004):

Component Responsibility
Boundary Interception Capture normalised outbound payloads; transport-agnostic
Policy Engine Evaluate local YAML governance rules (raw, fields, telemetry scopes)
Sieve Convergence Deterministic context minimisation via sovereign-sdk-sieve
Evidence Generation Immutable ForensicReceipt committed to sovereign-sdk-ledger

Quick Start

import asyncio
from sovereign_ledger import SovereignLedger
from sovereign_airlock import AirlockBoundary, normalize_openai

ledger = SovereignLedger(".keys/sovereign_audit.db")
boundary = AirlockBoundary(
    policy_path="policy.yaml",
    signing_key=".keys/",
    ledger=ledger,
)

request = {
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Analyse the quarterly report."}],
}

async def main():
    result = await boundary.process(normalize_openai(request))
    print(result.sieved_content)
    print(result.telemetry.tax_savings_percentage, "% Prose Tax savings")
    print(result.receipt["metadata"]["payload_hash"])  # raw pre-sieve content hash

asyncio.run(main())

Policy Configuration

version: "1.0"

global:
  max_token_ceiling: 40000
  prose_tax_warning_threshold: 0.35

rules:

  - name: block_private_keys
    scope: raw
    pattern: "-----BEGIN PRIVATE KEY-----"
    action: deny

  - name: guard_internal_namespaces
    scope: fields
    fields:
      - messages.content
      - tools.description
    pattern: "internal\\.sovereign\\.local"
    action: warn

  - name: excessive_context
    scope: telemetry
    metric: raw_tokens
    threshold: 30000
    action: warn

Policy Actions

Action Behaviour
allow Explicit pass-through — no effect on verdict
warn Appends to AirlockResult.policy_warnings; transmission continues
deny Raises AirlockPolicyViolation; payload blocked

Exception Inspection

When a post-sieve deny rule fires, any warn-action messages accumulated during the pre-sieve pass are preserved on the exception for diagnostic inspection:

try:
    result = await boundary.process(payload)
except AirlockPolicyViolation as exc:
    print(exc)           # deny violation message
    print(exc.warnings)  # pre-sieve warn messages (list[str], may be empty)
    raise

Transport Normalisation

Airlock governs boundaries, not transports. Use the factory functions to convert provider-specific request formats into the provider-neutral NormalizedPayload:

from sovereign_airlock import normalize_openai, normalize_anthropic, normalize_raw

# OpenAI-compatible chat completion request
payload = normalize_openai({"messages": [...], "model": "gpt-4o"})

# Anthropic-compatible messages API request
payload = normalize_anthropic({"messages": [...], "system": "...", "model": "claude-sonnet-4-6"})

# Raw string
payload = normalize_raw("plain text to govern")

Invariants

  • Zero external network dependencies — all operations execute on local silicon.
  • Ledger write failure is non-fatal; outbound transmission is never blocked by a storage anomaly.
  • Context minimisation uses sovereign-sdk-sieve exclusively — no model-based compression.
  • All policy evaluation is deterministic and auditable.

Metadata

Release files for sovereign-sdk-airlock 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sovereign-sdk-airlock 1.5.0
File Size Uploaded Provenance Actions
sovereign_sdk_airlock-1.5.0.tar.gz 25.5 kB With provenance Details for sovereign_sdk_airlock-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sovereign-sdk-airlock 1.5.0
File Interpreter ABI Platform Actions
sovereign_sdk_airlock-1.5.0-py3-none-any.whl Python 3 none any Details for sovereign_sdk_airlock-1.5.0-py3-none-any.whl

Total release size: 43.6 kB

Release files / sovereign_sdk_airlock-1.5.0.tar.gz

Download URL sovereign_sdk_airlock-1.5.0.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
276356b2a41165e387cc7154944d79233e71b4462fc8b6cd3e0c1054666db13d
BLAKE2b-256 checksum
How to use checksums
1b46c887ddfc6b3adc91de62b53cd639709fa30bbaa4e331e86f3b391c859655
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / sovereign_sdk_airlock-1.5.0-py3-none-any.whl

Download URL sovereign_sdk_airlock-1.5.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ed9573436a78a192e572636397daa935b50f17f2c27b24dd87d5fb8904217fd
BLAKE2b-256 checksum
How to use checksums
0def7d58d8f8ea6ebf79aab843bd4c2194547be0a7b45374338098ea7cd5c439
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for sovereign-sdk-airlock 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sovereign_sdk_airlock-1.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page