Blog
5 min read

How an AI agent traced a Treasury price back to the raw data

Every node in Beacon’s dependency graph links to its code and its inputs. That let an AI agent price a US Treasury, trace every number back to raw market data, check each step and explain to a human how the price is derived.

Tony Yum
large

At QuantMinds International, Clearwater’s Tony Yum, Lead Engineer in Risk and Performance Engineering, showed how a human validator should handle that gap. It matters because as GenAI starts to write and check financial models, someone has to answer for the result.

Using a live pricing and risk test on a US Treasury in Beacon by Clearwater, the firm’s risk platform, he set out a framework for AI model validation, built around six habits:

  • Fix the setup: the date, data and settings
  • Trace every number
  • Re-perform calculations independently
  • Separate verified from guessed
  • Reconcile conflicts
  • Govern tools and humans alike
When the agent was right, and the human was wrong

The demonstration grew out of a pricing experiment Tony had run with an AI agent and US Treasuries. Recounting the episode on the Vega Stage at QuantMinds International, he described the moment he was about to tell an AI agent it was wrong.

The agent had just reported that a shock to the SOFR curve barely moved the price of a US Treasury, and that the bond was completely linear to interest rate moves. That result sat roughly a thousand times below the risk numbers the platform’s own reports produced for the same bond.

“I was just about to slap it and say, ‘You’re wrong, huh? I’m a human. I’m smarter than you,’” said Tony. “But then I looked again and I realised: oh, he’s talking about just that one-day discount.”

The agent had shocked the curve while holding the bond’s quoted price fixed. The only thing that moved was the one-day discount applied for settlement, so the price barely changed and the response looked perfectly linear.

The agent was right. The anecdote raises the question: if a GenAI agent writes the financial model, who makes sure it’s right?

The question now is how to use GenAI well

Three years ago, Tony struggled to convince colleagues that AI could write code at all. Today the conversation has moved on to how to use it well.

Humans “should still be responsible” for the end decisions, he argued, and AI should be used only to deepen their understanding of risk rather than dilute it.

He likened working with an AI agent to working with a curious child. It lets the validator keep asking “why?” and keep demanding proof.

Conversations with agents have come a long way

His demonstration at QuantMinds showed just how far conversations had come between AI agents and humans. He again used a US Treasury as the example, this time with an AI agent in Beacon.

The agent set the market date to 3 November, picked a 4% Treasury maturing in 2030 and priced it. Slides and a replay video from the conversation were produced by the agent. Along the way it made 67 tool calls, nine of which failed and had to be retried. Such failures, he said, are to be expected: “you might walk down the wrong path.”

How GenAI calculations are traceable

The price itself was straightforward: a market quote of $97.76 per $100 of face value, plus the interest accrued since the last coupon, scaled and discounted back by one day.

What makes the calculation traceable is Gromit, the pricing graph in Beacon. It is a C++ engine whose nodes are defined in Python. Each node links to its code and to the nodes beneath it, much like cells in a spreadsheet.

Only the affected nodes, which are shown in red, are recalculated. Everything in green is left alone, which makes risk far more efficient.

That structure gave the agent something a language model alone lacks: a way to trace any number back to where it came from.

It traced the clean price, the quoted price before accrued interest, back to raw market data. It then checked how the SOFR curve was bootstrapped from 15 par swaps, and recalculated key steps independently. “It doesn’t just take the graph and trust the numbers,” Tony said. “It likes to recalculate.”

Why the agent and platform disagreed

The demonstration produced a similar conflict at the risk step. The agent’s first-principles estimate was about 0.0003 per basis point (per unit of face value), in line with the platform’s risk reports. A direct shock to the curve, however, produced a figure roughly a thousand times smaller.

The two numbers measured different things. The platform’s risk reports hold the bond’s spread to SOFR constant (a Z-spread approach), so bumping the three- and four-year points moved the price. The agent’s direct shock held the quote fixed, so it touched only the one-day discount. Both were defensible.

The agent had inferred the spread assumption from the numbers rather than reading the report code, and it said so. Throughout, the agent separated what it had verified from what it had only speculated. “I haven’t verified. Ask me, and I’ll verify for you.” For Tony, the lesson was “fitness for purpose, not just arithmetic.”

Why guardrails come before autonomy

Safety is the obvious worry. Tony argued the cause of hallucinations is mostly missing context. A model alone is “a brain in a jar”. Give it a harness and tools, and it can check data rather than guess.

Could an agent damage the system? “No one’s going to read through this massive bash command that you don’t understand to approve,” said Tony. Agents in Beacon cannot run Bash or Python directly.

Code runs only in a sandbox inside Clearwater’s infrastructure, with read-only access to the Beacon database and write access to a local lookalike. “The agent thinks it can write into a database, but actually any write just disappears at the end of the session.”

Actions are graded green, yellow, or red, with red requiring manual approval. Approval can also go to a different model, “so you don’t get one AI provider approving itself.”

Tony prefers using a team of models. The one that writes code should not be the one that checks it, he said, with a human judging.

None of it replaces the quant. It sharpens what the quant can ask, and how fast. As Tony put it, “the human is still very much centred in this conversation.”

To explore how Beacon by Clearwater supports traceable, governed AI for quant and risk teams, get in touch with the Clearwater team.