AI architecture / Transaction runtime · 01
Why AI travel agents need a deterministic transaction runtime
Where AI belongs in an agent that spends money: signed limits, safe booking order, and handling unknown outcomes across suppliers.
In this article
You approve a four-night trip to Paris: a flight, a hotel and an airport transfer. The agent's explanation is clear, the total fits your budget, and every item shows as available.
Then booking starts.
The flight confirms. The hotel room is gone. The flight was non-refundable, and the agent has no way to undo it. You now own €920 of a trip you can't take.
The model didn't pick a bad plan. Prices move, rooms sell out, cancellation terms change, and a supplier can accept a booking even when its reply never arrives. A good plan doesn't make the bookings safe.
When I design an AI workflow, the first question isn't which model to use. It's where AI belongs. For an agent that spends money, my answer is narrow: let the model understand what the traveller wants, and give everything that moves money to a deterministic runtime. Agents negotiate; the runtime commits.
Who pays for half a trip?
That €920 has to land somewhere. If the traveller carries it, they're unlikely to trust the agent with their money again. If the company running the agent refunds it, every half-booked trip becomes a cost, plus the support time to untangle it. And when finance asks why the agent spent the money, "the model decided" is not an answer.
A better model doesn't fix this. It's an execution problem, and the business owns it.
There is no rollback across suppliers
A trip spans systems that don't share a database. Rolling back your own database won't cancel a reservation a supplier has already confirmed.
So three things become part of the product: what the agent may change without asking, how much money can be lost if something fails, and what evidence backs the final result. They need answers before the first booking request, in a form software can check. "Find something similar" doesn't define an acceptable room swap. "A small increase is fine" doesn't define a price ceiling.
Split the system where the money moves
The design draws one hard line. Above it, agents may use a model: a traveller agent talks to the traveller, a distribution agent searches for offers, and a hotel agent proposes alternatives. Below it, a transaction runtime of plain, deterministic code does everything that can cost money.
Agents reach the runtime through six MCP tools: snapshot, compose, quote_exposure, commit, status and cancel. They hold no credential that can book or cancel, and only the runtime's supplier adapters talk to suppliers. The runtime calls out to an agent in one place only, to ask for a replacement offer, and it re-checks whatever comes back.
The runtime has no dependency on any model, and a build check fails if one creeps in. That keeps the model replaceable: switching providers shouldn't change what "up to 3%" means.
Turn the traveller's words into limits
The traveller agent asks three questions: how much of a price rise it may absorb without asking, whether it may take an equivalent or better room at the same hotel, and how much non-refundable money may be at risk if a later part of the trip fails.
A live LLM turns the answers into a proposal, and the proposal becomes a mandate: a set of hard limits. "Up to three percent" becomes 300 basis points. "Same-hotel upgrades" becomes one option from a fixed list. "No non-refundable risk" becomes a maximum exposure of €0. The mandate also carries a spending ceiling and an expiry. The proposal must pass strict type and range checks; anything invalid is rejected, not quietly fixed.
At booking time, the runtime does the maths itself, in whole cents. If the €1,180 hotel goes up 2%, that's €23.60, inside the limit, so it goes ahead and the receipt records the change. At 4%, it stops and asks. Nobody asks a model whether the increase sounds reasonable.
The check is integer cross-multiplication on whole cents, so there are no floats and no rounding:
if p1 * 10000 > p0 * (10000 + mandate.price_drift.max_increase_bps):
blockers.append("D4") # escalate
elif p1 > p0:
permissions.append("D7") # commit, and record the delta
The traveller approves twice: first the limits, read back in plain numbers, then the exact plan and the money at risk. Agreeing to your preferences and agreeing to spend money are not the same yes.
Snapshot, reconcile, commit
Execution runs in three stages.
Snapshot. Record each supplier's quote and terms in a signed object that expires after 10 minutes. It's a reference point for later checks, not a reservation: nothing is held.
Reconcile. Right before booking, get fresh quotes and run nine fixed rules against the snapshots and the mandate: availability, price, cancellation terms, room, total spend and money at risk. A change inside the limits goes ahead. A replacement for a sold-out room has to pass the same checks. Anything outside the mandate goes back to the traveller.
Commit. Book the items in a calculated order, re-checking each one just before it is booked. Write down the intent before calling the supplier, and the result after. If a later booking fails, cancel the confirmed ones in reverse order.
Given the same inputs, time and rules version, the runtime reaches the same decision every time, so any decision can be explained from its inputs and re-run later to check it.
Book the hardest-to-undo item last
The test trip has three items: an €85 transfer and a €1,180 hotel, both free to cancel, and a €920 non-refundable flight.
Book the flight first, and a sold-out hotel leaves €920 stranded. The runtime sorts by what each item would cost to undo, so the flight goes last. If it fails, the hotel and transfer are cancelled while they're still free. Same three bookings, and the money at risk drops from €920 to €0.
The sort key ends in a total tie-break, so the same trip always gives the same order:
def _sort_key(item: ExposureItem, costs: dict[str, int]) -> tuple[int, int, int, str]:
"""Undo cost ascending, failure rate descending, price ascending, item_id."""
return (costs[item.item_id], -item.failure_rate_bps, item.price.amount, item.item_id)
The runtime calculates the worst case before booking anything and compares it with the traveller's limit. When a trip can't fit, for example with two non-refundable items, it asks the traveller instead of hiding the risk.
A timeout is not a failure
A timeout means you don't know what happened. It doesn't mean nothing was booked, and a blind retry can book the same room twice.
So the runtime marks the item unknown and works with what the supplier supports. If the supplier can look a booking up by key, the runtime checks for up to 60 seconds and adopts a booking that already exists. If the booking is definitely absent, it retries once with the same key, but only when the supplier books idempotently and the terms haven't changed; otherwise the item fails and the rest of the trip unwinds. If the outcome is still unknown, or the supplier can't look bookings up at all, a person gets the alert.
Every step also goes into a signed, hash-chained record, so a reviewer can check what actually happened instead of trusting an agent that says "success". Both deserve their own posts.
How I tested it
I built and tested a working prototype of this runtime in collaboration with two teammates. Its demo runs a real backend and a live LLM against simulated suppliers. The scenarios cover a clean booking, a price change, a sold-out room replaced within the mandate, cancelling confirmed bookings after a failure, and stricter cancellation terms that need the traveller's decision.
Limits
This is a prototype, so here is what it doesn't show yet:
- The suppliers are simulated. It hasn't been validated against a live supplier's booking system.
- The €0 figure holds for the test trip's terms. Two non-refundable items, unclear cancellation terms or a supplier that can't cancel change the maths.
- The demo scenarios show each behaviour in action. They aren't a benchmark: a fair comparison against a naive agent, on the same inputs and failures, is still to come.
- Signatures prove what was recorded, not that a supplier told the truth.
Before your agent touches money
If I were reviewing an AI agent before it could spend real money, I'd ask three questions:
- What exactly did the user approve, in numbers a machine can check?
- What happens when a supplier's answer never arrives?
- How would someone else verify what the agent did?
If the answers live in a prompt, the agent isn't ready. A capable model helps people say what they want. A deterministic runtime makes acting on it checkable and recoverable. The same split applies to any agent that books, buys or reserves anything outside your own database: procurement, ticketing, payments.
I write about enterprise AI adoption and GenAI architecture. For the short versions and the discussion, follow me on X and LinkedIn.