Shotoku

Give your agents a budget, not your card.

Budgets, approvals, and a tamper-evident audit trail for AI agent spending — enforced before the payment happens, entirely on your machine. Deterministic. No custody.

GitHub
Want to become a design partner ?Let's chat
Shotoku
Shotoku
1 pending approval

Agents spend.
Shotoku checks first.

Every autonomous action
needs a decision.

Spend money
$42 payment request
Call paid APIs
POST /v1/messages
Use MCP tools
tool.invoke()
Execute code
node script.ts
Shotoku
Budget Check → Approval Gate → Audit Log
Decision recorded locally.

Local-first by design.

Every spending decision stays on your machine.

dec_01approved$12.00
dec_02pending_approval$89.99
dec_03denied$210.00
apr_01approved dec_02
{
"id": "dec_01"
"status": "approved"
"amount": "12.00"
}
{
"id": "dec_02"
"status": "pending_approval"
"amount": "89.99"
}
{
"id": "dec_03"
"status": "denied"
"amount": "210.00"
}
{
"id": "apr_01"
"type": "approval"
"decision": "dec_02"
"status": "approved"
}

Policies decide.

Budgets and rules, in one YAML file.

rules:
- resource: openai.com
actions: [purchase, api_call]
maxAmount: 50
maxDailyAmount: 200
verdict: approved
within budget, passes
- resource: stripe.com
actions: [purchase]
verdict: pending_approval
big spends wait for you
- resource: "*"
verdict: denied
everything else stops
agent.ts
import { authorize } from "@shotoku/core";
const decision = await authorize({
actor: "shopping-agent",
action: "purchase",
resource: "api.openai.com",
amount: 24.99,
});
console.log(decision);
/*
{
status: "approved",
decisionId: "dec_4f8a91",
reasons: [
"OpenAI is allowlisted",
"Purchase is below $50 limit",
"Daily budget remaining: $175.01"
],
}
*/

One function call.

Add spend controls to any agent in minutes.

Give it a budget. Policy rules take maxAmount (per transaction) and maxDailyAmount (a rolling 24-hour budget) per vendor. A request over either limit is denied before the payment happens, with a reason naming the exact cap it hit.

An if statement is logic. Shotoku is infrastructure. It gives you rolling budgets, a structured audit trail, a human approval queue, policy as config instead of code, and MCP integration — so the same rules apply whether your agent runs in your terminal, in Claude, or anywhere else.

Signed receipts. Set SHOTOKU_RECEIPT_SECRET and every approved decision carries a short-lived signed token. The infrastructure that executes the action — your payment proxy, MCP gateway, or CI — verifies the receipt first, so nothing runs without an approval. Shotoku still never touches your credentials or funds.

Never. Shotoku holds no funds, stores no credentials or private keys, and never signs or settles a payment. It only decides whether a spend is allowed and records that decision — your agent's own wallet or payment rail does the executing.

Logging records what happened. Shotoku decides what should happen before it does. The budget checks, approval queue, policy evaluation, and structured reasons are what make it enforcement rather than observability.

No. Shotoku runs entirely on your machine. No account, no cloud, no telemetry. Decisions are stored locally in a JSONL file you can inspect, move, or delete at any time.

In a local append-only file at data/decisions.jsonl inside your project. Every authorization decision — approved, denied, or pending — is written there in plain text.

Yes. The core is a plain TypeScript function. If your agent can call a function, it can use Shotoku. There's also an MCP server so tools like Claude can call it directly without any code changes.

The agent receives a structured response with the denial reason and a decision ID. What happens next is up to you — retry, surface it to the user, or halt. Shotoku records the decision either way.

Shotoku is v0.1.0 — early but functional. The core authorization path is stable. Use it for real projects, but expect the API to evolve. File issues and we'll ship fixes fast.

Shotoku is built by Julius (@juliuspsc) and Issa (@prunier_issa) — two developers from France who care deeply about building great software. Shotoku is open-source today, with plans to grow into an enterprise product. Contributions and feedback are very welcome.

Your agents are already spending. Set the limits.

Star on GitHub
Want to become a design partner ?Let's chat