Retrieved article excerpt
Open article · Retrieved 2026-11-05T16:26:26.029465+00:00
# 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.
npm install -g shotoku-clicopy[GitHub](https://github.com/shotoku-dev/shotoku)
Add to your AI
[Want to become a design partner ?Let's chat](https://cal.eu/shotoku.julius/design-partner-collaboration)
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.
shotoku
data
decisions.jsonl
LogRaw
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.
shotoku
policy.yaml
data
decisions.jsonl
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.
How do I stop my AI agent from overspending?
Give it a budget. Policy rules take maxAmount (per transaction) and maxDailyAmount (a rolling 24-hour limit) per vendor, and a budget caps everything one agent spends per day. Over a limit, the request is denied before the payment happens, or held for you with overLimit: pending\_approval, so small refunds go through and a big one waits for a human.
How is this different from just writing an if statement before my API call?
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.
What stops an agent from bypassing Shotoku entirely?
Put Shotoku in the path. In MCP wrapping mode, Shotoku sits in front of the agent's other MCP servers, PayPal's included, so every tool call is decided before it reaches them and the agent has no other route through the protocol. Elsewhere, signed receipts: every approved decision carries a short-lived token that your payment proxy or CI verifies before executing. Shotoku still never touches your funds.
Does Shotoku touch my money or keys?
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.
Isn't this just a logger with extra steps?
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.
Do I need an account or internet connection?
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.
Where are decisions stored?
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.
Can I use Shotoku with any AI framework or agent?
Yes. The core is a plain TypeScript function: if your agent can call a function, it can use Shotoku. Any MCP-compatible agent can use the MCP server without code changes, and wrapping puts the MCP servers it already uses, such as PayPal's, behind your policy.
Can I approve from my phone?
Yes. shotoku telegram sends each pending decision to your Telegram with Approve and Deny buttons. Only your taps count, and nothing listens on your machine. There is also a local dashboard (shotoku ui) and a terminal UI.
What happens after Shotoku denies a request?
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.
Is this production-ready?
Shotoku is in beta — early but functional. The core authorization path is stable and tested, and it runs end to end against PayPal's sandbox. Use it for real projects, but expect the API to evolve. File issues and we'll ship fixes fast.
Who's behind Shotoku?
Shotoku is built by [Julius (@juliuspsc)](https://x.com/juliuspsc) and [Issa (@prunier\_issa)](https://x.com/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.
npm install -g shotoku-clicopy[Star on GitHub](https://github.com/shotoku-dev/shotoku)
Add to your AI
[Want to become a design partner ?Let's chat](https://cal.eu/shotoku.julius/design-partner-collaboration)