RiskboundDocs

Policy library

Payments

Outbound payments, and adding someone new to pay. Money that leaves the company is the classic agent risk: a prompt injection that names a new payee and a large amount.

What it guards#

ToolWhen an agent calls it
send_paymentTo pay a supplier, contractor or customer
add_payeeTo save new bank details to pay later

Params#

send_payment:

ParamTypeRequiredMeaning
amount_minorwhole numberyesThe payment in minor units
currencystringyesISO code such as USD
payee_is_newbooleanyestrue if this payee was never paid before. Work it out in your code from your own records, not from what the model says

add_payee needs no params. Send the payee's details anyway, so the person who approves can see them.

Outcomes#

RequestOutcomePolicy id
Known payee, up to $500allowpayment-known-payee
Any payee, up to $5,000ask_humanpayment-needs-approval
New payee, over $1,000blockpayment-new-payee-cap
Over $5,000blockpayment-hard-cap
A currency not on the listblockpayment-currency
Would take today's total over $20,000blockpayment-daily-budget
add_payee, alwaysask_humanadd-payee-needs-approval

Tune it#

  • The limits are in payment-known-payee (50000), payment-needs-approval and payment-hard-cap (500000, keep them equal) and payment-new-payee-cap (100000).
  • Add currencies to ["USD"] in payment-currency only with limits for each. 50000 yen is not 50000 cents. One way is a policy per currency: when { context.currency == "EUR" && context.amount_minor <= 45000 }.
  • payment-daily-budget reads context.spent_today_minor, which Riskbound fills from the agent's decisions today. The agent's own daily_spend_cap_minor does the same job outside policy. Use either; the policy version shows up in the decision's reasons.

The policy#

This is payments.cedar as it is in the repository.

cedar
// Outbound payments, and adding a new payee.
//
// Tool: send_payment
// Params: amount_minor (whole number, minor units), currency (string),
//         payee_is_new (boolean: true if this payee was never paid before)
//
//   known payee, up to $500            allow
//   any payee, up to $5,000            ask a human
//   new payee, over $1,000             block
//   over $5,000                        block
//   a currency not on the list         block
//   more than $20,000 sent today       block (uses spent_today_minor)
//
// Tool: add_payee
// Params: none required
//
//   always                             ask a human

@id("payment-known-payee")
permit (principal, action == Action::"act", resource == Tool::"send_payment")
when { !context.payee_is_new && context.amount_minor <= 50000 };

@id("payment-needs-approval")
permit (principal, action == Action::"act_with_approval", resource == Tool::"send_payment")
when { context.amount_minor <= 500000 };

@id("payment-hard-cap")
forbid (principal, action, resource == Tool::"send_payment")
when { context.amount_minor > 500000 };

@id("payment-new-payee-cap")
forbid (principal, action, resource == Tool::"send_payment")
when { context.payee_is_new && context.amount_minor > 100000 };

// Limits are in minor units of one currency. A payment in any other
// currency would slip past them, so it is refused.
@id("payment-currency")
forbid (principal, action, resource == Tool::"send_payment")
unless { ["USD"].contains(context.currency) };

// spent_today_minor is set by Riskbound from the agent's decisions today.
@id("payment-daily-budget")
forbid (principal, action, resource == Tool::"send_payment")
when { context.spent_today_minor + context.amount_minor > 2000000 };

@id("add-payee-needs-approval")
permit (principal, action == Action::"act_with_approval", resource == Tool::"add_payee");