The proliferation of AI-assisted "vibe coding" enables rapid software development but introduces significant security risks, as Large Language Models (LLMs) prioritize functional correctness over security. We present Constitutional Spec-Driven Development, a methodology that embeds non-negotiable security principles into the specification layer, ensuring AI-generated code adheres to security requirements by construction rather than inspection. Our approach introduces a Constitution: a versioned, machine-readable document encoding security constraints derived from Common Weakness Enumeration (CWE)/MITRE Top 25 vulnerabilities and regulatory frameworks. We demonstrate the methodology through a banking microservices application, selected as a representative example domain due to its stringent regulatory and security requirements, implementing customer management, account operations, and transaction processing. The methodology itself is domain-agnostic. The implementation addresses 10 critical CWE vulnerabilities through constitutional constraints with full traceability from principles to code locations. Our case study shows that constitutional constraints reduce security defects by 73% compared to unconstrained AI generation while maintaining developer velocity. We contribute a formal framework for constitutional security, a complete development methodology, and empirical evidence that proactive security specification outperforms reactive security verification in AI-assisted development workflows.


翻译:AI辅助的"氛围编码"的普及使得软件开发速度加快,但也带来了重大的安全风险,因为大型语言模型(LLMs)优先考虑功能正确性而非安全性。我们提出了宪法式规范驱动开发,这是一种将不可协商的安全原则嵌入规范层的方法论,确保AI生成的代码通过构造而非检查来遵守安全要求。我们的方法引入了一部宪法:一个版本化、机器可读的文档,编码了源自通用缺陷枚举(CWE)/MITRE Top 25漏洞和监管框架的安全约束。我们通过一个银行微服务应用程序来演示该方法论,该领域因其严格的监管和安全要求而被选为代表性示例,实现了客户管理、账户操作和交易处理功能。该方法论本身是领域无关的。该实现通过宪法约束解决了10个关键的CWE漏洞,并具备从原则到代码位置的全链路可追溯性。我们的案例研究表明,与无约束的AI生成相比,宪法约束将安全缺陷减少了73%,同时保持了开发速度。我们贡献了一个用于宪法安全的形式化框架、一套完整的开发方法论,以及经验证据,表明在AI辅助开发工作流中,主动的安全规范制定优于被动的安全验证。

0
下载
关闭预览

相关内容

人工智能杂志AI(Artificial Intelligence)是目前公认的发表该领域最新研究成果的主要国际论坛。该期刊欢迎有关AI广泛方面的论文,这些论文构成了整个领域的进步,也欢迎介绍人工智能应用的论文,但重点应该放在新的和新颖的人工智能方法如何提高应用领域的性能,而不是介绍传统人工智能方法的另一个应用。关于应用的论文应该描述一个原则性的解决方案,强调其新颖性,并对正在开发的人工智能技术进行深入的评估。 官网地址:http://dblp.uni-trier.de/db/journals/ai/
AI智能体编程:技术、挑战与机遇综述
专知会员服务
44+阅读 · 2025年8月18日
基于大模型的智能体中由自主性引发的安全风险综述
专知会员服务
18+阅读 · 2025年7月1日
【新书】大规模语言模型的隐私与安全,
专知会员服务
29+阅读 · 2024年12月4日
大语言模型安全开发者手册:构建安全的 AI 应用程序
专知会员服务
35+阅读 · 2024年9月29日
生成式人工智能大型语言模型的安全性:概述
专知会员服务
35+阅读 · 2024年7月30日
【2024新书】大型语言模型安全开发者手册,250页pdf
专知会员服务
76+阅读 · 2024年2月12日
重磅!AI框架发展白皮书(2022年),44页pdf
专知
28+阅读 · 2022年2月27日
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
展望:模型驱动的深度学习
人工智能学家
12+阅读 · 2018年1月23日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
美陆军设想无人系统司令部
专知会员服务
2+阅读 · 今天13:45
【博士论文】已对齐人工智能系统的持久脆弱性
专知会员服务
0+阅读 · 今天13:52
扭曲还是编造?视频大语言模型幻觉研究综述
专知会员服务
0+阅读 · 今天13:41
《采用系统思维应对混合战争》125页
专知会员服务
2+阅读 · 今天12:47
战争机器学习:数据生态系统构建(155页)
专知会员服务
6+阅读 · 今天8:10
内省扩散语言模型
专知会员服务
6+阅读 · 4月14日
国外反无人机系统与技术动态
专知会员服务
4+阅读 · 4月14日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员