摘要与解读
提出生成中漏洞检测与自修复方法并给出基准结果
分析与审核记录
AI 情报分析
历史来源快照
历史版本 v1 · 查看当前版本
提出生成中漏洞检测与自修复方法并给出基准结果
历史来源快照
当前保存的来源版本 · v1
SecReason: Vulnerability Detection and In-Stream Self-Repair for LLM Code Generation
当前为离线关键词规则模式。
e reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each st
SecReason: Vulnerability Detection and In-Stream Self-Repair for LLM Code Generation Large language models (LLMs) may introd
Vulnerability Detection and In-Stream Self-Repair for LLM Code Generation Large language models (LLMs) may introduce security vulnerabilities into generated
{
"ai_relevance": {
"evidence": [
{
"end_offset": 68,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 65
},
{
"end_offset": 106,
"location": "title_and_content",
"quote": "Large language models",
"rule": "ai_term",
"start_offset": 85
},
{
"end_offset": 112,
"location": "title_and_content",
"quote": "LLMs",
"rule": "ai_term",
"start_offset": 108
},
{
"end_offset": 580,
"location": "title_and_content",
"quote": "LLMs",
"rule": "ai_term",
"start_offset": 576
}
],
"matches": [
{
"end_offset": 68,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 65
},
{
"end_offset": 106,
"location": "title_and_content",
"quote": "Large language models",
"rule": "ai_term",
"start_offset": 85
},
{
"end_offset": 112,
"location": "title_and_content",
"quote": "LLMs",
"rule": "ai_term",
"start_offset": 108
},
{
"end_offset": 580,
"location": "title_and_content",
"quote": "LLMs",
"rule": "ai_term",
"start_offset": 576
}
],
"method": "explainable_keyword_rules",
"reason": "Matched AI topic or component evidence",
"relevant": true
},
"entity_ids": [],
"facts": [],
"method": "source_grounded_extraction",
"unknown_fields": [
"affected_products",
"affected_versions",
"fixed_versions",
"cvss",
"mitigations",
"references",
"papers",
"poc"
]
}Large language models (LLMs) may introduce security vulnerabilities into generated code, which can persist into production when verification focuses on functional correctness. Existing defenses act before, during, or after generation, but none inspects the code during generation. Security prompts and retrieved security knowledge act before any code exists, constrained decoding limits token choices but cannot guide repair, and post-hoc repair must regenerate the full response. Reasoning LLMs draft code early in their streamed chain of thought, and in this pre-delivery window the code exists only inside the reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each statement as it is emitted and tracing dataflows across the accumulated code. When a security rule fires, SecReason interrupts generation, inserts an in-stream warning, and resumes decoding, so the model repairs the draft within the same reasoning trace without regenerating the full response. On tasks where unassisted generation introduces vulnerabilities, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}. \system consumes fewer tokens than post-hoc repair, and when security rules misfire on secure code, it limits the functional regressions from false warnings.{
"authors": [
"Ruidong Han",
"Zhensu Sun",
"Chengyan Ma",
"Yuqing Niu",
"Siqi Ma",
"David Lo"
],
"content_level": "abstract",
"date_basis": "explicit_published",
"date_evidence": {
"published": "2026-10-10T01:27:55Z",
"updated": "2026-10-10T01:27:55Z"
},
"identifiers": [
"arxiv:2610.14453"
],
"source_updated_at": "2026-10-10T01:27:55+00:00",
"subjects": [
"cs.CR",
"cs.SE"
],
"version_label": "v1"
}Large language models (LLMs) may introduce security vulnerabilities into generated code, which can persist into production when verification focuses on functional correctness. Existing defenses act before, during, or after generation, but none inspects the code during generation. Security prompts and retrieved security knowledge act before any code exists, constrained decoding limits token choices but cannot guide repair, and post-hoc repair must regenerate the full response. Reasoning LLMs draft code early in their streamed chain of thought, and in this pre-delivery window the code exists only inside the reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each statement as it is emitted and tracing dataflows across the accumulated code. When a security rule fires, SecReason interrupts generation, inserts an in-stream warning, and resumes decoding, so the model repairs the draft within the same reasoning trace without regenerating the full response. On tasks where unassisted generation introduces vulnerabilities, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}.es, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}. \system consumes fewer tokens than post-hoc repair, and when security rules misfire on secure code, it limits the functional regressions from false warnings.正文译文暂缺,以下仅为中文摘要。
提出生成中漏洞检测与自修复方法并给出基准结果
Large language models (LLMs) may introduce security vulnerabilities into generated code, which can persist into production when verification focuses on functional correctness. Existing defenses act before, during, or after generation, but none inspects the code during generation. Security prompts and retrieved security knowledge act before any code exists, constrained decoding limits token choices but cannot guide repair, and post-hoc repair must regenerate the full response. Reasoning LLMs draft code early in their streamed chain of thought, and in this pre-delivery window the code exists only inside the reasoning stream. We present SecReason, an in-stream defense that monitors this window. Dual-track incremental scanning applies security rules, checking each statement as it is emitted and tracing dataflows across the accumulated code. When a security rule fires, SecReason interrupts generation, inserts an in-stream warning, and resumes decoding, so the model repairs the draft within the same reasoning trace without regenerating the full response. On tasks where unassisted generation introduces vulnerabilities, \system raises the share of runs delivering secure and functionally correct code from below 15\% to 72.8\%--98.1\% on \tool{CWEval} and \tool{SecCodeBench}. \system consumes fewer tokens than post-hoc repair, and when security rules misfire on secure code, it limits the functional regressions from false warnings.