arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.11088cs.AIcs.CL
收藏

护栏优于指导:关于编码智能体的规则、技能和持久配置的大规模研究

Guardrails Beat Guidance: A Large-Scale Study of Rules, Skills, and Persistent Configuration for Coding Agents

AWS Generative AI Innovation Center(AWS生成式人工智能创新中心);HSBC Holdings Plc., HSBC Technology Center, China(汇丰控股有限公司,汇丰技术中心,中国)

Xing Zhang, Guanghui Wang, Yanwei Cui, Wei Qiu, Ziyuan Li, Bing Zhu, Peiyang He

AI总结:

通过大规模实验发现,随机规则与专家规则对编码智能体性能提升相当,且有益规则均为负面约束,有害规则均为正面指令,提出应使用约束而非指导来配置智能体。

摘要:

随机规则对编码智能体任务性能的提升与专家精心设计的规则相当(在SWE-bench Verified的判别子集上均提升$+13.8$个百分点),并且在我们的数据中,每条单独有益的规则都是负面约束(“不要重构无关代码”),而每条单独有害的规则都是正面指令(“遵循代码风格”)。我们通过首次对智能体规则文件( exttt{CLAUDE.md}、 exttt{.cursorrules}以及更广泛的智能体技能、插件清单和角色定义系列)进行大规模受控研究得出这些发现:我们从GitHub抓取了679个规则文件(共25,532条规则),并使用Claude Opus 4.6在SWE-bench Verified上进行了超过5,000次Claude Code智能体运行。出现了三种模式。(i)规则极性清晰地区分了有益规则和有害规则;我们通过基于势能的奖励塑形(PBRS)的视角来解读这一点。(ii)性能提升在很大程度上与内容无关:随机、打乱、领域不匹配和未转换格式的规则文件均与精心设计的规则相匹配,指向一种上下文启动机制。(iii)单独的规则通常看起来有害,但在集成中并未明显累积损害:在规则数量从0到50的范围内,通过率保持稳定。这些发现揭示了快速增长的社区编写规则和技能生态系统中隐藏的可靠性风险,并得出了更安全智能体配置的明确原则:约束智能体不能做什么,而不是规定它应该做什么。

英文摘要:

Random rules improve a coding agent's task performance as much as expert-curated ones (both $+13.8$pp on a discriminative subset of SWE-bench Verified), and in our data every individually beneficial rule is a negative constraint ("do not refactor unrelated code"), while every individually harmful one is a positive directive ("follow code style"). We arrive at these findings through the first large-scale controlled study of agent rule files (\texttt{CLAUDE.md}, \texttt{.cursorrules}, and the broader family of agent skills, plugin manifests, and persona definitions): we scrape 679 rule files (25{,}532 rules) from GitHub and conduct over 5{,}000 agent runs of Claude Code with Claude Opus 4.6 on SWE-bench Verified. Three patterns emerge. (i) Rule polarity cleanly separates beneficial from harmful rules; we read this through the lens of potential-based reward shaping (PBRS). (ii) Performance gains are largely content-independent: random, shuffled, mismatched-domain, and unconverted-format rule files all match curated rules, pointing to a context priming mechanism. (iii) Individual rules often appear harmful in isolation yet do not visibly accumulate damage in ensemble: pass rates remain stable across rule counts from 0 to 50. These findings expose a hidden reliability risk in the rapidly growing ecosystem of community-authored rules and skills, and they yield a clear principle for safer agent configuration: constrain what agents must not do, rather than prescribing what they should.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑