Skip to main content

The unified Niyam SDK: embed the centrally-governed AI action gate in your own agent code

Project description

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.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

niyam_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 24f317d226562aea2f678ddbacbcf79554332655490376836354ea1daf98fcd1
MD5 59dafe49185c60266cd51565211b044c
BLAKE2b-256 989efec4f16f4778c2c6c4d19f7c1e598e73e66f3792ab0d23d02945341c6518

See more details on using hashes here.

Provenance

The following attestation bundles were made for niyam_sdk-0.1.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on SarthiAI/Niyam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 985e45857c8e94e21b8ed731f19f3c7ab1de3139492e8b8006ef2a2154c3cc6b
MD5 947d5ff718a62a9b24321a1603406463
BLAKE2b-256 9d256bab26ce98b60d4f2b2be234166add165b03c3b181901e00e9a5bd03d9c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on SarthiAI/Niyam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9fd0ade5151a78a9237de650b628f09047aef30ccec082d9914331a90c87d1d1
MD5 79b6fa1849d6e62f14feee81f4ffcb16
BLAKE2b-256 7bf0a8be8db3559e85fe6bd7f70456ba914c347e2b67902ade83522f3d6c8e98

See more details on using hashes here.

Provenance

The following attestation bundles were made for niyam_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on SarthiAI/Niyam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file niyam_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for niyam_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 457dd761f97f80f453b7e55e42816789c7e46ffa85f761b83b77c9804049aee2
MD5 f6be69e2cf07907d7ff7f8b7ec6cdb0f
BLAKE2b-256 96e77b51d2dbdbd630ee8948e226f2dd2609551717f1d8b87e5d335c83ebc420

See more details on using hashes here.

Provenance

The following attestation bundles were made for niyam_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on SarthiAI/Niyam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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