Skip to main content

Python bindings for CIRISVerify hardware-rooted license verification

Project description

CIRISVerify Python Bindings

Python bindings for CIRISVerify, the hardware-rooted license verification module for the CIRIS ecosystem.

Installation

pip install ciris-verify

Note: The CIRISVerify binary must be installed separately. See the CIRISVerify documentation for installation instructions.

Quick Start

import os
from ciris_verify import CIRISVerify, LicenseStatus

# Initialize the verifier
verifier = CIRISVerify()

# Get license status with a fresh nonce
status = await verifier.get_license_status(
    challenge_nonce=os.urandom(32)
)

# Check if professional capabilities are available
if status.allows_licensed_operation():
    print("Professional license verified!")
    print(f"Tier: {status.license.tier}")
    print(f"Capabilities: {status.license.capabilities}")
else:
    print("Running in community mode")

# IMPORTANT: Always display the mandatory disclosure
print(status.mandatory_disclosure.text)

Mandatory Disclosure

Per the CIRIS ecosystem rules, agents MUST display the mandatory_disclosure.text to users. This ensures transparency about the agent's capabilities and licensing status.

# The disclosure MUST be shown to users
disclosure = status.mandatory_disclosure
print(f"[{disclosure.severity.upper()}] {disclosure.text}")

Capability Checking

For frequent capability checks, use the fast path:

result = await verifier.check_capability("medical:diagnosis")
if result.allowed:
    # Capability is available
    pass
else:
    print(f"Capability denied: {result.reason}")

Testing

For testing without the actual binary, use MockCIRISVerify:

from ciris_verify import MockCIRISVerify, LicenseStatus

# Create a mock that returns community mode
verifier = MockCIRISVerify(
    mock_status=LicenseStatus.UNLICENSED_COMMUNITY
)

# Use exactly like the real client
status = await verifier.get_license_status(os.urandom(32))
assert status.status == LicenseStatus.UNLICENSED_COMMUNITY

Error Handling

from ciris_verify import (
    CIRISVerifyError,
    BinaryNotFoundError,
    BinaryTamperedError,
    VerificationFailedError,
)

try:
    verifier = CIRISVerify()
    status = await verifier.get_license_status(os.urandom(32))
except BinaryNotFoundError as e:
    # Binary not installed
    print(f"CIRISVerify not found: {e.path}")
except BinaryTamperedError:
    # CRITICAL: Binary has been modified
    # Halt all operations immediately
    raise SystemExit("SECURITY ALERT: Binary integrity compromised")
except VerificationFailedError as e:
    # Verification failed - operate in restricted mode
    print(f"Verification failed: {e}")

License Status Codes

Status Code Description
LICENSED_PROFESSIONAL 100 Full professional license active
LICENSED_PROFESSIONAL_GRACE 101 License valid, in offline grace period
UNLICENSED_COMMUNITY 200 Community mode, no professional capabilities
RESTRICTED_* 300-399 Restricted mode due to verification issues
ERROR_* 400-499 Error states (revoked, expired, etc.)
LOCKDOWN_* 500+ Critical security failure, halt operations

Thread Safety

The client is thread-safe and can be used from multiple threads or async tasks concurrently.

License

AGPL-3.0-or-later - See LICENSE file in the CIRISVerify repository.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

ciris_verify-7.5.0.tar.gz (77.7 kB view details)

Uploaded Source

Built Distributions

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

ciris_verify-7.5.0-py3-none-win_amd64.whl (6.6 MB view details)

Uploaded Python 3Windows x86-64

ciris_verify-7.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ciris_verify-7.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ciris_verify-7.5.0-py3-none-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

ciris_verify-7.5.0-py3-none-macosx_10_12_x86_64.whl (6.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file ciris_verify-7.5.0.tar.gz.

File metadata

  • Download URL: ciris_verify-7.5.0.tar.gz
  • Upload date:
  • Size: 77.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ciris_verify-7.5.0.tar.gz
Algorithm Hash digest
SHA256 3cc3455fb91b1be7190c240a24a46d8fda514119bedee8f88429ad4832a78ec8
MD5 42f1afa6c4cef44595b79ac0b3eb4b6e
BLAKE2b-256 161e5b2fea30e24b8237abafcf4c0378f0f0cac014e4906fc7cb4e1532464fdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-7.5.0.tar.gz:

Publisher: release.yml on CIRISAI/CIRISVerify

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

File details

Details for the file ciris_verify-7.5.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: ciris_verify-7.5.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.6 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ciris_verify-7.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3d61178d7c891f53fb674af32284646b215037b340fe3b6a55fb6876ed68cba7
MD5 53c38fae64717e854af89dd6a360057a
BLAKE2b-256 fd1663aab944b6a3af87db1e3602304bcea6cfc6695d725388829ae3dd91d392

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-7.5.0-py3-none-win_amd64.whl:

Publisher: release.yml on CIRISAI/CIRISVerify

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

File details

Details for the file ciris_verify-7.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ciris_verify-7.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 060085e874cd2e3a1ba6aca49b2b12918b9a0760e91969087b798ea6e1f0a4fd
MD5 5796debd85dbb9109311ee71fa25129e
BLAKE2b-256 1a84a8f5ea1587fc8c468e35628834b19acc0b134ed921e6023f3a046b1a842e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-7.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on CIRISAI/CIRISVerify

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

File details

Details for the file ciris_verify-7.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ciris_verify-7.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 39048bc87b2040f51c68a11c8c3677b93446bfe4b9efb759c57bc1c6f3fedbc0
MD5 d3ad1e40b7d50f8daa3b96de8e761fde
BLAKE2b-256 5a751e373ae8f6f5b6fa2431e22f968ffdc822d3fe34f0c3dd7cb4ba5f931965

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-7.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on CIRISAI/CIRISVerify

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

File details

Details for the file ciris_verify-7.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ciris_verify-7.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd8d061dfd471b2d80cf56d5d1697f8913281832b378f9d0b43450dc36d63af1
MD5 ce7e9813bd0f79a130924dbef650ffce
BLAKE2b-256 74e583a3684dfd9cc3acb687bcfcc7a47dd91a299bccdf5500ce4f35297ed9c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-7.5.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on CIRISAI/CIRISVerify

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

File details

Details for the file ciris_verify-7.5.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ciris_verify-7.5.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0fefdb087713d342282fa70d23892b131fa426a5772e50cefb04d987f5b5c4e0
MD5 d052f034699d41be10e30f439f331f6d
BLAKE2b-256 81f9c9fcdd1e6fd092ad2b5313e97198b8807e58cf0817634d638026c52a0661

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-7.5.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on CIRISAI/CIRISVerify

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