Healthcare’s Agent Bytecode: X12 as the Harness for AI Agents — Vasant Kearney, Onlay

summarized

TLDR

X12, the decades-old standard for healthcare insurance transactions, is the ideal harness for AI agents in claims processing because it provides a strict, predictable structure that LLMs thrive on. The speaker argues that grounding agentic workflows in X12 transactions — rather than letting models generate their own schemas — makes the system safer, more auditable, and easier to maintain, while still allowing flexibility through memory and tool use. The real challenge is balancing agentic freedom with hardcoded guardrails, and being deeply skeptical of AI outputs even while embracing them.

Key points

  • The goal of AI in healthcare claims is to reduce insurance interaction costs and improve patient experience, not just to experiment with technology.
  • X12 provides a strict, standardized structure for insurance transactions (e.g., 270 for eligibility, 275 for attachments, 835 for payment) that LLMs can predict reliably, unlike free-form schemas.
  • Agentic execution layers in healthcare must include memory (partner, organizational, user) but persistent memory across chats can introduce bias; users must be able to break out of learned patterns.
  • Multimodal context is often lost when reducing images to text findings; the speaker warns against discarding raw image data that may be relevant to downstream procedures.
  • Insurance companies' systems (phone, web, X12) can all agree on incorrect information; there is no ground truth, and X12 data can be wrong or updated later.
  • Hardcoding all steps leads to unmanageable code bloat, while pure agentic reasoning is expensive, slow, and error-prone; the solution is a balance using X12 as the grounding harness.
  • When introducing new models, you cannot simply swap them in; you must redo evals, testing, and validation because a model that is better on benchmarks may not be better for your specific system.
  • The speaker advocates being 'AI pilled' but also 'AI skeptical' — using small, cost-effective models where possible and not throwing expensive models at routine tasks.

Tools mentioned

Techniques

  • Agentic execution layer
  • Multimodal processing
  • Memory (partner, organizational, user)
  • X12 transactions as structured harness
  • Hardcoded guardrails vs. agentic freedom balance
Transcript (captions)

0:01 [music] >> Hey everybody. How's everyone doing today? Good. So, this is a bit about my background,

0:23 but I think it's always really good to learn what the audience background is if it's more on the technical side, which I know this conference is, healthcare side. Let's get a quick show hands to

0:34 see who Who here is on the healthcare side? Ooh, wow. That's a lot of you. There's more than I expected. Wow. Okay. Who here is on the technical does the

0:43 genetic workflows? Wow, okay. Overlap. All right. As should be expected at this conference. Who here has models running right now somewhere doing some work?

0:55 Wow. It's like the whole audience. Okay. All right. So, I know who I'm talking to. Wonderful. This is the right crowd.

1:03 So, what is the goal of this? Like if we're working in healthcare and we're doing some genetic workflows, we have to keep in mind the goal.

1:15 And that goal, at least from my perspective, is to drive the overall cost down. So, in this talk will be about insurance cost specifically, the cost of of

1:29 interacting with insurance. Um, but also to improve the patient experience because insurance relates back to the patient and how they experience the whole process. So, let's

1:41 keep that in mind when we're solving problems. I know that if we're on the technical side, we like to get really experimental with things and get excited about just this the technology itself,

1:51 but has to be grounded in one of these two concepts. So, a little trip down memory lane just starting from this long journey of AI machine learning and where we are today.

2:06 And we're obviously going to talk about the last point, this agentic execution layer. But, we can see this evolution from the neuron convolutional neural networks

2:17 large-scale unsupervised learning back in 2011 2012. Then, the introduction of attention is all you need, one of my favorite titles for a paper, the introduction of the

2:30 the transformer. Then, we go into this modern chat interface with these large language models. And then, finally with the Claude codes, the Codexes,

2:43 and our system internally, and a lot of systems you have open claw, Hermes agent, all all that kind of stuff. Which really brings into the into the picture this execution layer. So, we're

2:55 going to be talking about how to do this execution layer safely and reliably in health care. So, let's think back to some of the earlier examples of like getting really

3:11 excited about some AI technology and then realizing it has all these little bits and pieces which make it a lot more trickier than maybe it is is obvious at first. So, like you have a check and you

3:24 want to cash it. You want to deposit it into your bank account. Um you might say, "Oh, we have solved the handwritten digit problem. We can recognize digits from zero to nine." Right? Wow, oh oh,

3:36 so now we're ready to um deposit this check into this person's account and transfer money. Well, not quite because as you dig in a little bit deeper you see that you have to identify

3:48 all sorts of characters in the check. You have to make sure it matches up with all these other pieces of the infrastructure. You have to make sure that it is um that it is um going to the

4:01 target account that you're interested in. So, parts of this can be thought of as as the harness. Um in claims, we have a similar

4:11 challenge that there's a lot of these little AI steps involved in fulfilling that whole patient journey of eligibility to getting the insurance company to deposit money in the

4:26 provider's bank account. A whole bunch of little steps. And we have to make sure that we're safely doing this, that we're operating like in these tight con these strict confinements.

4:42 So, another thing that comes up, just sort of setting the stage, is that um multimodal context in comes up very frequently with claims.

4:54 So, you might have an image and it might seem like at at first for cost reasons or something else that you'd want to take that image and reduce it down to the findings, like here's the anatomy in

5:05 the image, and maybe even extract some geometries from that anatomy. Here's pathologies. And then you would take that and then combine it with some other machine learning with some other data in

5:17 a different downstream machine learning model. Like um EHR. And that might make sense from a cost

5:25 perspective and also just like model capabilities. Um but in a lot of situations, it you lose context. So, it might be

5:37 that you're extracting all this information and missing something that relates to some downstream procedure that you didn't that wasn't the upstream model wasn't aware of it.

5:48 So, that introduces this concept of just multimodal processing. So, uh uh another place this comes up in healthcare, but not related to anatomy or anything like that, is desktop use.

6:01 You can see that sometimes, you know, things are buttons or or or, you know, it might have some shapes that are only obvious when you do this multimodal.

6:16 All right. What is the agentic execution layer? So, this can this can take on a lot of different forms. It is

6:27 the ability of this model to take actions. So, it might be you're starting out with um database queries. And let's say it's

6:37 just completely open. You're querying the database, you're finding your schema, you're figuring out what this what the data looks like, and then you might even

6:47 have access to your code. So, then you're querying your code with the respect to your data. Uh and you might actually, in our system or other systems, you might be making

6:57 insurance transactions. You might be making a phone call. You might be looking at a web portal. You might be interfacing with an EHR. These are all actions you can take.

7:08 And some of these actions have right implications. If you're interfacing with different PMSs, you're going to the desktop, you can have at least user logs at the minimum.

7:20 Uh and then the next concept is memory. So, cloud code or codex, they use local memory, they write to your desktop. In enterprise healthcare, we can't really do this, so we do memory in a database,

7:35 just so we have that logical separation. Uh important concept here is that when you're introducing new and improved better models more sophisticated more parameters

7:50 you can't you can't just replace the model and assume it's going to be better it's different right it's a it's a on certain evals it's a better model as measured by these different metrics but

8:03 it doesn't necessarily mean it's better right for all the situations that you want it to be better at because of the way you've designed your system so you really have to redo everything from

8:13 scratch just make sure your evals your testing your validation is all set up so that you can introduce these new models and not break your system.

8:31 So this concept of harness different groups have different definitions of this so I'm going to use a super broad definition here which is

8:41 like all the different nuts and bolts that that surround this agentic reasoning and that is the concept of memory that we discussed the different tools the checks the

8:54 permissions the handoffs the evals but also in the context of health care and claims it's x12. So just like we have these old school languages or formats like COBOL

9:11 or other stricter maybe strict languages typescript llms really thrive they work well and when they're confined they have clear limited

9:26 values that they can predict and x12 is exactly this so it provides this underlying structure this contract between what you're trying to communicate and the insurance company.

9:44 So, when you're reasoning in this in this healthcare, your your objective is to do something with handle a claim or research your EHR with respect to claims. It might be that

9:57 you have like 50 steps or something like that. There's a lot of different steps. And so, you can um you at at each of those steps as you

10:07 make mistakes, those mistakes can propagate down your system. Um and so, it's very good to have something grounded that can be rejected to. So, if you have a really strict got guardrails,

10:19 you can reject something that happens that's incorrect. So, if you're reasoning over, let's say, the previous example, 50 steps, that and

10:34 they're multimodal. You're considering and everything like that. That can get really expensive. It can also take a really long time. And folks might not want to wait. You know, it could be too

10:44 expensive and people don't want to wait that long. And each time it each step is an opportunity to introduce an error and you can have problems. Um but, if you hardcode your whole

10:56 system, you say we're you're going to throw out this whole agentic process, you limit yourself or your code can explode to be just unmanageable. So, now all of a sudden, you just have this

11:06 crazy bloat and you have to have this giant engineering team, which poses its own problems. Um so, what we want to do is strike this

11:15 balance between what we should be completely free, like um with just pure agentic reasoning and execution, and what is hardcoded.

11:28 So, we do that internally with introducing memory, just this uh partner level memory, organizational organized memory and user memory. So, we say if a user, we find

11:43 people in in multi-site health organizations, they tend to do the same thing day after day. And it might be if they mention a few words, "Oh, they usually do eligibility and they usually

11:56 do it within this context, they probably mean this." Right? Where another user, they probably mean that. So, we want to be really careful here because as you introduce

12:09 memory, you also persistent memory across chats, across days, you also introduce bias. So, maybe that person doesn't want to do the exact same thing that they did yesterday and now

12:20 you steer them to do the exact same thing they did yesterday. That's a problem. So, you want to strike a balance somewhere in there and you want to make sure that the use any user can

12:29 break out of this. So, for folks that are unfamiliar with the whole claim life cycle, it's many steps. So, each step does have an X12 correspondence with it.

12:46 Starting with the schedule, when let's say you're showing up to the doctor's office before you even show up. That's insurance starts then. Um when you're getting treated, that

12:57 also relates to insurance, what you you know, the different procedures that you are candidate for depending on your insurance. Um your documents, sometimes the x-ray

13:07 itself is the document and you would send proof of that in. Submitting the claim. And then finally getting the payment in the provider's bank.

13:22 So, this I think this concept is a little bit I I found it to be obvious in retrospect

13:30 but let me talk you through it. Maybe you find it's it's interesting or not but if you're calling an insurance company that it that boils down to a transaction

13:44 an X12 transaction. You'd say hey this is the patient I'm talking about. Great. That's a like an eligibility request a 270. Oh I need to do you're requesting a claim status or whatever it is you're

13:57 doing that has an X12 grounding. And that is the whole concept here this this X12 harness. So you call the insurance company you have an agent interact with a desktop

14:11 you have an agent interact with the browser your imaging system that's a 275 and and and your insurance your bank your

14:20 ACH so that's not X12 but it's still that structured transaction. >> [snorts]

14:32 >> So this is just a reiteration of these different transactions. And the other beautiful thing about it it's not you know it can you ask an agent to do something let's say you're

14:45 genetically programming or let's say you're just you're you're programming how you know maybe half the companies I spoke with here still program today just everything by

14:54 hand and they use these clock code or code X4 research. If you look up any of these transactions they're all public. Like this is not the

15:05 beautiful thing about this is like this is not my schema. If you ask agents to make a schema for you you're going to get like all sorts of stuff. But now if we ground

15:14 it in something standard you can look up all of these and you would know just right off the bat my schema. Let's say you're a new engineer coming in, like, you know.

15:30 So, X12 is a is a system of rules and it doesn't mean that when an insurance

15:39 company gives you an X12, it's true. So, that concept is when insurance company tells you something, it's coming from different

15:50 teams potentially. They can have an engineering team that's It could be even a different company. A different company that the insurance company contracts out designed their web

16:01 browser, their phone system, or their X12 layer, or their fire. And we have to understand that there's no ground truth. They also within all of

16:13 these systems, they can they can all actually agree on the wrong information as well. Like, let's say they all say this patient is covered. All three You call them. You look in the browser and

16:24 the X12 and they all say, "Yes, this patient is covered." And then you treat the patient, they say claim is denied due to the patient wasn't covered during that

16:31 time. Um so, they can all disagree, but sometimes you'll learn some idiosyncrasies of these different payers that some of these systems are more reliable than

16:40 others. But, regardless of if it originates as an X12 or not, you can boil all those transactions down to your own internal semi-correct X12. Correct until

16:53 downstream evidence proves it otherwise uh to be incorrect. So, just a little bit more on that. So, and any of the X12, any of the

17:04 information coming from the insurance company, any time can be wrong. It can be updated later. So, have fun. This is just an example of what it would

17:15 look like if you're um in that patient journey. You're you're trying to figure out how much you would pay as a patient up front, and it's very important for your experience going to

17:27 the doctor. And then the different treatments that you have in that clinic can oop. Yeah. The different treatments that you have in that clinic can be the evidence

17:45 that you need. Like you might get a CBCT. Well, that those images and slices of those images might be the evidence that they're asking for. So, ultimately, if you're delivering

18:02 that treatment, you're sending that claim, that claim is like a receipt of what you did. I did this, like here's the invoice. Right? Like you send it to the insurance company this invoice, and

18:13 they would pay you back. So, that is your ultimate like contract of you're saying you did this work, it's sealed um and now the ball is in insurance company's court.

18:28 And just a little bit about this progression of the claim from you're sending it, you're getting some acknowledgement, has like the syntax is right with that 999.

18:40 The status has been updated. Hey, cool, we received it. Um maybe you call them and you verify the status didn't come in. Then you have this EOBs 835 receipt of

18:52 payment. And then we're getting to the end of this uh this talk here, but I think that, you know, LLMs, I'm fully

19:08 AI pilled, right? But we want to make sure that we introduce la- language models, small tiny models in a very skeptical conservative way. So,

19:20 being AI filled is great, but you should also be very AI skeptical. Like these things, they make mistakes and it's not even you can't even say they make mistakes. Like we

19:32 make mistakes designing them. We might set them up to fail. So, we have to be very skeptical of them and we have to use them in a way that's also cost-effective. You can't throw I mean

19:43 you don't you don't want to use an overpowered over expensive model cuz then if you're going back to if you're reducing costs or not. Let's say it's ends up being super super expensive to

19:56 deliver one of these routine things that need to be done a thousand times a day. You definitely don't want that. All right. Thank you very much. >> [music]

Frontier News · by Hyperjump Technology