[2604.03587] SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization

[2604.03587] SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization

arXiv - AI 4 min read

About this article

Abstract page for arXiv paper 2604.03587: SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization

Computer Science > Cryptography and Security arXiv:2604.03587 (cs) [Submitted on 4 Apr 2026] Title:SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization Authors:Hao Wang, Niels Mündler, Mark Vero, Jingxuan He, Dawn Song, Martin Vechev View a PDF of the paper titled SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization, by Hao Wang and 5 other authors View PDF HTML (experimental) Abstract:Reasoning language models (RLMs) are increasingly used in programming. Yet, even state-of-the-art RLMs frequently introduce critical security vulnerabilities in generated code. Prior training-based approaches for secure code generation face a critical limitation that prevents their direct application to RLMs: they rely on costly, manually curated security datasets covering only a limited set of vulnerabilities. At the inference level, generic security reminders consistently degrade functional correctness while triggering only shallow ad-hoc vulnerability analysis. To address these problems, we present SecPI, a fine-tuning pipeline that teaches RLMs to internalize structured security reasoning, producing secure code by default without any security instructions at inference time. SecPI filters existing general-purpose coding datasets for security-relevant tasks using an LLM-based classifier, generates high-quality security reasoning traces with a teacher model guided by a structured prompt that systematically enumerate...

Originally published on April 07, 2026. Curated by AI News.

Related Articles

Llms

I built a solo AI platform from Algeria with no funding, no team and no ad spend - here's what's inside it after 2 months

Hello, 20 years old here just got into the Ai platform and launched this last two weeks and here is what I have on it so far. - Latest Ai...

Reddit - Artificial Intelligence · 1 min ·
USF murder suspect accused of using ChatGPT to research cover-up, prosecutors say
Llms

USF murder suspect accused of using ChatGPT to research cover-up, prosecutors say

Days after the remains of one of the two missing University of South Florida doctoral students were found, prosecutors say the suspect ma...

AI Tools & Products · 3 min ·
Anthropic’s Claude AI deletes PocketOS production database
Llms

Anthropic’s Claude AI deletes PocketOS production database

Claude AI deleted PocketOS's production database, but the market for Claude 4.7 release by May 31 remains at 100% YES.

AI Tools & Products · 3 min ·
Claude-powered AI coding agent deletes entire company database in 9 seconds
Llms

Claude-powered AI coding agent deletes entire company database in 9 seconds

The founder of PocketOS has penned a social media post to warn others about the “systemic failures” of flagship AI and digital services p...

AI Tools & Products · 1 min ·
More in Llms: This Week Guide Trending

No comments

No comments yet. Be the first to comment!

Stay updated with AI News

Get the latest news, tools, and insights delivered to your inbox.

Daily or weekly digest • Unsubscribe anytime