Skip to main content

Sakshi SDK — register AI agents, witness their decisions, enforce their autonomy envelopes

Project description

sakshi-sdk

Register your AI agents and witness their decisions. Python SDK for the Sakshi governance platform.

pip install sakshi-sdk   # imports as `sakshi`
from sakshi import SakshiClient

sakshi = SakshiClient("https://console.example.bank", api_key="...")

agent_id = sakshi.register(
    "loan-decision-agent",
    owner_name="Priya Sharma",
    owner_email="priya@example.bank",
    autonomy_tier="L2",
    blast_radius={"customer_facing": True, "spend_limit_inr": 500_000},
)

with sakshi.witness(
    agent_id,
    context={"application_id": "4471", "retrieved": chunks},
    model={"provider": "openai", "model": "gpt-5.2", "version": "2026-05"},
    client_ref="app-4471",  # idempotency key
) as w:
    w.step("plan", goal="assess repayment capacity")
    w.tool("bureau_pull", output=bureau_response)
    w.human("async_review", "arun@example.bank", verdict="approved")
    w.action(decision="approve", limit_inr=200_000)

Delivery & retry semantics (v0.2):

  • register() is idempotent by name — rerunning your startup script returns the existing agent, never a duplicate.
  • witness() capture retries with jittered exponential backoff and is idempotent by client_ref — retries can never double-record.
  • enforce() never auto-retries: an evaluation is evidence and a routed action must not be double-enqueued. Unreachable platform raises SakshiEnforcementUnavailable (fail-closed) — your code decides.

Properties you can rely on:

  • Fail-open by default — if the platform is unreachable, your agent keeps running; records are buffered, retried, and dropped with a warning as the last resort. Governance must never take production down. Use fail_open=False for synchronous capture that raises.
  • Failures are evidence — an exception inside a witness block is captured as the decision outcome and re-raised.
  • PII-safe by design — Aadhaar/PAN/mobile and other Indian identifiers are detected and tokenized server-side at ingest, before storage or hashing.
  • register() is always synchronous: an unregistered agent should not run (RBI draft MRM guidance, para 21).

Call sakshi.flush() before shutdown in batch jobs; long-running services can rely on the atexit hook.

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

sakshi_sdk-0.2.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

sakshi_sdk-0.2.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file sakshi_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: sakshi_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for sakshi_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1c51744e914b640865fdf5b76a5b3ed33acd77349d830f290c5111175ae38c65
MD5 60c9c9c382726a76fd3e5e8223edee31
BLAKE2b-256 714f3b72a4b7d0eecfbc75b9b7707df343b6f8a673d44565fd57154436766209

See more details on using hashes here.

File details

Details for the file sakshi_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sakshi_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for sakshi_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69626aec36f29b1997064b0e4a2fb3a940d4c105e5ea8f37b53136c81b57c8e6
MD5 76693da5117e6d200a73e42e515aa891
BLAKE2b-256 bb1496185dbe81ecf61d2bb75dcbc365c2bc4405df7c32b99ca95b23dcd70084

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