watch_langchain, and Sakshi does not invent one. LangChain does not
run models itself: it builds on the same provider SDKs Sakshi already wraps, and
modern LangChain agents compile to a graph. So a LangChain app is witnessed
through the surfaces that already exist, with no LangChain dependency in the SDK.
There are two accurate paths, and you can use both together.
Path A: wrap the provider client (recommended for model evidence)
A LangChain chat model calls a provider SDK client underneath. Build that client yourself, wrap it with the matching Sakshi middleware, and hand the wrapped client to the chat model. Every completion then lands anllm_call step with the served
model identity (para-56), tokens, and outcome.
chat.completions or
messages surface LangChain calls, so what gets recorded is exactly what the
OpenAI and Anthropic pages
describe. Consult your LangChain version for the precise constructor argument that
accepts a preconstructed client.
Path B: witness the graph (recommended for agents)
A LangChain agent built with LangGraph, or with a helper likecreate_react_agent,
compiles to a graph that exposes invoke and stream. Wrap it with
watch_langgraph, and decorate individual nodes with witness_node. This path is
provider-agnostic: it does not need to know which model sits underneath.
Full SDK reference
The client, the witness session, and enforcement.

