Strands Agents
Check every tool call a Strands agent makes with Thoth before the tool runs, in TypeScript or Python.
Thoth checks each tool call a Strands Agents agent
makes before the tool runs: your own tools, MCP tools, vended tools and agents
used as tools. It works with the TypeScript SDK (@atensec/thoth 0.2.0 or
later, tested with @strands-agents/sdk 1.23.0) and the Python SDK
(atensec-thoth 0.6.0 or later, tested with strands-agents 1.63.0). See
framework compatibility.
Connect
Register the agent in Thoth first, and give your app its connection settings:
Your first governed agent covers registering an agent and creating its key.
Govern the agent
Call init() once at startup. Every Strands tool in the process is then
checked before it runs, including tools created before init(). Run each
request inside actingFor for the user it serves:
init() patches the copy of Strands that Node resolves from
@atensec/thoth. If your app is bundled with its own copy (some Next.js and
edge builds), govern the tools directly instead:
Thoth checks each call when the tool runs, with its final input, and the tool runs with exactly the input Thoth checked, so a hook registered later can't change it after the check.
What each decision does
| Decision | What happens |
|---|---|
ALLOW | The tool runs. |
DENY | The tool never runs. Strands gets an error tool result saying Thoth refused the call, with the reason, and the agent carries on, so the model can tell the user. |
STEP_UP | The call waits for a person to approve it. If it's approved, the tool runs; otherwise it's refused as for DENY. |
If Thoth can't be reached, calls are refused unless you set fail-open
(failOpen: true, or THOTH_FAIL_OPEN=true).
The agent's observe or enforce mode is set in Thoth, not in code. Start a new agent in observe: Thoth records what it would have decided and every call runs. Switch the agent to enforce when the observe summary shows it's ready.