Agent runs with a list of hook providers, and the SDK invokes their
callbacks around every tool call and model call. Sakshi ships one.
SakshiStrandsHooks is a HookProvider: pass it via Agent(hooks=[...]) and every
tool and model call is witnessed on the active decision. Turn on enforce and each
tool call is routed through the agent’s autonomy envelope before it runs. The
provider does not import strands at module load, so it degrades cleanly and
carries no version lock.
Install
Register the hooks
PassSakshiStrandsHooks in the agent’s hooks list, and run inside a witness
session.
What gets witnessed
As the agent runs, the provider records onto the active witness session:- Model calls become
llm_callsteps with the served model and the finish reason. - Tool calls become
tool_callsteps with the tool name, the argument keys (never the values, which are tokenized at ingest anyway), and the status. A tool that raises or is cancelled is recorded as such. - The agent invocation is bracketed with
agent_startandagent_end.
Enforce in the tool path
Withenforce=True, the provider routes each tool call through the agent’s autonomy
envelope in BeforeToolCallEvent, before the tool runs. An auto outcome lets the
tool proceed; anything else cancels the tool (Strands’ cancel_tool) so it never
executes, and a tool_blocked step records why.
exempt_tools is never gated.
Full SDK reference
The client, the witness session, and enforcement.

