> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rotavision.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install the SDK, register an agent, witness a decision, and recompute the chain.

This walks through the shortest path to an accountable agent: register it,
witness one decision, and verify the record independently. It takes a few
minutes.

## Prerequisites

* Python 3.9 or newer
* A **writable** Sakshi instance you can reach: your own deployment, or a
  [sandbox](https://rotavision.com/sandbox), a private synthetic-data instance
  with no install. The public demo at `https://demo.rotavision.com` is read-only,
  so it cannot register or witness.
* An ingest API key. In a sandbox or your own deployment, mint one in the console
  under **Admin → API keys**. See [Authentication](/authentication).

## 1. Install the SDK

```bash theme={null}
pip install sakshi-sdk
```

The distribution is `sakshi-sdk`; the import is `sakshi`.

## 2. Initialize the client

```python theme={null}
from sakshi import SakshiClient

client = SakshiClient(
    base_url="https://sakshi.your-company.internal",
    api_key="sks_...",
)
```

<Note>
  Capture is **fail-open** by default: if the platform is unreachable, your
  agent keeps running and records are dropped with a warning. Governance must
  never take production down. Pass `fail_open=False` for batch jobs where losing
  evidence is worse than stopping.
</Note>

## 3. Register the agent

An agent must not run unregistered. `register` is idempotent by name, so it is
safe to call on every startup.

```python theme={null}
agent_id = client.register(
    "loan-decision-agent",
    owner_name="Priya Sharma",
    owner_email="priya@your-company.com",
    autonomy_tier="L1",
    description="Approves or refers retail loan applications.",
)
```

## 4. Witness a decision

Open a witness session as a context manager. Record the steps as they happen;
the decision record is written to the chain when the block exits. Identifiers
you pass are tokenized at ingest, so raw PII never lands on the chain.

```python theme={null}
with client.witness(
    agent_id,
    model={"provider": "openai", "name": "gpt-5.2", "version": "2026-05"},
    context={"applicant_aadhaar": "XXXX-XXXX-1234"},
    client_ref="APP-2026-04471",
) as decision:
    decision.step("retrieve", source="credit-bureau")
    decision.step("assess", risk_band="low", score=0.92)
    decision.action(outcome="approved", amount=1_500_000, mode="auto")
```

## 5. Bound the autonomy (optional)

Before an agent acts, route the intended action through its envelope. Enforcement
fails **closed**: if Sakshi is unreachable it raises rather than letting an
ungoverned action through.

```python theme={null}
from sakshi import SakshiBlocked, SakshiSyncReviewRequired

try:
    client.enforce(agent_id, "approve_loan", stakes=1_500_000, confidence=0.92)
    # allowed: proceed with the action
except SakshiSyncReviewRequired:
    # parked for a human before it can run
    ...
except SakshiBlocked:
    # the envelope (or the kill switch) blocked it
    ...
```

## 6. Verify the chain

Anyone can recompute the chain. No trust in Rotavision required.

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "Authorization: Bearer sks_..." \
    https://sakshi.your-company.internal/api/v1/chain/verify
  ```

  ```json Response theme={null}
  { "valid": true, "checked": 1842, "first_invalid_seq": null }
  ```
</CodeGroup>

Tamper with a single field in any record and `valid` becomes `false`, and the
chain says exactly where it broke.

## Next steps

<CardGroup cols={2}>
  <Card title="Add it with one line" icon="plug" href="/integrations/overview">
    Wrap an existing OpenAI, Anthropic, LangGraph, Google ADK, CrewAI, or AWS
    Strands agent with a middleware instead of hand-instrumenting.
  </Card>

  <Card title="Bound autonomy" icon="shield-halved" href="/guides/bound-autonomy">
    Publish an autonomy envelope, arm circuit breakers, and drill the kill
    switch.
  </Card>

  <Card title="Generate an evidence pack" icon="gavel" href="/guides/evidence-packs">
    Map your live records to RBI, DPDP, SEBI, or IRDAI obligations and export a
    signed bundle.
  </Card>

  <Card title="Full SDK reference" icon="code" href="/sdk/python">
    Every client method, the witness session, and the exception model.
  </Card>
</CardGroup>
