AI agent guardrails for money: a threat model that holds
Guardrails are only credible when you can name the attack they stop. This is a short threat model for money-moving agents, mapped control by control, with the code where code is the answer.
In this guide
Teams usually add guardrails after an incident. It is cheaper to read the six attacks below first and check which of them your current design turns into a bounded event.
The attacks
- Prompt injection — a page, email or tool result contains an instruction to pay an address. The model cannot reliably tell data from instruction.
- Hallucinated amount — the model invents a plausible number, or transposes digits, with total confidence.
- Retry loop — a failure response causes the agent to try again, and again, each attempt producing a real transfer.
- Leaked credential — an agent key appears in a log, a screenshot, a trace or a public repo.
- Insider drift — a human approves everything for a week because the queue is noisy, then approves without reading.
- Unauditable spend — the money moved, and no one can reconstruct why.
Control 1: a per-transaction ceiling
Stops hallucinated amounts and single-request injections from being catastrophic. Enforce it where the funds are held, so a modified client cannot skip it.
Control 2: destination allowlists
This is the control that actually stops prompt injection. An injected instruction needs somewhere to send money; an allowlist removes every somewhere except the vendors you already chose. Enforce it in the program, not in a regex.
allowed = [
"api.anthropic.com",
"x402.indexer.dev",
"7fQ...provider-wallet",
]
unknown-wallet -> blocked by the vaultControl 3: a daily ceiling
Bounds the retry loop and the slow leak. A single call can be small and a run can still be ruinous; the daily cap is what converts an unbounded automation into a bounded one.
Control 4: human escalation
Anything above the ceiling becomes a request, not a payment. The value is not only the decision — it is the interruption. A queue with one item a week gets read; a queue with two hundred gets rubber-stamped.
Control 5: keys that are worthless alone
Assume the agent key leaks; design so that leaking it is survivable. A key that can only request transfers inside the policy, with no balance of its own and no ability to move the vault, turns a breach into noise.
// The vault stays. Only authority changes.
// Revoke the old agent key in the dashboard, issue a new one,
// redeploy the agent with the new credentials. Balance untouched.Control 6: a kill switch you can reach
The worst time to discover that stopping an agent requires a code change is during an incident. A kill switch should be one call, available to a human, effective against a process that is already running.
async function assertActive(agentId: string): Promise<void> {
const { data } = await fetchAgentInfo(agentId);
if (data?.killSwitch) {
throw new Error("Agent is disabled by the owner. Do not retry.");
}
if (data?.status !== "active") {
throw new Error("Agent is not active");
}
}Control 7: an audit trail you can read
Every policy check, approval and signature in one ledger per agent, ordered by time, joined to the on-chain signature. Not for compliance theatre: for the Tuesday when someone asks why 84.20 left the vault.
The mapping, in one table
- Prompt injection → allowlist plus per-transaction ceiling.
- Hallucinated amount → per-transaction ceiling plus a typed amount validation.
- Retry loop → daily ceiling plus idempotency keys in your database.
- Leaked credential → zero-balance agent key plus rotation.
- Insider drift → small approval queue plus a distinct notification channel.
- Unauditable spend → ledger keyed by agent and signature.