跳到正文
arXiv (AI + Vision + Imaging)· Reda Heddad·· 9 天前AI 评分18

超越提示词:编码智能体的运行时契约

Beyond Prompts: Runtime Contracts for Coding Agents

AI 导读

研究测试在编码智能体执行过程中强制实施可执行契约,是否比将规则写入提示词、检索为指引或仅在生成后检查更能减少规则违规。在三项研究、两个模型家族共240、112和108次运行中,执行期强制在104对配对运行中未出现oracle检测到的违规,而无规则时违规运行占比为21%至55%,两项验证性研究未损失功能正确性。

正文 · 原文

arXiv:2611.19549v1 Announce Type: cross Abstract: Coding agents act on repositories through shell commands and file edits, and teams steer them with written engineering rules. Industrial settings expect such rules to be enforced and their application to be evidenced, and a rule given as prompt text provides neither. We test whether executable contracts enforced while the agent works reduce rule violations compared with the same rules in the prompt, retrieved as guidance, or checked only after generation. Violations are scored by an oracle whose methods differ from the in-loop checks, and the oracle is validated by two human reviewers and a model reviewer. Across three studies on two model families (240, 112 and 108 runs), enforcement during execution produced no oracle-detected violation in 104 paired runs, against 21 to 55% of runs without rules, and no loss of functional correctness in the two confirmatory studies. In the confirmatory study on tasks aimed at known failure situations (Study 3, protocol hashed before the first run), enforcement lowered the share of violating runs by 31 percentage points relative to no rules (Holm-adjusted p = 0.014); the 17-point difference from prompted rules was not significant (p = 0.12), and neither was any contrast in Study 2, where only 3 of 14 tasks produced a violation. Prompted rules removed some violation types but not recursive deletes of scratch directories, and checks after generation repaired file edits but not commands that had already run. That enforcement satisfies the rules it enforces is expected by construction; what the data add is where prompting falls short, the absence of a functional cost, and the limits of the rules and of the oracle themselves. The studies use low-cost models and one small fixture.

来源:arXiv (AI + Vision + Imaging) · arxiv.org