Build / Developers
Add governance to the code you already run.
Instrument with the Python SDK, connect through MCP, or govern calls with the interception proxy. Each route uses the same Sakshi evidence path.
loan_decision.py / PYTHON
from os import environ from sakshi import SakshiClient client = SakshiClient( environ["SAKSHI_API_URL"], api_key=environ["SAKSHI_API_KEY"], ) agent = client.register( "loan-decision-agent", owner_name="Retail credit team", owner_email="[email protected]", ) with client.witness(agent) as record: record.action(outcome="approved")
A decision is useful. A witnessed decision is accountable.
Start with your deployment
Register once. Witness the decision.
Install the Python SDK, supply the deployment URL and an ingest key, and wrap the decision logic you already run. The SDK imports as sakshi.
pip install sakshi-sdk
pip install sakshi-mcpQuickstart
Give one decision an accountable record.
The API key comes from Admin / Ingest keys in your Sakshi console. It is shown once, stored only as a SHA-256 hash, and can be scoped to an organization unit. Keys start with sks_.
The example records a synthetic application identifier and an outcome. Add the model identity, disclosure, steps and other context needed for your workflow.
Start with synthetic data.
A private sandbox gives you a deployment where you can create a key and inspect the resulting evidence.
Request a sandboxfrom os import environ
from sakshi import SakshiClient
sakshi = SakshiClient(
environ["SAKSHI_API_URL"],
api_key=environ["SAKSHI_API_KEY"],
)
agent_id = sakshi.register(
"loan-decision-agent",
owner_name="Retail credit team",
owner_email="[email protected]",
)
with sakshi.witness(
agent_id,
context={"application_id": "4471"},
) as record:
# Your existing decision logic runs here.
record.action(outcome="approved")SDK reference
The core primitives.
| Call | Purpose | Behaviour |
|---|---|---|
register(…) |
Inventory the agent, owner and provenance. | Idempotent by name; returns the agent ID. |
witness(…) |
Open the decision context; record disclosure, steps and outcome. | Idempotent by client_ref and retried. |
enforce(…) |
Evaluate an action against its autonomy envelope. | Fail-closed; never automatically retried. |
request_human_handoff(…) |
Park a decision for a human. | Raises if the handoff is lost. |
record.extraction(…)record.access(…) |
Record extraction and reads by category and reference key. | Govern the operation without putting the raw value in the record. |
Framework middleware
Keep the client you already use.
Middleware captures model or tool calls as steps inside an active witness block. The adapters cover OpenAI-compatible clients, Anthropic, Gemini, Bedrock, LangGraph, Google ADK and MCP sessions.
Provider SDKs are not imported by the duck-typed wrappers.
from sakshi.middleware import (
watch_openai_compatible,
watch_mcp,
)
llm = watch_openai_compatible(openai_client)
session = watch_mcp(mcp_client_session)MCP server
Governance tools for your MCP host.
Add the Sakshi server to the host configuration. Calls use the same deployment, authentication and evidence path as the SDK.
enforce_action: check an action’s authoritywitness_decision: record the decisioncheck_readiness: inspect the evidence coverage
{
"mcpServers": {
"sakshi": {
"command": "sakshi-mcp",
"env": {
"SAKSHI_API_URL": "https://sakshi.yourbank.internal",
"SAKSHI_MCP_API_KEY": "<your-ingest-key>"
}
}
}
}Interception proxy
Put a governed boundary in front of the tool.
| Mode | Behaviour |
|---|---|
| P1 / Transparent | Observe and witness tool calls and the manifest without blocking. |
| P2 / Enforce | Route each call through the envelope. Non-auto calls are parked before reaching the tool. |
| P3 / Poison detection | Block a tool if its description or schema changes during the session. |
sakshi-mcp-proxy --agent-id <agent-id> \
-- npx @modelcontextprotocol/server-filesystem /dataThe proxy starts in P1 (transparent). Set SAKSHI_MCP_ENFORCE=on for P2, and use --http <url> for a remote MCP server.
HTTP API
Your instance is the API authority.
Use the OpenAPI contract for the version you run. Every /api/v1 route enforces auth: Authorization: Bearer <key>.
| Route | Use |
|---|---|
/api/docs |
Interactive Swagger UI against your deployment. |
/api/redoc |
Reading view of the same specification. |
/api/openapi.json |
Machine-readable contract for typed client generation. |
/status |
Public liveness and version; chain state requires an authenticated principal. |
Take the next step
See your first witnessed decision.
Get a private sandbox, create an ingest key, and follow the decision into the console.