摘要与解读
来源报告指出,编码代理在两类场景中会传播漏洞:后端代码生成,以及真实 C/C++ 项目中的仓库级代码生成(20 对任务,要求代理完成与内存安全关键的代码)。影响对象是使用编码代理产出生产代码的代码库及其下游依赖;必要条件是上下文中已存在不安全代码,且代理将其作为模板。后果是正确且安全的实现比例下降,代码库安全性随代理写作占比上升、人工审查减少而逐步退化。
六维情报分析
6 个维度 · 原文可溯源影响范围
-
来源报告指出,编码代理在两类场景中会传播漏洞:后端代码生成,以及真实 C/C++ 项目中的仓库级代码生成(20 对任务,要求代理完成与内存安全关键的代码)。影响对象是使用编码代理产出生产代码的代码库及其下游依赖;必要条件是上下文中已存在不安全代码,且代理将其作为模板。后果是正确且安全的实现比例下降,代码库安全性随代理写作占比上升、人工审查减少而逐步退化。
原文依据 · 2
中文译文
……应用已经存在。其次,我们在真实的 C/C++ 项目中,针对 20 对任务研究了仓库级代码生成。在每项任务中,要求智能体补全对内存安全至关重要的代码。我们发现,在这两种场景中,已有的不安全代码都会使智能体更频繁地编写出易受攻击的代码。在后端代码生成中,不安全的邻近代码使正确且安全的实现比例平均降低 3.4%;在 C/C++ 仓库级编码中,安全与不安全上下文之间的平均差距达到 35.4%。提示智能体遵循现有代码风格或谨慎处理安……
原文引文
pplications already exist. Second, we investigate repository-level code generation on 20 pairs of tasks in real C/C++ projects. In each task, the agent is asked to complete code critical to memory safety. We find that in both settings, insecure existing code leads to agents writing vulnerable code more often. In backend generation, insecure neighbors reduce the share of correct and secure implementations by 3.4% on average, and in C/C++ repository-level coding, the average gap between secure and insecure contexts reaches 35.4%. Prompting to follow existing code-style or to be careful about sec
查看原文 · v1中文译文
……智能体传播漏洞的程度,但两者都无法阻止这种情况。当被要求解释其实现选择时,编码智能体在 76.5% 的案例中将其归因于遵循另一处代码,尽管它们在 69.9% 的案例中能够识别出引入的漏洞。这些发现表明,智能体会不加区分地将现有漏洞用作新漏洞的模板,使每项代码贡献都成为引入更多漏洞的机会。因此,随着智能体编写的生产代码比例不断上升,而人工审查不断减少,代码库的安全性可能会日益……
原文引文
how strongly agents propagate vulnerabilities, but neither stops them. When asked to explain their implementation choices, coding agents attribute them to following another code site in 76.5% of cases, even though they recognize the introduced vulnerability in 69.9% of cases. These findings show that agents use existing vulnerabilities as templates for new ones indiscriminatorily, turning each contribution into an opportunity to introduce more vulnerabilities. As such, as agents write a growing share of production code under decreasing human review, code bases can increasingly degrade in secu
查看原文 · v1
关联资产
-
原文明确关联的资产类型为:编码代理所生成的代码、承载这些代码的 C/C++ 项目仓库,以及作为上下文被代理读取的既有代码(不安全邻居)。适用前提是代理在包含不安全代码的仓库上下文中执行代码生成任务,且任务涉及内存安全关键逻辑;后端代码生成场景同样适用。未提供本地资产清单,未与任何具体本地仓库或模型匹配。
原文依据 · 2
中文译文
……应用已经存在。其次,我们在真实的 C/C++ 项目中,针对 20 对任务研究了仓库级代码生成。在每项任务中,要求智能体补全对内存安全至关重要的代码。我们发现,在这两种场景中,已有的不安全代码都会使智能体更频繁地编写出易受攻击的代码。在后端代码生成中,不安全的邻近代码使正确且安全的实现比例平均降低 3.4%;在 C/C++ 仓库级编码中,安全与不安全上下文之间的平均差距达到 35.4%。提示智能体遵循现有代码风格或谨慎处理安……
原文引文
pplications already exist. Second, we investigate repository-level code generation on 20 pairs of tasks in real C/C++ projects. In each task, the agent is asked to complete code critical to memory safety. We find that in both settings, insecure existing code leads to agents writing vulnerable code more often. In backend generation, insecure neighbors reduce the share of correct and secure implementations by 3.4% on average, and in C/C++ repository-level coding, the average gap between secure and insecure contexts reaches 35.4%. Prompting to follow existing code-style or to be careful about sec
查看原文 · v1中文译文
……智能体传播漏洞的程度,但两者都无法阻止这种情况。当被要求解释其实现选择时,编码智能体在 76.5% 的案例中将其归因于遵循另一处代码,尽管它们在 69.9% 的案例中能够识别出引入的漏洞。这些发现表明,智能体会不加区分地将现有漏洞用作新漏洞的模板,使每项代码贡献都成为引入更多漏洞的机会。因此,随着智能体编写的生产代码比例不断上升,而人工审查不断减少,代码库的安全性可能会日益……
原文引文
how strongly agents propagate vulnerabilities, but neither stops them. When asked to explain their implementation choices, coding agents attribute them to following another code site in 76.5% of cases, even though they recognize the introduced vulnerability in 69.9% of cases. These findings show that agents use existing vulnerabilities as templates for new ones indiscriminatorily, turning each contribution into an opportunity to introduce more vulnerabilities. As such, as agents write a growing share of production code under decreasing human review, code bases can increasingly degrade in secu
查看原文 · v1
风险评估
-
已报道机制是代理不加区分地把现有漏洞当作新代码模板:不安全邻居使后端生成中正确且安全实现的比例平均下降 3.4%,C/C++ 仓库级任务中安全与不安全上下文的平均差距达 35.4%;76.5% 的实现选择被归因于跟随另一处代码,同时代理在 69.9% 的情形下能识别所引入的漏洞。触发条件是仓库内存在不安全代码且任务涉及内存安全关键逻辑;提示遵循现有代码风格或提醒注意安全可减弱传播强度,但两者都未能阻止传播,因此防护优先级应放在上下文清理与生成后审查,而非仅靠提示词。
原文依据 · 2
中文译文
……应用已经存在。其次,我们在真实的 C/C++ 项目中,针对 20 对任务研究了仓库级代码生成。在每项任务中,要求智能体补全对内存安全至关重要的代码。我们发现,在这两种场景中,已有的不安全代码都会使智能体更频繁地编写出易受攻击的代码。在后端代码生成中,不安全的邻近代码使正确且安全的实现比例平均降低 3.4%;在 C/C++ 仓库级编码中,安全与不安全上下文之间的平均差距达到 35.4%。提示智能体遵循现有代码风格或谨慎处理安……
原文引文
pplications already exist. Second, we investigate repository-level code generation on 20 pairs of tasks in real C/C++ projects. In each task, the agent is asked to complete code critical to memory safety. We find that in both settings, insecure existing code leads to agents writing vulnerable code more often. In backend generation, insecure neighbors reduce the share of correct and secure implementations by 3.4% on average, and in C/C++ repository-level coding, the average gap between secure and insecure contexts reaches 35.4%. Prompting to follow existing code-style or to be careful about sec
查看原文 · v1中文译文
……智能体传播漏洞的程度,但两者都无法阻止这种情况。当被要求解释其实现选择时,编码智能体在 76.5% 的案例中将其归因于遵循另一处代码,尽管它们在 69.9% 的案例中能够识别出引入的漏洞。这些发现表明,智能体会不加区分地将现有漏洞用作新漏洞的模板,使每项代码贡献都成为引入更多漏洞的机会。因此,随着智能体编写的生产代码比例不断上升,而人工审查不断减少,代码库的安全性可能会日益……
原文引文
how strongly agents propagate vulnerabilities, but neither stops them. When asked to explain their implementation choices, coding agents attribute them to following another code site in 76.5% of cases, even though they recognize the introduced vulnerability in 69.9% of cases. These findings show that agents use existing vulnerabilities as templates for new ones indiscriminatorily, turning each contribution into an opportunity to introduce more vulnerabilities. As such, as agents write a growing share of production code under decreasing human review, code bases can increasingly degrade in secu
查看原文 · v1
相关研究
-
研究方法为两类实证设置:后端代码生成,以及在真实 C/C++ 项目上构造 20 对任务的仓库级代码生成,每对任务要求代理完成对内存安全关键的代码,并对比安全与不安全上下文下的实现质量;另通过要求代理解释实现选择来考察归因。贡献在于量化代理传播漏洞的强度并揭示其以既有代码为模板的行为模式。材料仅提供摘要级片段,未给出具体模型、提示模板与统计方法细节。
原文依据 · 2
中文译文
……应用已经存在。其次,我们在真实的 C/C++ 项目中,针对 20 对任务研究了仓库级代码生成。在每项任务中,要求智能体补全对内存安全至关重要的代码。我们发现,在这两种场景中,已有的不安全代码都会使智能体更频繁地编写出易受攻击的代码。在后端代码生成中,不安全的邻近代码使正确且安全的实现比例平均降低 3.4%;在 C/C++ 仓库级编码中,安全与不安全上下文之间的平均差距达到 35.4%。提示智能体遵循现有代码风格或谨慎处理安……
原文引文
pplications already exist. Second, we investigate repository-level code generation on 20 pairs of tasks in real C/C++ projects. In each task, the agent is asked to complete code critical to memory safety. We find that in both settings, insecure existing code leads to agents writing vulnerable code more often. In backend generation, insecure neighbors reduce the share of correct and secure implementations by 3.4% on average, and in C/C++ repository-level coding, the average gap between secure and insecure contexts reaches 35.4%. Prompting to follow existing code-style or to be careful about sec
查看原文 · v1中文译文
……智能体传播漏洞的程度,但两者都无法阻止这种情况。当被要求解释其实现选择时,编码智能体在 76.5% 的案例中将其归因于遵循另一处代码,尽管它们在 69.9% 的案例中能够识别出引入的漏洞。这些发现表明,智能体会不加区分地将现有漏洞用作新漏洞的模板,使每项代码贡献都成为引入更多漏洞的机会。因此,随着智能体编写的生产代码比例不断上升,而人工审查不断减少,代码库的安全性可能会日益……
原文引文
how strongly agents propagate vulnerabilities, but neither stops them. When asked to explain their implementation choices, coding agents attribute them to following another code site in 76.5% of cases, even though they recognize the introduced vulnerability in 69.9% of cases. These findings show that agents use existing vulnerabilities as templates for new ones indiscriminatorily, turning each contribution into an opportunity to introduce more vulnerabilities. As such, as agents write a growing share of production code under decreasing human review, code bases can increasingly degrade in secu
查看原文 · v1
验证资料
-
来源给出的实验数据为:后端生成中不安全邻居使正确且安全实现比例平均下降 3.4%;C/C++ 仓库级任务中安全与不安全上下文平均差距 35.4%;归因跟随其他代码占 76.5%,识别出所引入漏洞占 69.9%。适用条件为存在不安全邻居代码的生成场景。防御性核查可围绕:代理生成提交中是否引用或模仿了已知不安全代码位置、内存安全相关改动的审查覆盖率、以及安全与不安全上下文对照下的回归结果。
原文依据 · 2
中文译文
……应用已经存在。其次,我们在真实的 C/C++ 项目中,针对 20 对任务研究了仓库级代码生成。在每项任务中,要求智能体补全对内存安全至关重要的代码。我们发现,在这两种场景中,已有的不安全代码都会使智能体更频繁地编写出易受攻击的代码。在后端代码生成中,不安全的邻近代码使正确且安全的实现比例平均降低 3.4%;在 C/C++ 仓库级编码中,安全与不安全上下文之间的平均差距达到 35.4%。提示智能体遵循现有代码风格或谨慎处理安……
原文引文
pplications already exist. Second, we investigate repository-level code generation on 20 pairs of tasks in real C/C++ projects. In each task, the agent is asked to complete code critical to memory safety. We find that in both settings, insecure existing code leads to agents writing vulnerable code more often. In backend generation, insecure neighbors reduce the share of correct and secure implementations by 3.4% on average, and in C/C++ repository-level coding, the average gap between secure and insecure contexts reaches 35.4%. Prompting to follow existing code-style or to be careful about sec
查看原文 · v1中文译文
……智能体传播漏洞的程度,但两者都无法阻止这种情况。当被要求解释其实现选择时,编码智能体在 76.5% 的案例中将其归因于遵循另一处代码,尽管它们在 69.9% 的案例中能够识别出引入的漏洞。这些发现表明,智能体会不加区分地将现有漏洞用作新漏洞的模板,使每项代码贡献都成为引入更多漏洞的机会。因此,随着智能体编写的生产代码比例不断上升,而人工审查不断减少,代码库的安全性可能会日益……
原文引文
how strongly agents propagate vulnerabilities, but neither stops them. When asked to explain their implementation choices, coding agents attribute them to following another code site in 76.5% of cases, even though they recognize the introduced vulnerability in 69.9% of cases. These findings show that agents use existing vulnerabilities as templates for new ones indiscriminatorily, turning each contribution into an opportunity to introduce more vulnerabilities. As such, as agents write a growing share of production code under decreasing human review, code bases can increasingly degrade in secu
查看原文 · v1
处置建议
-
按优先级:一是清理或隔离代理上下文中的已知不安全代码,避免其成为模板,这直接对应不安全邻居导致安全实现比例下降 3.4%、仓库级差距 35.4% 的发现;二是在生成后对内存安全关键改动强制人工审查,因为代理在 69.9% 情形下能识别漏洞却仍引入;三是将“遵循现有代码风格”类提示替换为明确的安全约束,但需认识到提示只能减弱、不能阻止传播;四是对代理提交做回归验证,比较安全与不安全上下文下的实现差异。
原文依据 · 2
中文译文
……应用已经存在。其次,我们在真实的 C/C++ 项目中,针对 20 对任务研究了仓库级代码生成。在每项任务中,要求智能体补全对内存安全至关重要的代码。我们发现,在这两种场景中,已有的不安全代码都会使智能体更频繁地编写出易受攻击的代码。在后端代码生成中,不安全的邻近代码使正确且安全的实现比例平均降低 3.4%;在 C/C++ 仓库级编码中,安全与不安全上下文之间的平均差距达到 35.4%。提示智能体遵循现有代码风格或谨慎处理安……
原文引文
pplications already exist. Second, we investigate repository-level code generation on 20 pairs of tasks in real C/C++ projects. In each task, the agent is asked to complete code critical to memory safety. We find that in both settings, insecure existing code leads to agents writing vulnerable code more often. In backend generation, insecure neighbors reduce the share of correct and secure implementations by 3.4% on average, and in C/C++ repository-level coding, the average gap between secure and insecure contexts reaches 35.4%. Prompting to follow existing code-style or to be careful about sec
查看原文 · v1中文译文
……智能体传播漏洞的程度,但两者都无法阻止这种情况。当被要求解释其实现选择时,编码智能体在 76.5% 的案例中将其归因于遵循另一处代码,尽管它们在 69.9% 的案例中能够识别出引入的漏洞。这些发现表明,智能体会不加区分地将现有漏洞用作新漏洞的模板,使每项代码贡献都成为引入更多漏洞的机会。因此,随着智能体编写的生产代码比例不断上升,而人工审查不断减少,代码库的安全性可能会日益……
原文引文
how strongly agents propagate vulnerabilities, but neither stops them. When asked to explain their implementation choices, coding agents attribute them to following another code site in 76.5% of cases, even though they recognize the introduced vulnerability in 69.9% of cases. These findings show that agents use existing vulnerabilities as templates for new ones indiscriminatorily, turning each contribution into an opportunity to introduce more vulnerabilities. As such, as agents write a growing share of production code under decreasing human review, code bases can increasingly degrade in secu
查看原文 · v1
模型与引文记录
- 模型
- deepseek-flash
- 生成时间
- 记录编号
- REQ-0f4cf9c7e32142e0b7ed7b7c8f8a1dd7
- 分析原文
- 查看原文 · v1
图片与附件
1 项关联材料-
cs.CR
采集与来源记录
- 文件名称
- cs.CR
- 记录大小
- 295946 字节
- 文件格式
- text/plain
- 关联登记时间
- 2026-11-11 04:00 UTC
- 关联原文
- v1
- 保存时校验
f5144ff7a46dd23da5bb76171d7782c646729f12313f71c34c60d64785f2a1d9