The answer looked right. That was the problem.
When Natalia Connolly and Kevin Madura, both on the AI and data team at consulting firm AlixPartners, pointed Claude Code at a healthcare merger’s procurement question, the output was — in Connolly’s words — “complete,” “certainly well formatted,” and “plausible enough.” It broke down annual spend, split it between the two companies, and counted the contracts. A procurement lead reading over a shoulder would have nodded.
Then they checked every number against the underlying warehouse data. Total contract value was wrong by roughly $800,000. And the date the buyer needed to act before the soonest contract auto-renewed was off by a full month — the agent said December 1, the truth was November 1. “Had the procurement lead trusted the agent and waited until December 1, the contract would have auto-renewed whether we wanted it or not,” Connolly said, speaking on the AI Engineer podcast. That single date turns a formatting quirk into a real financial loss.
The engagement was a synthetic replica of a real deal: a large healthcare parent, “Harbor Health,” acquiring a niche regional player, “Summit Health Plan,” both holding contracts with a shared vendor called Acme Health Services. The two-person team ran the analysis on more than 40,000 contracts, which stripped the discussion of marketing gloss. This was practitioner’s testimony about where autonomous coding agents actually break — and what it takes to stop them.
Plausible answers are more dangerous than broken ones
The framing that anchors the whole conversation is what Connolly calls a completeness illusion. A broken agent — one that errors out, returns garbage, crashes — is easy to catch. A confident agent that returns a neat table with one wrong row in it is not.
Answer checked against source dataResultTotal annual spendCorrectSpend split between the two companiesCorrectContract countCorrectTotal contract valueWrong by roughly $800,000Deadline before auto-renewalWrong — December 1 reported, November 1 actual
The date error had a subtle root cause. The agent pulled the date from the contract’s termination clause when the question actually required a date calculated from its renewal clause. Two clauses, one looking like the other, one number that quietly invalidates a procurement decision.
Madura’s takeaway is that these are not isolated bugs. “It seems like a minor thing,” he said, “but it’s a lot of these nuanced issues which compound your error rates. And so the more you can build these sorts of rules in up front, the better the result ultimately will be.”
Contracts are messier than anyone expects
Connolly’s central argument is that extracting data from contracts looks straightforward and is not. She walked through four recurring failure modes, all of which had to be solved before the agent could be trusted. “None of this is exotic,” she said, “but it just shows that real contract portfolios are full of issues that may or may not be apparent when you first started out on this journey.”
The orphan amendment is the one that produced the $800,000 miss. An amendment sits in the database, floating free, unlinked from the master agreement it modifies. The agent cannot find what it does not know to look for, so the value simply never enters the calculation.
The restating amendment is more insidious because the numbers look perfectly reasonable. Take one master service agreement plus two amendments, each of which restates the total contract value rather than adding to it. A naive agent sums the dollar figures and reports about $17 million. The correct answer is $7 million — the figure from the most recent amendment. “If you read the actual text, not just look at the numbers, the dollar numbers, the text says that every amendment restates the total contract value,” Connolly said. “So the correct answer is seven, which is the most recent amendment’s value.”
The fourth problem is almost mundane: a rate table that spans two pages and resumes on the second with a column of numbers and no header row, leaving the agent to guess what each value represents. And there is a fifth, sneakier one — very long contracts that hang during preprocessing. If you catch the timeout exception and move on, the document “never reaches the database and you never know it is missing.”

Two weeks of plumbing, then 40,000 contracts overnight
The answer to all of this was time and engineering, not a cleverer instruction. The team built a five-stage pipeline and deliberately held Claude Code back until structured data existed.
The upfront investment was about two weeks. Once the pipeline was built, the 40,000-plus contracts processed overnight. Doing the same work by hand, Connolly estimated, would have required “a much larger team than just us two” and considerably more time.
But the biggest payoff was verification. Structured tables meant every answer the agent gave could be checked in code rather than by a human rereading documents. “It was very important to have those structured tables, not only because it helped out Claude Code, but also because it made it that much easier for us later on to go and check every answer programmatically in code,” Connolly said. That is the quiet argument for doing the plumbing: it doesn’t just improve the answer, it makes the answer auditable at scale.
Put the business rules in the tools, not the prompt
Madura’s contribution is about where knowledge should live. His instinct, he admitted, was to let the model “rip” on raw unstructured data — a legitimate approach. But in a deal where you already know exactly what you need, the smarter play is to build the frame first. “We know upfront we want rate tiers, we know we want rebates, we know we want certain data elements,” he said. “So you structure some of that upfront and then let Claude fill in that framework behind it.”
Once the data is highly structured, Claude Code can build tools for itself: the generic ones like executing SQL or listing tables, plus engagement-specific shortcuts such as “get rate card page” or “get specific vendor spend.” Those custom tools are where the business logic goes. “We lean more on these custom tools and custom views within the database to enforce some of that business logic in code versus just relying on a prompt,” Madura said.
This is a contrarian stance in a field that has spent two years celebrating the power of the well-crafted prompt. The team’s reasoning is that prompts are fragile and non-reusable, while a tool that encodes a rule — this clause governs this question, this vendor’s spend lives here — keeps enforcing it automatically, and carries forward to the next agent. The packaging matters too: custom MCP servers and saved configurations mean knowledge accrues across an engagement instead of being rediscovered each time.
Madura draws a neat analogy. Claude Code was built to navigate large, messy codebases autonomously. Contract and spend data, once in tabular form, is the same kind of problem — a big, tangled structure the model has to find its way around. It helps that the underlying systems are usually a mess to begin with: “So many organizations have a contract lifecycle management system,” he said. “They’re almost never maintained properly or well.” That is precisely why the team rebuilds the contract hierarchy from the source documents rather than trusting the records.
Charts, permissions, and the failures that hide in plain sight
Two smaller technical details carry outsized risk. The first is charts. Contract pages are mostly text, but not always — and a chart run through ordinary OCR gives you its axes and loses the information inside it. The fix was to treat the pages as images and pass them through DSPy to produce highly structured output. Madura flags that this may prove a “bitter lesson” — the kind of scaffolding that becomes irrelevant as models improve, perhaps within six to twelve months. But it solved the case in front of them.
The second is access governance, and it is more dangerous than it sounds. Harbor Health and Summit Health Plan were separate entities with separate data permissions. Some tool calls returned malformed values, zeros, or permission errors — and Claude Code, getting no useful feedback, proceeded as though an invoice were genuinely zero. The lesson is that a denied permission must be reported to the agent explicitly, so it can fail gracefully, recover from another authoritative source, or flag a human. When the downstream output is a savings estimate presented to a client, silence is the worst possible response.
A dozen good answers need one referee
AlixPartners colleagues with roughly 20 years in the field maintain a library of savings levers — shared vendors, different vendors buying the same services, and so on. The team dispatched agents to run each lever in parallel, and Madura reports the results were “actually pretty good.”
The problem came after the fact. Two agents can surface the same potential saving from two angles — same vendor, same source — and the client gets double-counted. The answer was a separate, highly prescriptive reconciliation step built around DSPy, defining which data points to evaluate, how to reconcile them, and what counts as an acceptable next step. Madura connects this to another talk at the event on using directed acyclic graphs to govern policy execution — the same idea of a rigid workflow refereeing the creative work. Parallel agents, in other words, are only as useful as the disciplined process that merges their output.

The gap that no prompt can close
Madura calls this the most obvious lesson in hindsight and the trickiest in practice. In a live M&A deal, management had already begun actioning some initiatives before the analysis landed. The agents produced recommendations that were perfectly sound and utterly useless. “It will come up with these great recommendations, but it would be shot down immediately because, hey, we already started that 3 months ago,” he said.
The difficulty is timing. Feed the right context in too early and you hamstring the analysis; feed it in too late and the final recommendations miss the moment when they could change a decision. His proposed mechanism is knowledge accrual — a memory system, or rules baked into tools, so the agent doesn’t burn tokens rediscovering problems already flagged.
Which leads to the closing rules, and the one that matters most. Invest tokens, effort, and money upfront so the model isn’t spinning its wheels on structured data. Then accept that “context is still king.” Madura acknowledges the alternatives — retrieval approaches and ever-larger context windows, name-checking RLMs and a colleague in the audience — but says neither substitutes for knowing what’s actually happening in the business. A model with a million-token window still doesn’t know that the savings program it just proposed launched three months ago.
The tension he leaves unresolved is the one worth watching. If better models absorb much of this scaffolding within six to twelve months, as he suspects, then the durable asset isn’t the pipeline. It’s the encoded business rules and the reconciliation discipline around them. For anyone building with agents, that reframes where to invest: the two weeks of data engineering is the cheap, temporary part. The accrual of deal-specific context — what management has already actioned, which clause governs which question — is the part that determines whether the agent’s confident answer is right. As Anthropic’s own tooling gets more capable and the market debates what its parent company is worth ahead of a hotly contested IPO, the AlixPartners case is a reminder that model capability is only half the equation. The other half is the boring, bespoke work of telling the machine how your business actually works — and until the models learn it on their own, that work is where the money is won or lost.