Skip to main content

Wire Desk

A treasury agent that plans payments. It cannot send a wire until the treasurer approved that wire on their phone.

ApplicationDraftView source
This page is a draft. The code exists, and not all of it has been run for this page yet. The page says what was checked.
Packages
lumoauth
Works with
PythonLangChain / LangGraphFastAPI
Stack
LangGraph agent in Python, FastAPI payments API

Scenario​

A treasurer asks the agent to pay a supplier. The model plans the transfer and calls the wire tool. The graph does not run the tool: it first asks the treasurer, with the amount and the recipient in the request. The payments API accepts only a token that carries that approval.

People and agents​

WhoRole in the applicationIdentity in LumoAuth
TreasurerAsks for payments and approves each wire.A user with the LumoAuth app enrolled.
Wire agentPlans payments.A registered agent with the switch "May act on behalf of users".
Payments APISends the wire.A resource that verifies the token and the approved detail.

Flows​

FlowWhat happensWhat LumoAuth does
PlanThe model decides to call wire_transfer.Nothing yet.
AskThe ask_human node sends the request.Delivers it to the phone and waits up to 120 seconds.
ApproveThe treasurer approves.Returns the approval to the agent.
SendThe tool node calls the payments API.The API verifies a token that is bound to the agent and approved for this amount and recipient.
DenyThe treasurer denies.The agent gives the denial to the model, which tells the treasurer.

Parts​

PartBuilt withJob
AgentLangGraph, the Python SDKThe graph with its approval node.
Payments APIFastAPI, lumoauth[fastapi]require_access_token with DPoP, and the check of the approved detail.

What the seed script creates​

  • The agent.
  • The payments API as a resource.
  • A test treasurer.

Walkthrough​

  1. Enroll the phone of the test treasurer.
  2. Ask for a wire and approve it.
  3. Ask for a wire and deny it.
  4. Ask for a wire and let it expire.
  5. Read the three outcomes in the audit log.

Before you run it​

  • An agent may send 10 requests in 5 minutes for one person.
  • Check that your plan includes acting for users in the plans matrix.

Where the code is today​

wire_agent.py in the Python SDK holds the agent and the approval node. The payments API is the part to build.