"Vibe coding," in which developers delegate code generation to AI assistants and accept the output with little manual review, has gained rapid adoption in production settings. On March 31, 2026, Anthropic's Claude Code CLI shipped a 59.8 MB source map file in its npm package, exposing roughly 512,000 lines of proprietary TypeScript. The tool had itself been largely vibe-coded, and the leak traced to a misconfigured packaging rule rather than a logic bug. Existing static-analysis and secret-scanning tools did not cover this failure mode, pointing to a gap between the vulnerabilities AI tends to introduce and the vulnerabilities current tooling is built to find. We present VibeGuard, a pre-publish security gate that targets five such blind spots: artifact hygiene, packaging-configuration drift, source-map exposure, hardcoded secrets, and supply-chain risk. In controlled experiments on eight synthetic projects (seven vulnerable, one clean control), VibeGuard achieved 100% recall, 89.47% precision (F1 = 94.44%), and correct pass/fail gate decisions on all eight projects across three policy levels. We discuss how these results inform a defense-in-depth workflow for teams that rely on AI code generation.
翻译:“氛围编码”(指开发者将代码生成任务委托给AI助手,并几乎不经人工审查就采纳输出结果)已在生产环境中迅速普及。2026年3月31日,Anthropic公司的Claude Code CLI在其npm包中发布了一个59.8 MB的源映射文件,暴露了约51.2万行专有TypeScript代码。该工具本身在很大程度上是通过氛围编码开发的,而此次泄露源于一个配置有误的打包规则,而非逻辑缺陷。现有的静态分析和秘密扫描工具未能覆盖此类失效模式,这暴露出AI倾向于引入的漏洞与当前工具旨在发现的漏洞之间存在鸿沟。我们提出了VibeGuard——一个预发布安全门,专门针对五个此类盲点:工件卫生、打包配置漂移、源映射暴露、硬编码秘密以及供应链风险。在针对八个合成项目(七个存在漏洞,一个为清洁对照组)的受控实验中,VibeGuard实现了100%的召回率、89.47%的精度(F1=94.44%),并在三个策略层级上对所有八个项目做出了正确的通过/拦截门控决策。我们讨论了这些结果如何为依赖AI代码生成的团队构建纵深防御工作流提供参考。