watch_gemini wraps any client that exposes models.generate_content, the
google-genai SDK shape. It is duck-typed, so the Sakshi SDK does not depend on the
google-genai package: it wraps the client you already hold.
Install
Wrap the client
sakshi
and agent_id are created.
What gets recorded
Each generation inside a witness session lands anllm_call step, and the served
model identity auto-fills (para-56):
- The provider, recorded as
google-gemini. model_requestedversusmodel_served, taken from the responsemodel_version, so a silent model swap is visible.- Prompt and candidate token usage.
- The call latency.
- With content capture on, the
contentsyou sent and the response text, each truncated tocontent_limit.
Capture options
capture_contentdefaults toTrue. Content capture is safe by design: the platform tokenizes PII at ingest, before storage or hashing. Set it toFalsefor a minimal-capture deployment where only metadata, tokens, and identity are recorded.content_limitcaps how much of the input and response is stored. The default is 1000 characters.
A call made outside a witness session passes through untouched and is not
recorded. Recording is fail-open: it never breaks or delays the generation.
Full SDK reference
The client, the witness session, and enforcement.

