Shotoku is a local-first governance layer that enforces budget caps and approval workflows before agents execute paid actions. It intercepts tool calls, checks policy rules stored in YAML, and writes decisions to a local JSONL audit log. No cloud sync, no custody handoff, no external approval service.
The core primitive is a synchronous authorization check that runs before any action that costs money, calls a paid API, or mutates external state. If the action exceeds a per-transaction or daily budget, Shotoku denies it or queues it for human approval. The decision is recorded locally, and the agent only proceeds if the status is approved .
Architecture
Shotoku sits between your agent orchestration code and the tool execution layer. The integration point is a single function call:
import { authorize } from "@shotoku/core" ;
const decision = await authorize ( { actor : "shopping-agent" , action : "purchase" , resource : "api.openai.com" , amount : 24.99 , } ) ;
if ( decision .…