Skip to content

Interview question · Long-Running & Durable Agents

The API sends wire transfers and has no idempotency key. Design the agent around it.

Wires cannot be recalled reliably, so the design chooses at-most-once on purpose: one dispatcher may send each intent, a send that ends in doubt is never retried automatically, and the bank's own records settle what happened.

expertNewUpdated Nov 2026

TL;DR: The agent never calls the wire API. It proposes a transfer; the harness records an intent with a unique reference, applies limits and approvals, and hands it to a single dispatcher that claims the intent before sending, so no two workers can send it. Because duplicates are worse than delays, the dispatcher is at-most-once: if a send ends in doubt (timeout, crash mid-call), the intent becomes "unknown" and is never retried automatically. Unknowns are resolved by looking up the reference in the bank's status API or statement, then by a person. Daily reconciliation against bank statements closes the loop.

How to approach it

State the asymmetry first: a delayed wire is an inconvenience, a duplicate is a loss that may never be recovered. That decides at-most-once over at-least-once. Then design the boundary between agent and money, the dispatcher's claim and send protocol, unknown handling and reconciliation.

A strong answer

The agent proposes; the harness sends. The agent's tool is wire_propose(beneficiary_id, amount, purpose). It creates an intent; it cannot send. Limits (per transfer, per day, per beneficiary), beneficiary allowlists and approvals (two people above a threshold) apply to the intent before it is eligible.

A reference the bank keeps. The intent id goes into a field the bank stores and returns: the end-to-end reference or remittance information. Without it, nothing can prove later which wire is which.

One sender per intent. The dispatcher claims an intent with a conditional update before sending:

INTENTS = {"w_101": {"status": "approved", "claimed_by": None}}

def claim(intent_id, worker):
    i = INTENTS[intent_id]
    if i["status"] != "approved":                 # conditional update
        return False
    i.update(status="sending", claimed_by=worker)
    return True

def recover(intent_id):
    i = INTENTS[intent_id]
    if i["status"] == "sending":                  # a sender died mid-flight
        i["status"] = "unknown"                   # at-most-once: never auto-resend
    return i["status"]

print(claim("w_101", "worker-a"), claim("w_101", "worker-b"))  # => True False
print(recover("w_101"))  # => unknown

Only one worker can move the intent from approved to sending. If that worker dies, recovery finds the intent mid-flight and marks it unknown rather than sending again.

Resolving unknowns.

  1. Look up the reference through the bank's payment status API, if one exists, with retries.
  2. Check the next intraday or end-of-day statement for a debit with the reference.
  3. Still unresolved by the deadline: a person checks with the bank. Until then the intent stays unknown, and any duplicate request for the same purpose is blocked.

Reconciliation. Daily, match every statement debit to an intent by reference and every sent intent to a debit. Unmatched debits are an incident (something sent outside the system, or a reference lost); unmatched intents are investigated.

Timing and cut-offs. Wires have cut-off times and settlement windows. Intents approved after cut-off are scheduled, not sent; the agent tells the user when the money will move.

What interviewers probe next

"At-most-once means some wires are delayed by hours." Yes, and that is the right trade for irreversible transfers. Measure how often sends end unknown; if it is frequent, fix the cause (timeouts too short, an unstable connection) rather than adding retries.

"Could the agent itself check the statement?" It can help investigate, read-only. Changing an intent's status from unknown to sent or failed is done by code on matched evidence, or by a person.

"What if the bank offers idempotency later?" Use it as an extra layer, keep the claim and reconciliation. Defence in depth costs little here.

How it's scored

Weak: Retries on timeout with a short delay.

Hire: Intent records with references, lookup before retry, reconciliation.

Strong Hire: Chooses at-most-once from the irreversibility, keeps the agent to proposals behind limits and dual approval, uses a reference the bank stores, claims intents with conditional updates so one dispatcher sends, turns mid-flight crashes into unknowns resolved by status lookups, statements and people, reconciles daily, and handles cut-offs.

Common mistakes

  • Letting the model call the transfer API directly.
  • Automatic retries on unknown outcomes.
  • References kept only in the agent's database.
  • Several workers able to send the same intent.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.