From Prompts to Contracts: Harness Engineering for Auditable Enterprise LLM Agents

📄 arXiv: 2607.08028v1 📥 PDF

作者: Joongho Ahn, Moonsoo Kim

分类: cs.AI, cs.CL, cs.SE

发布日期: 2026-07-09

备注: 32 pages, 6 figures, 16 tables. Reference implementation and evaluation artifacts: https://github.com/hammerbaki/enterprise-llm-agent-harness (archived at https://doi.org/10.5281/zenodo.21269426)


💡 一句话要点

提出一种可审计的企业LLM代理架构以解决源边界和验证问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 可审计性 哈希工程 企业应用 模型验证 源边界 实体路由

📋 核心要点

  1. 现有的企业LLM应用在产品化过程中面临源边界和验证的挑战,导致行为不确定性和审计困难。
  2. 论文提出的哈希工程方法通过将确定性行为转移到代码和验证文档中,构建了一个可审计的LLM代理架构。
  3. 实验结果显示,该架构在多种模型替换下保持了高效的合同检查,且在安全性和实用性上优于传统方法。

📝 摘要(中文)

企业大型语言模型(LLM)应用通常以原型开始,其行为依赖于提示和检索上下文。产品化增加了对源边界、实体路由、答案合同和可重现追踪的要求。本文提出了一种“哈希工程”方法,将这一模式重构为可追踪、可审计的LLM代理架构:确定性行为转移到代码、清单、模式和验证文档中,而源支持的声明仍然是运行时答案的权威。我们在五个韩国企业集团的公共数据片段上进行了实例化,并评估了三个研究问题。实验结果表明,该架构在固定验证场景中保持了源基础、实体路由、追踪、输出卫生和推荐语言合同的完整性。

🔬 方法详解

问题定义:本文旨在解决企业LLM应用在产品化过程中面临的源边界、实体路由和验证问题。现有方法往往依赖于提示,缺乏可审计性和确定性,导致行为不一致。

核心思路:论文提出的哈希工程方法通过将模型的确定性行为转移到代码和验证文档中,确保了运行时答案的可追溯性和审计能力。这样设计的目的是为了增强系统的可靠性和透明度。

技术框架:整体架构包括源基础声明、实体路由模块、验证文档和输出合同。通过这些模块的协同工作,形成了一个可审计的LLM代理架构。

关键创新:最重要的技术创新在于将确定性行为转移到代码和验证文档中,而不仅仅依赖于提示。这一方法使得系统在模型替换时仍能保持高效的合同检查。

关键设计:在设计中,关键参数包括合同的定义和验证机制,损失函数用于评估输出的卫生性,网络结构则确保了不同模块之间的有效交互。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,该架构在270次组合边界运行中,所有验证均通过,且在模型替换下保持了合同检查的有效性。与外部保护措施相比,哈希工程方法在安全性和实用性上表现更佳,确保了120/120的完整实用性。

🎯 应用场景

该研究的潜在应用领域包括企业智能、自动化客户服务和合规性审计等。通过提供可审计的LLM代理架构,企业能够更好地管理和控制其AI应用的行为,提升透明度和信任度,未来可能在更多行业中推广应用。

📄 摘要(原文)

Enterprise large language model (LLM) applications often begin as prototypes whose behavior is carried by prompts and retrieval context. Productization adds requirements for source boundaries, entity routing, answer contracts, and reproducible traces. We present a harness-engineering approach that reconstructs this pattern into a traceable, auditable LLM-agent architecture: deterministic behavior moves into code, manifests, schemas, and validation artifacts around a replaceable composition boundary, while source-backed claims remain the authority for runtime answers. We instantiate it on a public-data slice of five Korean corporate groups (25 listed companies) and evaluate three research questions. (1) The harness preserves its source-grounding, entity-routing, trace, output-hygiene, and recommendation-language contracts across the fixed validation scenarios; a fault-injection control confirms the validators flag deliberately broken contracts. (2) The checks the harness enforces held under model substitution: across three hosted models, they passed on all 270 composition-boundary runs; failures were confined to the model-composed side and were caught and recorded. (3) The code-owned guarantees are load-bearing, not reproducible by prompting alone: holding the model fixed and varying only the enforcement layer, prompt instructions alone let recommendation-language and internal-trace-leakage violations reach the reader, which the harness blocks entirely. A bolt-on external guardrail prevents such violations too but over-refuses, dropping utility to 88/120 where the harness preserves full utility (120/120); in this ablation, only code-owned enforcement preserves both safety and utility. The result is a reusable engineering pattern for turning exploratory prototypes into auditable applications with versioned source, control, and validation artifacts.