Ground Your Agent in a Public Schema, Not an Invented One
Vasant Kearney of Onlay gave a healthcare-claims talk, but the architecture underneath generalises to any agent doing multi-step work against external systems. The core move: instead of letting the model invent a schema, constrain it to a strict, public, already-documented standard — in his case X12, the electronic-data format behind insurance transactions. That standard becomes the harness. This summary pulls out the parts that transfer to agents built on OpenClaw, Hermes, Claude Code or anything else.
"Healthcare's Agent Bytecode: X12 as the Harness for AI Agents — Vasant Kearney, Onlay" by AI Engineer — Watch on YouTube →
Key Takeaways
- Constrain the output space to a public standard. Kearney's argument is that LLMs thrive when confined to formats with clear, limited legal values — he compares X12 to COBOL and TypeScript in that respect. The standard supplies the contract between what the agent produces and what the downstream system will accept.
- A public schema beats a model-invented one for onboarding, too. His words: if you ask an agent to make a schema for you, you get "all sorts of stuff." Because X12 transactions are publicly documented, a new engineer — or a new agent — can look them up rather than reverse-engineer someone's bespoke design. That property is the reusable part, not X12 itself.
- Error propagation is the real risk in long chains. A claim workflow can run 50+ steps, and each step is an opportunity to introduce an error that propagates downstream. A strict schema gives you something concrete to reject against at each hop, instead of discovering the problem at the end.
- Don't hardcode the whole thing either. He frames it as a balance: fully free agentic reasoning is expensive, slow and error-prone across many steps, but hardcoding everything makes the codebase explode and demands a large engineering team. The harness is where you set that dial.
- Memory belongs in a database, not on the desktop. Claude Code and Codex use local memory written to your machine. In regulated enterprise environments that isn't available, so memory moves into a database — organised at partner, organisation and user scopes.
- Persistent memory introduces bias. Users at multi-site organisations tend to repeat the same task daily, which makes memory useful — but if you steer someone toward yesterday's action when they wanted something different, the memory has become a bug. Users need a way out of it.
- Don't collapse multimodal context too early. Reducing an image to extracted findings before a downstream model sees it saves cost, but can drop exactly the detail a later step needed — because the upstream model didn't know what was coming.
- Swapping in a better model is not a free upgrade. A new model that scores higher on public evals is different, not automatically better for your system. His guidance is to have evals, testing and validation set up so you can re-validate from scratch on each swap.
- Treat every external system as untrustworthy. A payer's phone system, web portal and data feed can all agree — and all be wrong. He recommends normalising everything to your own internal representation, treated as correct only until downstream evidence proves otherwise.
- Be AI-pilled and AI-skeptical at once. His caveat is pointed: the models make mistakes, but more often we make mistakes designing them — we set them up to fail. Cost discipline is part of that; an over-powered model on a routine task run a thousand times a day defeats the purpose.
What "The Harness" Means Here
Kearney uses a deliberately broad definition, which is why it travels well: the harness is all the nuts and bolts surrounding the agentic reasoning — memory, tools, checks, permissions, handoffs, evals — plus, in his domain, the schema itself. The execution layer is whatever lets the model take actions: querying a database and discovering its schema, reading the codebase against that data, driving a desktop application, browsing a web portal, or making a transaction. Anything with write implications needs at minimum user-level logging.
The pattern to copy is the pairing: give the agent real action capability, then bound what it is allowed to emit with a schema you did not invent and can point at publicly.





