Rule DSL reference
Rules are YAML: when X, then Y. They are evaluated in order and the most severe action wins (block > hold > note > allow). Actions: allow, note, hold, block, alert.
version: 1
defaults:
mode: inherit # inherit the agent's mode
fail: open # open | closed if Keeprun itself errors
rules:
- id: hold-big-refunds
when: { tool.risk_class: refund, amount: { gt: 2000, currency: INR } }
then: hold
approvers: [owner, approver]
expire: 30m
fail: closedPredicates include:
tool.risk_class,tool.name,tool.irreversibleamountwithgt,gte,lt,between,currencycheck: <id>matches when a check firedexpra sandboxed expression with a 5 ms budget and whitelistedlookup()duplicate,count(velocity),payee/recipient.not_in_historytimewindows,matches/output_or_input_matches(RE2-safe regex)
Currency conversion uses a static daily table and is labelled approximate.