Metadata-Version: 2.4
Name: sakshi-sdk
Version: 0.1.0
Summary: Sakshi SDK — register AI agents, witness their decisions, enforce their autonomy envelopes
Project-URL: Homepage, https://www.rotavision.com
Project-URL: Documentation, https://www.rotavision.com/sakshi
Author: RotaVision
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,ai-governance,audit,compliance,dpdp,india,rbi
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# sakshi-sdk

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

```bash
pip install sakshi-sdk   # imports as `sakshi`
```

```python
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)
```

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.
