Skip to main content

noblecloak-py

The common Python library for NobleCloak governed approvals: the Python counterpart of @noblecloak/client, against the same /v1 module API contract.

Status: 0.1.0, the first release. Until 1.0, a minor version may change the API.

Install

pip install noblecloak

Python 3.12 or later.

Use

import asyncio

from noblecloak.client import AsyncModuleClient, Ok
from noblecloak.service_principal import AsyncTokenSource, load_service_principal_credential


async def main() -> None:
    # Reads the credential from NOBLECLOAK_SP_CREDENTIALS (inline JSON or a file path).
    tokens = AsyncTokenSource(load_service_principal_credential(), audience="https://api.example.com")
    async with AsyncModuleClient("https://api.example.com", get_token=tokens.get_token) as client:
        action = {"tool_ref": "ext:local:send_email", "arguments": {"to": "ap@example.com"}}
        answer = await client.decide({"action": action})
        if isinstance(answer, Ok):
            print(answer.data.decision)  # allow, deny, step_up or defer
        else:
            print(answer.status, answer.code)


asyncio.run(main())

ModuleClient and TokenSource are the sync equivalents.

Modules

  • noblecloak.client: the /v1 module API (AsyncModuleClient, the sync ModuleClient, Answer, is_transient).
  • noblecloak.service_principal: a service-principal credential and the access tokens it mints, sync and async.
  • noblecloak.digest: argument digests (jcs, arg_digest), identical to @noblecloak/client.
  • noblecloak.resumption: verification of a Resumption, with replay guards.
  • noblecloak.models: pydantic models generated from the pinned spec.
  • noblecloak.testing: helpers for tests only.

See CONTRIBUTING.md for the local gate and the rules the tree enforces.

Licensed under Apache-2.0. See LICENSE.

Metadata

Release files for noblecloak 0.1.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 noblecloak 0.1.0
File Size Uploaded Provenance Actions
noblecloak-0.1.0.tar.gz 82.3 kB With provenance Details for noblecloak-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for noblecloak 0.1.0
File Interpreter ABI Platform Actions
noblecloak-0.1.0-py3-none-any.whl Python 3 none any Details for noblecloak-0.1.0-py3-none-any.whl

Total release size: 183.1 kB

Release files / noblecloak-0.1.0.tar.gz

Download URL noblecloak-0.1.0.tar.gz
Size 82.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a8701e324c2becfee1224190e4eb359f64b3b37684b2774c1aa128283333b9aa
BLAKE2b-256 checksum
How to use checksums
9d2683a739400928e521792027459a89751b5df1f9b96d5aed0d8a95239d9009
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 13, 2026.

Transparency log

Release files / noblecloak-0.1.0-py3-none-any.whl

Download URL noblecloak-0.1.0-py3-none-any.whl
Size 100.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eac9e3ab5a3e106369af90495ee0416c16fb92e714cd41aa37d56a1e5a99c2f1
BLAKE2b-256 checksum
How to use checksums
8102b36c9dc180c088416db33d16b5cbce754f3cc18427e0c9362ea7e7c54e95
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 13, 2026.

Transparency log

Security for noblecloak 0.1.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 noblecloak-0.1.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 13, 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

0.1.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