Skip to main content

Aegis Python SDK

aegis-latent-sdk supplies typed subclasses of the official OpenAI and Anthropic clients plus a stateless verifier for aegis-mmr-inclusion-v1 proofs.

Develop from a clean checkout

The v4 distribution is named aegis-latent-sdk (its Python import package is aegis_sdk). It is not published to PyPI; install it from this checkout rather than using a registry package. Run these commands from the repository root:

cd sdk/python
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
python -m pytest
python -m ruff check src tests
python -m mypy
python -m pip wheel . --no-deps --wheel-dir dist

The cd sdk/python step is required: pyproject.toml, the SDK tests, and the resulting dist/ directory are component-relative. See the repository overview, developer quickstart, and integration guide for the canonical project documentation.

from aegis_sdk.openai import OpenAI

client = OpenAI(
    aegis_api_key="proxy-key",
    gateway_url="https://gateway.example",
    tenant_id="tenant-1",
)
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "hello"}],
)

The wrapper changes constructor defaults only. Native resource methods, parsed return models, raw-response surfaces, and streaming types remain those of the installed official SDK. The Aegis gateway currently implements only the routes documented by its server; subclassing does not make unsupported vendor routes available.

Set verify_proof=True and supply a pinned trusted_mmr_root to require and verify the X-Aegis-MMR-Leaf, X-Aegis-MMR-Proof, and X-Aegis-MMR-Root response headers. X-Aegis-MMR-Leaf is a lowercase SHA-256 digest, not raw request or response material. The root is public integrity state, not a signing key. Root rotation must be managed by the caller's independent trust policy; copying the root from the same untrusted response is not an independent anchor.

The Anthropic subclass preserves the official client surface and uses bearer authentication. Aegis exposes native POST /v1/messages when the deployment sets AEGIS_PROVIDER=anthropic; the upstream and downstream bodies retain Anthropic Messages wire types. A deployment configured for a different provider rejects native Anthropic ingress rather than pretending that an OpenAI-shaped response is an anthropic.types.Message.

Streaming responses begin before the terminal evidence record exists, so their initial headers intentionally do not contain a completed proof. Use the returned proof Link after the stream terminates. Automatic header verification applies to non-streaming responses only.

Download files

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

Source Distribution

aegis_latent_sdk-4.0.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

aegis_latent_sdk-4.0.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file aegis_latent_sdk-4.0.0.tar.gz.

File metadata

  • Download URL: aegis_latent_sdk-4.0.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for aegis_latent_sdk-4.0.0.tar.gz
Algorithm Hash digest
SHA256 bc336394c35841a0060e529f5910845b7ad1feb28fcd77e2f9adf11fffc90c90
MD5 3d9340b010d4de7085e598ec697403e6
BLAKE2b-256 f4ba7f95cd80c709bd0b0392be018d0fcbf66d51554a1f71ebf8712c0ea04b17

See more details on using hashes here.

File details

Details for the file aegis_latent_sdk-4.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aegis_latent_sdk-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b44adef7e2c1413537c2228573295851ff5d68358a170ca142935e8b8ffe8c
MD5 2f647b1dc2c62831893a502656ec6ed0
BLAKE2b-256 792fe7c44a9302bf1c6386b12ae7d8d88d26092485f523128e03716d13caa40b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 files

Supported by

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