Financial services
Initiate payments within recipient scope and per-request limits, with approvals for larger amounts.
A finance agent initiates payments for an authenticated user, only to recipients the user has verified, automatically under a threshold and with approval above it.
1. Register actions and resource types
In the dashboard, open Actions & resources. Register each resource type, then each action. To paste an attribute schema, switch the attribute editor to JSON.
Resource type account: attributes
{
"owner_id": { "type": "id", "required": true }
}Action accounts.read on account, no context attributes
Action payments.initiate on account: context attributes
{
"amount_minor": { "type": "integer", "required": true, "minimum": 1, "provenance": "caller" },
"currency": { "type": "enum", "required": true, "values": ["CAD", "USD"] },
"recipient_verified": { "type": "boolean", "required": true }
}2. Policy
Replace <YOUR_POLICY_ID> with a new policy ID, then
validate, test and publish it with reqlo policies push --publish.
id: <YOUR_POLICY_ID>
name: Payments
rules:
- id: own-accounts
effect: allow
actions: [accounts.read]
condition: resource.attributes.owner_id == subject.id
- id: small-payments
effect: allow
actions: [payments.initiate]
condition: resource.attributes.owner_id == subject.id && context.amount_minor <= 50000
- id: large-payments-approval
effect: require_approval
actions: [payments.initiate]
condition: resource.attributes.owner_id == subject.id && context.amount_minor > 50000
approval: { expires_in_seconds: 900 }
- id: verified-recipients-only
effect: deny
actions: [payments.initiate]
condition: "!context.recipient_verified"Owners and admins can approve requests from this policy in Approvals. To route them to specific people,
create an approval channel and add channel_id: APC_… to the rule's approval.
3. Authorize on the server
const account = await ledger.accounts.get(args.accountId);
const recipient = await ledger.recipients.get(session.userId, args.recipientId); // your verified list
const decision = await reqlo.authorize({
agent: { id: "agt_payments_3" },
subject: { id: session.userId, kind: "user" },
action: "payments.initiate",
resource: { type: "account", id: account.id, attributes: { owner_id: account.ownerId } },
context: { amount_minor: args.amountMinor, currency: account.currency, recipient_verified: Boolean(recipient?.verified) },
});Notes
- Daily or cumulative limits need an atomic reservation in your ledger; ReQlo evaluates one request at a time. See Policies.
- Banking context (
recipient_verified, currency) is computed on your server, never taken from the model. - Amounts and currencies are customer-defined attributes; ReQlo has no built-in financial fields.
Every example uses the same request model; only the customer-defined actions, resources and attributes differ. See Core concepts.
Something wrong or unclear? Report an issue with this page.