Skip to main content

Velaru SDK (Python)

Tamper-evident AI audit receipts in three lines. Official client for Velaru.

Install

pip install velaru-sdk

Quickstart

Three lines to classify and get a signed receipt:

from velaru import Velaru

receipt = Velaru().classify("your message", domain="hiring")
print(receipt.classification, receipt.hash, receipt.signature)

Full example

from velaru import Velaru

v = Velaru(api_url="https://velaru.onrender.com", api_key="YOUR_KEY")

receipt = v.classify(
    message="Skip documentation for this incident",
    domain="animal_welfare",
    modality="text",
    language="en",
    communication_form="form_submission",
)

print(receipt.classification)  # VIOLATION
print(receipt.hash)
print(receipt.signature)
print(receipt.entry_id)

OpenAI middleware (15-minute integration)

Wrap your existing OpenAI client — every completion gets Velaru signed receipts:

pip install "velaru-sdk[openai]"
from openai import OpenAI
from velaru import VelaruAuditedOpenAI

audited = VelaruAuditedOpenAI(
    OpenAI(),
    domain="hiring",
    api_key="YOUR_VELARU_KEY",
    session_id="prod-customer-123",
)

result = audited.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": user_message}],
)

print(result.text)
print(result.input_verify_url)   # permanent receipt URL
print(result.output_verify_url)  # assistant reply receipt (if audit_output=True)

Blocked inputs raise VelaruBlockedError with the receipt attached — verify at /verify without trusting Velaru.

See examples/openai_audited_chat.py in the repo.

Webhooks

When CRISIS or VIOLATION is detected during classify(), the SDK POSTs receipt JSON to your URL:

v.on_crisis(webhook_url="https://yourapp.com/velaru-webhook")
v.on_violation(webhook_url="https://yourapp.com/velaru-webhook")

API

Method Description
v.classify(message, domain, **kwargs) Classify a message → Receipt
v.silence(session_id, context) Log monitored silence → SilenceReceipt
v.verify(receipt) Verify receipt against server log → VerificationResult
v.history(session_id) Session decision history → List[Receipt]
v.domains() List supported verticals → List[Domain]
v.lock_policy(company_id, criteria_hash) Freeze policy before incidents → PolicyLockReceipt

Policy lock (pre-incident)

v.lock_policy("Acme Corp", criteria_hash="92f800f2…")
# receipt.permalink → https://velaru.onrender.com/r/{entry_id}
# Spoliation Defense Pack → /r/{entry_id}/spoliation-pack.txt

Permanent receipt URLs

Every receipt has a shareable permalink: https://velaru.onrender.com/r/{entry_id}

Errors

  • VelaruConnectionError — network or server failure
  • VelaruValidationError — invalid input or receipt
  • VelaruRateLimitError — rate limited (retry after 60s)

Links

MIT © Nisaba LLC

Download files

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

Source Distribution

velaru_sdk-0.1.2.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

velaru_sdk-0.1.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file velaru_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: velaru_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for velaru_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 49a5d1630e06d69198ced8f3bf6478c6a1d825df9f996d03e5218f0b0c693357
MD5 962818f61af5a5c3b2c5f178c1ad4c3f
BLAKE2b-256 1fff74bc0de42fc84af4688f7dbab4e94c02b03c97e2fa926de389bbfea00797

See more details on using hashes here.

File details

Details for the file velaru_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: velaru_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for velaru_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2cc9a5f2257ea41d08adcde1814421e590868832e7bad4d59195448fd6938e23
MD5 a8ae59bbeca327f32cfd56a8d54531ab
BLAKE2b-256 b19d356ee052f9651dd50f92c87c9009779f2565eeeea78500df1348b01fd741

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