Skip to main content

niyam (Python SDK)

The unified Niyam SDK for Python. Embed the centrally-governed AI action gate in your own agent code: enroll once, then wrap dispatch around your tool-dispatch layer. Enforcement is deterministic and in-process (no per-call network hop); policy is pulled from the control plane and can never be overridden locally.

import niyam

# Enroll to the control plane (like a data-plane node): pulls the compiled policy,
# the capability-token issuer, and the revocation set, and builds an in-process gate
# over its own post-quantum audit chain.
gate = niyam.GovernedGate(
    "http://127.0.0.1:9090",   # control plane
    "enrollment-token",         # bootstrap token
    "billing-agent",            # this instance's name in the registry
)

# Wrap your tool dispatch once. `capability_token` was minted centrally for the agent.
decision = gate.dispatch(capability_token, "tools.email.send", "mailbox/support")
if decision.allowed:
    send_email()                # every decision is signed into the audit chain
else:
    raise PermissionError(decision.reason)

# Route model calls through a governed gateway so model traffic + safety + budgets
# are enforced centrally (never re-implemented per app).
gw = niyam.Gateway("http://gateway.internal:8080", client_key)
# openai.base_url = gw.openai_base_url()

Build

maturin build --release        # one abi3 wheel per platform (CPython >= 3.9)
# or during development:
maturin develop

Everything is post-quantum from day one (ML-DSA-65 hybrid with Ed25519), matching the rest of Niyam. The SDK never authors policy; it only pulls and enforces.

Release files for niyam-sdk 0.1.0

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

Built distributions (wheels)

Table of built distributions (wheels) for niyam-sdk 0.1.0
File
niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
niyam_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 9.4 MB

Release files / niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl

Download URL niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
24f317d226562aea2f678ddbacbcf79554332655490376836354ea1daf98fcd1
BLAKE2b-256 checksum
How to use checksums
989efec4f16f4778c2c6c4d19f7c1e598e73e66f3792ab0d23d02945341c6518
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 Jul 16, 2026.

Transparency log

Release files / niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.4 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
985e45857c8e94e21b8ed731f19f3c7ab1de3139492e8b8006ef2a2154c3cc6b
BLAKE2b-256 checksum
How to use checksums
9d256bab26ce98b60d4f2b2be234166add165b03c3b181901e00e9a5bd03d9c8
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 Jul 16, 2026.

Transparency log

Release files / niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.4 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
9fd0ade5151a78a9237de650b628f09047aef30ccec082d9914331a90c87d1d1
BLAKE2b-256 checksum
How to use checksums
7bf0a8be8db3559e85fe6bd7f70456ba914c347e2b67902ade83522f3d6c8e98
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 Jul 16, 2026.

Transparency log

Release files / niyam_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL niyam_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Size 2.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
457dd761f97f80f453b7e55e42816789c7e46ffa85f761b83b77c9804049aee2
BLAKE2b-256 checksum
How to use checksums
96e77b51d2dbdbd630ee8948e226f2dd2609551717f1d8b87e5d335c83ebc420
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 Jul 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

4 release files

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