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-4.1.0.tar.gz (50.8 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-4.1.0-py3-none-win_amd64.whl (6.1 MB view details)

Uploaded Python 3Windows x86-64

ciris_verify-4.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ciris_verify-4.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ciris_verify-4.1.0-py3-none-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

ciris_verify-4.1.0-py3-none-macosx_10_12_x86_64.whl (6.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for ciris_verify-4.1.0.tar.gz
Algorithm Hash digest
SHA256 14334faf9a83e53042a5eda232473094c6c114ae79f169e810900bf2b48c8103
MD5 01dd6e2f05330ca1688eb762db384b37
BLAKE2b-256 93e16f55f62fff50b1ecbb88d6af2956ddb32260bb959788696f3f4c3e13b499

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-4.1.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-4.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: ciris_verify-4.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.1 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-4.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 99daa979b7009ad57b062c50cc07ff0b6c4240861450286e1e9b06473ddc1ba9
MD5 9b485036ae36c45e665f3e2cb02c2d07
BLAKE2b-256 483cdd0052e3d2913de223d9c8fef70f6f47c928007de92450c7e3e928c45bb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-4.1.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-4.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ciris_verify-4.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6cc0e64f3a7c7e6df256dd93ac89e36ed1b93a84b665a9c1e9e44e8cd21d3ffb
MD5 96c5adce967eb52c1bbbd78bf6efe11d
BLAKE2b-256 1aee445b6efa7f6bcc5ba1ad232a617d85fc5d6f773b63653270431f3a5858fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-4.1.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-4.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ciris_verify-4.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7ddeada05f421f410582713b3492cecad41eda6eefbd887dc5488ebd75c2655f
MD5 15bf188ba56e5a0690a75ac22e3d3f63
BLAKE2b-256 043b30290417357bd08d7e1ae1ed65a10b29f08e5dab18ac786a78fcb3c04f03

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-4.1.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-4.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ciris_verify-4.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb1fec472a898e9779d8c65e0341b6e11dc477c102b405ada3ad6177f16c79d8
MD5 7a4b33cc59713d474e17734ab684d51b
BLAKE2b-256 094028a4c7be95d605e3c92c17e4bf2af6921c24f9675cabfae4254e897691a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-4.1.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-4.1.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ciris_verify-4.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 67aeaee381066e46168c8b0a86ec191efdf59bb327b765aba91737e5fcba9f0d
MD5 4fdbf048dea2c50d396c46cbd804f2db
BLAKE2b-256 51169fda2d6d3df3b9efe06b544743e6910e0a685bcf868db93200ff9adfa0e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciris_verify-4.1.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