arqera
Govern any AI action with one API call.
The official Python SDK for ARQERA -- AI governance as an API. Evaluate actions against governance policies, query trust scores, and maintain a tamper-evident audit trail, all from Python.
Installation
pip install arqera
Requirements: Python 3.9+. Zero required dependencies (uses only the standard library).
Quick start
from arqera import Arqera
client = Arqera(api_key="ak_live_...")
# Evaluate an action against governance policies
result = client.governance.evaluate(
action="email.send",
description="Send welcome email to new user",
)
print(result.verdict) # "proceed", "review", or "deny"
print(result.confidence) # 0.95
print(result.approved) # True
Governance evaluation
Every AI action -- sending an email, deleting data, deploying a model -- can be evaluated against ARQERA's governance laws before execution:
from arqera import Arqera, ArqeraError
client = Arqera(api_key="ak_live_...")
# Simple evaluation
result = client.governance.evaluate(action="data.export")
# With full context
result = client.governance.evaluate(
action="model.deploy",
description="Deploy sentiment model to production",
context={
"model_id": "sentiment-v3",
"environment": "production",
"user_role": "ml-engineer",
},
)
if result.approved:
deploy_model()
else:
print(f"Blocked: {result.reasons}")
Verdict object
The evaluate() method returns a Verdict with these fields:
| Field | Type | Description |
|---|---|---|
verdict |
str |
"proceed", "review", or "deny" |
action |
str |
The action that was evaluated |
confidence |
float |
Confidence score (0.0 -- 1.0) |
reasons |
list[str] |
Reasons supporting the decision |
laws_evaluated |
list[str] |
Which governance laws were checked |
approved |
bool |
Shorthand for verdict == "proceed" |
Trust scores
Query the trust score for your account:
trust = client.governance.trust_score()
print(f"Overall: {trust.overall}")
print(f"Components: {trust.components}")
Evidence trail
Search and export the tamper-evident audit trail:
# Search recent evidence
artifacts = client.governance.search_evidence(
artifact_type="governance_evaluation",
start_date="2026-01-01",
page_size=20,
)
for artifact in artifacts:
print(f"{artifact.artifact_type}: {artifact.created_at}")
# Verify chain integrity
result = client.governance.verify_evidence(artifact_id=42)
# Export for compliance audit
export = client.governance.export_evidence(
export_format="json",
artifact_types=["governance_evaluation"],
)
Error handling
from arqera import Arqera, ArqeraError, RateLimitError, AuthenticationError
client = Arqera(api_key="ak_live_...")
try:
result = client.governance.evaluate(action="email.send")
except AuthenticationError:
print("Invalid API key")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
except ArqeraError as e:
print(f"API error ({e.status_code}): {e.message}")
Exception hierarchy
| Exception | HTTP Status | When |
|---|---|---|
AuthenticationError |
401 | Invalid or missing API key |
AuthorizationError |
403 | Key lacks required permissions |
NotFoundError |
404 | Resource does not exist |
ValidationError |
422 | Invalid request payload |
RateLimitError |
429 | Rate limit exceeded |
ServerError |
5xx | ARQERA server error |
NetworkError |
-- | DNS, timeout, connection refused |
ArqeraError |
any | Base class for all SDK errors |
Configuration
client = Arqera(
api_key="ak_live_...", # or set ARQERA_API_KEY env var
base_url="https://api.arqera.com/api/v1", # default
timeout=30, # seconds
max_retries=2, # retries on 429/5xx
)
The api_key parameter can be omitted if the ARQERA_API_KEY environment
variable is set:
export ARQERA_API_KEY="ak_live_..."
client = Arqera() # picks up ARQERA_API_KEY from env
Links
License
Apache 2.0. See LICENSE for details.
Metadata
Release files for arqera 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| arqera-0.3.0.tar.gz | 27.8 kB | Without provenance | Details for arqera-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| arqera-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for arqera-0.3.0-py3-none-any.whl |
Total release size: 52.5 kB
Release files / arqera-0.3.0.tar.gz
| Download URL | arqera-0.3.0.tar.gz |
|---|---|
| Size | 27.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b080bd79e470e9c4e1a43192b862451c52b9a8ebe7571cb836929d70506e403f
|
|
BLAKE2b-256 checksum How to use checksums |
ff7ebb3965f63e57d895f4f6c72200faced7502acfe31e1e424283d677620599
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / arqera-0.3.0-py3-none-any.whl
| Download URL | arqera-0.3.0-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25019a4646c02d44f8cdd2ae221bbc80f0932b11193408e1558f58d7609c246c
|
|
BLAKE2b-256 checksum How to use checksums |
ee8eeb3f175d48e2b586beb1e24b337ff23abaf15e191750053529812f3f5dff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for arqera 0.3.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.