Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
AnalysisResearch Paper · For R&DarXiv cs.AI→ original

Harness Engineering: Moving LLM Agent Guarantees from Prompts into Code

An arXiv preprint from July 2026 describes harness engineering, a pattern for turning LLM prototypes into auditable enterprise agents. The authors tested the architecture on data from five Korean conglomerates (25 companies): code-owned guarantees passed 270 of 270 requests when the model was swapped, while an external guardrail scored 88/120 on usefulness versus 120/120 for the harness approach. The authors argue that prompts alone cannot reliably enforce contracts in a corporate environment, and that behavioral guarantees belong in versioned code artifacts.

AI-processed from arXiv cs.AI; edited by Hamidun News
Harness Engineering: Moving LLM Agent Guarantees from Prompts into Code
Source: arXiv cs.AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourcearXiv cs.AI ↗
Editor-in-Chief
Key metric #15 Korean conglomerates, 25 public companies: the test dataset
Key metric #23 hosted models used in the model-swap experiment
Key metric #3270/270 requests passed contract checks when the model was changed

Researchers published a preprint on arXiv on July 10, 2026, describing a harness engineering pattern for enterprise LLM agents. Deterministic guarantees move out of prompts and into code and validation artifacts, which makes it possible to build auditable systems without degrading answer quality.

What's wrong with the prompting-only approach

Enterprise LLM applications usually start as prototypes in which prompts and RAG context fully define behavior. Moving to production brings new requirements: source boundaries, entity routing, response contracts and reproducible traces. Prompts handle these unreliably.

The authors ran a controlled experiment. With the model unchanged and only the enforcement layer swapped, prompts let violations reach the user: inappropriate advisory language and leaks of internal traces were not blocked. The harness eliminated both problems entirely, without reducing the system's usefulness.

How the harness pattern works

The key idea is to move deterministic behavior out of prompts and into code, manifests, schemas and validation artifacts surrounding a replaceable "composition boundary." Source claims remain the authority for runtime answers, and code, not prompt instructions, checks every contract. This architecture allows the model to be swapped without rebuilding the whole system.

The pattern was tested on a public slice of data from five Korean corporate groups (25 listed companies). Key results:

  • 5 Korean conglomerates, 25 public companies: the test dataset
  • 3 hosted models used in the model-swap experiment
  • 270/270 requests passed contract checks when the model was changed
  • 120/120: answer usefulness with the harness approach
  • 88/120: usefulness with a bolt-on external guardrail at the same level of safety

A fault-injection control confirmed the validators work: in every scenario they correctly flagged the deliberately broken contracts.

How is a harness better than external guardrails?

A bolt-on external guardrail prevents violations as effectively as the harness, but at the cost of excessive refusals. With only an external guardrail, the system produced 88 useful answers out of 120, while the harness kept 120/120.

"Only code-owned enforcement delivers safety while preserving full usefulness," the authors conclude.

The key difference: the harness is built into the architecture and understands the context of the request, so it does not reject legitimate answers. An external guardrail sees only the final output and has to play it safe, which costs 27% of useful answers.

What this means

Harness engineering offers a reusable pattern for moving from an LLM prototype to an auditable production system. Prompts do not guarantee that contracts are respected in a corporate environment; versioned control artifacts in code are needed. For teams building enterprise LLM agents, this is practical guidance: behavioral guarantees should live in code, not in instructions.

Frequently asked questions

What data was the harness tested on?

The authors used a public slice of data from five large Korean corporate groups with 25 listed companies. Testing covered 270 requests through the composition boundary on three different hosted models.

How does a harness differ from a bolt-on guardrail?

A bolt-on guardrail reaches the same level of safety but generates excessive refusals: 88 useful answers out of 120 versus 120/120 for the harness. The harness is built into the architecture and understands the context of the request, so it does not sacrifice quality for safety.

Story

Key Questions Answered

How is a harness better than external guardrails?

A bolt-on external guardrail prevents violations as effectively as the harness, but at the cost of excessive refusals. With only an external guardrail, the system produced 88 useful answers out of 120, while the harness kept 120/120. "Only code-owned enforcement delivers safety while preserving full usefulness," the authors conclude. The key difference: the harness is built into the architecture and understands the context of the request, so it does not reject legitimate answers.

What data was the harness tested on?

The authors used a public slice of data from five large Korean corporate groups with 25 listed companies. Testing covered 270 requests through the composition boundary on three different hosted models.

How does a harness differ from a bolt-on guardrail?

A bolt-on guardrail reaches the same level of safety but generates excessive refusals: 88 useful answers out of 120 versus 120/120 for the harness. The harness is built into the architecture and understands the context of the request, so it does not sacrifice quality for safety.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — Harness Engineering: Moving LLM Agent Guarantees from Prompts into Code https://news.hamidun.com/en/news/11515/harness-engineering-moving-llm-agent-guarantees-from-prompts

What do you think?
Loading comments…