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-0.8.8.tar.gz (25.5 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-0.8.8-py3-none-win_amd64.whl (3.6 MB view details)

Uploaded Python 3Windows x86-64

ciris_verify-0.8.8-py3-none-manylinux_2_17_x86_64.whl (4.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ciris_verify-0.8.8-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ciris_verify-0.8.8-py3-none-manylinux_2_17_aarch64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ciris_verify-0.8.8-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ciris_verify-0.8.8-py3-none-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

ciris_verify-0.8.8-py3-none-macosx_10_12_x86_64.whl (3.7 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: ciris_verify-0.8.8.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ciris_verify-0.8.8.tar.gz
Algorithm Hash digest
SHA256 7575e1ddd3a34e0fe374a3626605e3a55aa74f6543395fc950aef30b161a84ad
MD5 f3e723cd7a54fe3a3792c644cdfe2e0f
BLAKE2b-256 bf730fbb163a447530cc6bc57f98d0d7de5fc7ee41f9f71f8d82fa77d05f2396

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ciris_verify-0.8.8-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ciris_verify-0.8.8-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 498676b41fb098ad2e5d3bee170de1b446a8c2a4ebbad477ef8490c68abe22ec
MD5 1fb2a029d4ff57018cabfe5b105ed8f5
BLAKE2b-256 4e2b34431fcf462d77e76e8d6fe7662b508efdb9e0b5dffcd79040d89f3394d5

See more details on using hashes here.

File details

Details for the file ciris_verify-0.8.8-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ciris_verify-0.8.8-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dad9c1c5a8034cca216cf2442d26e99c42e1cf3ec83500eb682edadce2b0bbae
MD5 a67185daec2e7d6ec1f67531634a3bd6
BLAKE2b-256 9abe1d7887aa361d0289daea531d353f451a6df1c66a9d3596cf009e6eac14af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ciris_verify-0.8.8-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5088612f36011648c554d8fd5543fbaa9da6a1fd993294d8b3159d4bf6e612f
MD5 16af52101520fe25f86e076bccbdb73d
BLAKE2b-256 cf2afbdd7dc75b92e1292a80fd22b713bd92a23e4731a63df19ea807ad61b406

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ciris_verify-0.8.8-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 5b820ef296a21461dfcc6e5dd77bf7c873800a0a23c0d19657ec5b8bad535ae2
MD5 5e038c6910efeb8694cf41717fb8ef43
BLAKE2b-256 acf6d92dcb34ba93647d9c722c4923fa0b3691303a6d0990ff972da56179cc68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ciris_verify-0.8.8-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 797ced1b3336954296acd6491da56729418061e0097af7b5af90b726d8b213b7
MD5 73c95f75b94fe65ed0eae2d500b84ea9
BLAKE2b-256 238ae5a72591c614f0c3fc487a60252cd58de9ccda84df84ed0df5fa61accba5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ciris_verify-0.8.8-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5daab33e35a4556fa5dd04910a381c4aa0a10d5078be4cd51769c092a8c68837
MD5 f40f717b6c83224da38efabec5ee25ab
BLAKE2b-256 4ae5962c8590f311534e7613f6a577e0b0b8d3897105cdf0f4278f336eb6924e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ciris_verify-0.8.8-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fb0b5a82361c3b9f163606a73c0b17419365d6a45d50b9b04f7f961362ba90b1
MD5 b46366e323682c1808444e70a595ba8f
BLAKE2b-256 ef7a8f30c4df18e041ec5bcb33dbe97ecacb54a3e757fc9bb860c24be3b80947

See more details on using hashes here.

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