Lattix Python SDK
Async Python bindings for the Rust-based Lattix SDK core.
The public Lattix docs at https://lattix.io/docs intentionally stay focused on platform concepts and tenant/operator guidance. Per-language SDK reference material is distributed with each SDK package, so this README is part of the supported Python reference surface.
Overview
This package targets the lattix-platform-api SDK control-plane contract and exposes async methods for the metadata-only zero-trust flows:
capabilities()whoami()bootstrap()protection_plan(...)policy_resolve(...)key_access_plan(...)artifact_register(...)evidence(...)prepare_local_protection(...)generate_cid_binding(...)
Python stays thin: the Rust core owns HTTP, auth header shaping, platform contract behavior, and the local helper workflow sequencing.
capabilities() and bootstrap() surface the live auth_configuration metadata published by lattix-platform-api, including the direct bearer/OIDC mode, proof-of-possession mode, issuer/audience, and readiness flags.
generate_cid_binding(...) is the smallest local helper. It computes the SHA-256 digest/raw CID in-process, drives the metadata-only planning calls, and returns a portable LocalArtifactBinding that captures tenant/workload/resource linkage plus the resolved binding targets and binding hash.
What ships in this repo
lattixsdk.client.LattixClient— async wrapper over the native Rust bindinglattixsdk.binding.RustBinding— low-level ctypes bridge to the Rust SDK corelattixsdk.models— Pydantic models mirroring the/v1/sdk/*control-plane contractexamples/example.ipynb— notebook example using the current bootstrap flow
Installation
Official wheel install
Supported wheels bundle the matching native sdk-rust shared library for the
target platform, so a normal wheel install is enough:
pip install lattix-sdk-python
The import package remains lattixsdk.
Source and editable installs
Source installs remain supported for local development and constrained
environments, but they require a separately built matching sdk-rust native
library.
Build sdk-rust first:
cd ../sdk-rust
cargo build --release
Then either:
- set
LATTIX_SDK_RUST_LIBto the compiled library path; or - stage the native library into this package before building a wheel with
python tools/stage_native_library.py.
The canonical C ABI lives in sdk-rust/include/lattix_sdk.h; this package intentionally does not maintain a second handwritten header.
Quickstart
import asyncio
from lattixsdk import LattixClient
from lattixsdk.models import (
ArtifactProfile,
LocalProtectionRequest,
ResourceDescriptor,
WorkloadDescriptor,
)
async def main() -> None:
async with LattixClient(
base_url="https://api.lattix.io",
bearer_token="replace-me",
tenant_id="tenant-a",
user_id="user-a",
) as client:
bootstrap = await client.bootstrap()
print(bootstrap.enforcement_model)
binding = await client.generate_cid_binding(
b"hello world",
LocalProtectionRequest(
workload=WorkloadDescriptor(application="example-app"),
resource=ResourceDescriptor(kind="document"),
preferred_artifact_profile=ArtifactProfile.ENVELOPE,
purpose="store",
labels=["confidential"],
attributes={"region": "us"},
),
)
print(binding.raw_cid)
print(binding.binding_hash)
asyncio.run(main())
Use generate_cid_binding(...) when you need deterministic CID lineage and policy/tenant binding metadata without yet creating an encrypted artifact.
Managed symmetric-key providers are configured through managed_symmetric_key_providers= and now have first-class typed support for both in-memory fixtures and command-backed helpers.
from lattixsdk import LattixClient
from lattixsdk.models import CommandManagedKeyProviderConfig
client = LattixClient(
base_url="https://api.lattix.io",
managed_symmetric_key_providers=[
CommandManagedKeyProviderConfig.from_command(
name="command-kms",
command="provider.py",
args=["--stdio"],
env={"LATTIX_PROFILE": "dev"},
)
],
)
Use the command-backed variant when key lookup or unwrap authorization must stay inside an external helper process instead of embedding that provider logic directly in Python.
Design notes
- The SDK is aligned to the embedded-enforcement model: applications protect data locally and only send metadata to the platform.
- The async API is implemented by running the native Rust calls in an executor, so callers can integrate it cleanly into async Python services.
- Pydantic models live under
lattixsdk.modelsand mirror the platform-api SDK contract. - The authoritative machine-readable
/v1/sdk/*contract lives inlattix-platform-api/openapi/sdk-control-plane.yaml; this package mirrors that surface and does not ship a separate divergent OpenAPI source of truth.
Testing
Unit tests use a fake binding, so they run without the native library:
pip install -e .[test]
pytest
Native smoke tests are included as well. They auto-skip if the Rust library has not been built yet, and they run a real Rust-backed client against a local in-process HTTP server when the native artifact is present, including CID-binding coverage for the local helper layer.
Local quality gate
Run the local quality gate before committing when you want automated fixes, security scans, tests, package builds, wheel-install smoke coverage, and cleanup in one step:
./precommit.sh
On Windows:
./precommit.ps1
The gate applies automated fixes first, then runs linting, SAST, secret scanning, tests, package builds, and an installed-wheel smoke test in a temporary virtual environment.
To wire the same checks into local Git commits and pushes:
./install-hooks.sh
or:
./install-hooks.ps1
The installed pre-commit hook runs a faster version of the gate; the
installed pre-push hook runs the full gate.
Release process
Maintainer release notes live in RELEASING.md. The publish workflow supports a
TestPyPI rehearsal path through trusted publishing before the first real PyPI
publish.
License
Distributed under the proprietary Lattix SDK License in LICENSE.
Metadata
Release files for lattix-sdk-python 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lattix_sdk_python-0.1.1.tar.gz | 21.1 kB | With provenance | Details for lattix_sdk_python-0.1.1.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lattix_sdk_python-0.1.1-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for lattix_sdk_python-0.1.1-py3-none-win_amd64.whl |
| lattix_sdk_python-0.1.1-py3-none-manylinux_2_39_x86_64.whl | Python 3 | none | Linux glibc 2.39+ x86-64 | Details for lattix_sdk_python-0.1.1-py3-none-manylinux_2_39_x86_64.whl |
| lattix_sdk_python-0.1.1-py3-none-macosx_11_0_universal2.whl | Python 3 | none | macOS 11.0+ universal2 (ARM64, x86-64) | Details for lattix_sdk_python-0.1.1-py3-none-macosx_11_0_universal2.whl |
Total release size: 5.2 MB
Release files / lattix_sdk_python-0.1.1.tar.gz
| Download URL | lattix_sdk_python-0.1.1.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1abf8cca32d742dc5f44389d12cb718d004a822d6796406638abc353f2d186a
|
|
BLAKE2b-256 checksum How to use checksums |
f661ebea835f3b15c054123c9c48eacbbfd54766a59c20cbc0fae601f2142162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 11, 2026.
Transparency logRelease files / lattix_sdk_python-0.1.1-py3-none-win_amd64.whl
| Download URL | lattix_sdk_python-0.1.1-py3-none-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ff057caf9a8ffcd71b4351d79993f169a8250cd7b2b889cf4eb2f4288639d258
|
|
BLAKE2b-256 checksum How to use checksums |
33fd8e741d1843ec716c7c3e4254a6b9622c18241ee8d083c1d18f50f0964450
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 11, 2026.
Transparency logRelease files / lattix_sdk_python-0.1.1-py3-none-manylinux_2_39_x86_64.whl
| Download URL | lattix_sdk_python-0.1.1-py3-none-manylinux_2_39_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Linux glibc 2.39+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
858af8618901bc0ece20a73c2da661e7df5b9b85915bfab9f0c3848dd6e78dcb
|
|
BLAKE2b-256 checksum How to use checksums |
82e4f9693dcc632188598b69b5ca94a26e32ea261b34706810ff1cd645510e49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 11, 2026.
Transparency logRelease files / lattix_sdk_python-0.1.1-py3-none-macosx_11_0_universal2.whl
| Download URL | lattix_sdk_python-0.1.1-py3-none-macosx_11_0_universal2.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
8db39779c0a07403d3d7e4341bbfafcb29c7f217ef5533f479e96ce4ed724993
|
|
BLAKE2b-256 checksum How to use checksums |
f9c4a7aa8b499c032d5de8cbf09fb190217f12412d25823d2ca6b14b47bbeee9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 11, 2026.
Transparency logSecurity for lattix-sdk-python 0.1.1
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
All 4 files in this release have been uploaded with provenance metadata.
Attestation for lattix_sdk_python-0.1.1.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 May 11, 2026.
Transparency logA 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.