Skip to main content

Vera — runtime trust layer SDK for AI agents (immutable audit trail, HITL approvals, policy enforcement)

Project description

vera-sdk

Python SDK for Vera — a runtime trust layer for AI agents. Vera gives every agent action an immutable, cryptographically verifiable audit trail; supports human-in-the-loop (HITL) approvals for high-risk actions; and enforces policies in real time. Built for teams shipping AI into regulated contexts (EU AI Act, GDPR, NIST AI RMF).

Install

pip install vera-sdk

# With framework integrations:
pip install "vera-sdk[langchain,openai,anthropic,crewai]"

Quickstart

1. Sync client — record actions directly

from vera import VeraClient

client = VeraClient(
    api_url="https://your-vera-instance",
    api_key="al_live_...",
    agent_name="loan-screener",
    model_id="gpt-4o",
)

client.record_action(
    action_name="approve_loan",
    action_type="decision",
    result="success",
    input_data={"applicant_id": "user_42", "amount": 25_000},
    outcome={"approved": True},
    reasoning={"score": 0.93, "rule": "auto-approve under $50k"},
    data_subject_id="user_42",
)

2. @audit decorator — zero-boilerplate logging

from vera import audit, set_default_client

set_default_client(client)

@audit(action_name="process_payment", action_type="api_call")
def process_payment(invoice_id: str):
    return {"status": "paid"}
    # Recorded automatically on success or failure (with traceback).

3. Async client — non-blocking, batched

from vera import AsyncVeraClient, async_audit, set_default_async_client

async with AsyncVeraClient(
    api_url="https://your-vera-instance",
    api_key="al_live_...",
    agent_name="fast-agent",
) as client:
    client.start_background_flush()  # Batches sent every 5s
    set_default_async_client(client)

    @async_audit(action_name="process")
    async def process(item):
        ...  # Zero added latency — auditing runs in the background queue.

4. Human-in-the-loop approval (EU AI Act Article 14)

from vera import VeraClient, ApprovalRejectedError

client = VeraClient(api_url="...", api_key="...", agent_name="dpo-agent")

approval = client.request_approval(
    action_name="delete_user_account",
    risk_tier="critical",
    action_summary="Hard-delete PII for user_42",
    data_subject_id="user_42",
    approvers_required=2,       # dual-verification
    expires_in_seconds=3600,
)

try:
    client.wait_for_approval(approval["id"], timeout=600)
    # ... actually perform the deletion
except ApprovalRejectedError as e:
    print("Blocked:", e.approval["status"])

Every approval vote is KMS-signed and appended to the same audit chain as the underlying action — giving you a tamper-evident proof that a specific human approved a specific action at a specific time.

Documentation

Full docs, dashboard, and API reference: https://usevera.xyz.

License

MIT.

Project details


Download files

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

Source Distribution

vera_sdk-0.3.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

vera_sdk-0.3.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file vera_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: vera_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for vera_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 53a8cb55783aa75a46c86d62ea13856225c8017cc5a8d7884db29ee1eb52888c
MD5 75cf0309d7af4c710d43aa2c0c69f4e2
BLAKE2b-256 b3d88d57c5e7365f345d95e7850ff93a3882e256308b0bf4b79e49651bac4b8a

See more details on using hashes here.

File details

Details for the file vera_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: vera_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for vera_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ae9b34fa6447fc4321bafe95fbf3d0cdb275077cec34c73b1d68184bb37c3ac
MD5 966d1356ebf0088726d9dfc68859161f
BLAKE2b-256 881d6cda2215b66f4d0cc690b398fa02a8ee93d514833145703c301281f7083f

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