Newest papers

CAT-RAG: Improving Secure Code Generation with Category-Aware Agentic Retrieval

Mahdieh Abazar, Lorenzo De Carli, Benjamin Tan · 2026 · arXiv (Cornell University)

DOI: 10.48550/arxiv.2610.24907 · cited by 0 works (OpenAlex) · open-access PDF

Vietnamese

Mặc dù tiến bộ nhanh chóng trong việc tạo ra mã dựa trên CAT, các lỗ hổng bảo mật vẫn còn phổ biến, và việc tạo mã tăng cường truy vấn (RACG) có thể tăng cường rủi ro hơn nữa khi kiến thức thu thập được là lỗ hổng hoặc dễ bị nhiễm độc. Các phương pháp tiếp cận RACG an toàn hiện có tiêm kiến thức bảo mật ở mức độ lỗ hổng hạt mịn, gây ra sự chú ý mô hình nhanh chóng và pha loãng khi truy vấn liên quan đến nhiều lỗ hổng liên quan. Chúng tôi đề xuất CAT-RAG, một mô hình bảo mật cơ quan nhận thức về loại mã duy nhất. CAT-RAG thực hiện việc lựa chọn các loại bảo mật thích ứng thông qua LLM như một tác nhân phân loại lỗ hổng và hoạt động như một lớp bảo mật độc lập hoặc là một phần bổ sung thả vào các đường

Machine translation (Meta M2M100); the English original follows.

Abstract

Despite rapid progress in LLM-based code generation, security vulnerabilities remain widespread, and retrieval-augmented code generation (RACG) can further amplify risk when retrieved knowledge is verbose or vulnerable to poisoning. Existing secure RACG approaches inject security knowledge at a fine-grained vulnerability level, causing prompt overhead and diluted model attention when a query implicates multiple related weaknesses. We propose CAT-RAG, an agentic security category-aware retrieval-augmented code generation framework. CAT-RAG performs adaptive category selection via an LLM as a categorizer agent and operates either as a standalone security layer or as a drop-in add-on to RACG pipelines, requiring no modification to the underlying model. We replace CWE-level retrieval with compact, language-specific security categories. These categories provide a higher-level abstraction over individual CWE weaknesses, organizing them by the security concern they share, such as Input Validation and Injection Attacks, rather than merely grouping related entries. Each category consolidates best practices and secure code examples into a single, prompt-efficient representation. We perform a comprehensive evaluation across CyberSecEval, CodeGuard+, and HumanEval. On CyberSecEval, CAT-RAG nearly doubles the secure code generation improvement over the state of the art (23.57% vs. 12.11%) while reducing token overhead by 41.71%.

Read in: English · Spanish · Chinese · Hindi · Arabic · Portuguese · French · German · Japanese · Russian · Korean · Indonesian · Vietnamese

Topics: Computer science, Code (set theory), Vulnerability (computing), Abstraction, Overhead (engineering), Computer security

Is this paper real? This page was built from OpenAlex and arXiv records, not generated. Software can verify any reference in one call: GET https://store.agentexchange.work/gw/papers/verify?title=...&year=... (0.003 USD), fetch this record as JSON with /gw/papers/paper?id=2610.24907, or list what it cites with /gw/papers/references?id=.... Pay per call in USDC (x402) or with a 19 USD card key for 1,000 calls. Catalogue · llms.txt

Sources: OpenAlex (CC0), arXiv, Crossref. Agent Exchange