🏦 Account Servicing Agent API
Play 4 · Agent Intelligence Layer Banking API-layer RBAC Xano + TypeScript

One rule layer for a person and an agent

A governed banking servicing API where a human ops user and an AI agent call the same permissioned, audited endpoints. An over-limit transfer is refused the same way for both, and every attempt lands in one audit trail.

5 tables · 10 API endpoints · 1 rule function · 1 AI agent

Audit trail: a human teller and an AI agent are both refused the same over-limit transfer while a supervisor is allowed, with every attempt logged and the rule that fired named
The audit trail. The same over-limit transfer is refused for the teller and the agent, and allowed for the supervisor, all through one rule layer.

What it demonstrates

An agent that can move customer money is only safe if it obeys the same limits a person does. This backend puts every money movement behind one rule layer. A teller, a supervisor, and an AI agent all call the same endpoints, and each is held to the authority limit that rides on their own token.

The rule lives in one place, not copied into each caller. When the agent asks to move more than its limit allows, it is refused by the exact same code path that refuses a person. Access is API-layer role-based access control (an auth table, minted tokens, and per-endpoint role checks). It is not row-level security.

The one rule layer

Every transfer and hold runs through a single Xano function, servicing_action. It loads the actor, reads their authority limit, then checks three things in order:

  1. the account must be active, or the attempt is refused as account_frozen
  2. the amount must be within the actor's authority limit, or over_authority_limit
  3. the amount must fit the available balance (balance minus holds), or insufficient_available_balance

On an allow it moves the money and writes a posted transaction. On a refuse it writes a refused transaction. Either way it writes one audit row with the actor kind, the outcome, and the rule that fired. The transfer endpoint, the hold endpoint, and the agent endpoint all call this same function.

API surface

VerbPathWhat it enforces
POST/api:asa_auth/loginAuthenticates an actor and mints a token that carries their role and authority limit. Same path for a human and an agent.
GET/api:asa_auth/actorsLists the actors for the demo picker. Never returns the password column.
GET/api:asa_servicing/accountsLists accounts. Any authenticated actor.
GET/api:asa_servicing/account/{account_id}One account, with available balance computed on the server.
POST/api:asa_servicing/transferAccount status, then authority limit, then available balance, before it moves money.
POST/api:asa_servicing/holdThe same checks. Reserves funds instead of sending them.
POST/api:asa_servicing/release-holdSupervisor role only, enforced with a precondition.
GET/api:asa_audit/actionsThe governance trail, newest first, filterable by account or actor kind.
POST/api:asa_agent/runParses a plain-language request, then runs it through the same rule layer under the agent's own limit.
POST/api:asa_admin/seedResets and seeds the demo so every screen is browsable.

Frontend screens

Servicing console

Pick an actor, run a transfer or hold, and watch the rule layer allow or refuse it with the exact reason.

Agent panel

Type a plain-language request. The agent parses it and runs it under its own authority limit.

Audit trail

Every attempt, human and agent, with the actor kind, the outcome, and the rule that fired.

Accounts

Balances, held amounts, and available balance for each account.

Use this template

Clone it and get a live copy on your own Xano account in a minute:

git clone https://github.com/xano-scratch/account-servicing-agent-api.git
cd account-servicing-agent-api
npm install
npx xanots login        # one-time browser sign-in
npm run xano:deploy     # deploys backend + frontend, seeds data, prints the live URL

Or hand this prompt to a coding agent:

Clone https://github.com/xano-scratch/account-servicing-agent-api and get it
running live. Run npm install, then npx xanots login, then npm run xano:deploy.
Open the printed URL and confirm the audit trail shows a human teller and an AI
agent both refused the same over-limit transfer, while a supervisor is allowed.

Every actor signs in with the shared demo password servicing-demo. It is demo data, not a secret.

Live preview

The build ships with an ephemeral preview environment. It expires, so the links in the build notes may be gone by the time you read this. The durable artifact is this repo. Re-deploy with npm run xano:deploy for fresh links. This is a scratch proof artifact that runs on seed data, not a live production system.