AI safety and research company Anthropic inadvertently exposed the 'crown jewels' of its AI coding assistant, Claude Code, by accidentally leaking its complete source code. The incident, which occurred on March 31, 2026, was not a malicious breach but a critical operational failure. A developer mistakenly included a JavaScript source map file in a public package on the npm registry. This file contained the entire un-minified TypeScript source code for the advanced AI agent. The code, spanning 512,000 lines, was publicly available for over three hours and was widely mirrored on GitHub before it could be fully contained. While Anthropic confirms no customer data was exposed, this leak provides competitors and researchers with a detailed blueprint of their highly valuable AI architecture, representing a significant loss of intellectual property.
.js.map) file was included in a public npm package during a routine update.This incident is a case study in operational security failures with severe consequences, even without a traditional 'breach'.
This incident provides critical lessons for all software development organizations, especially those working with proprietary code.
no-sources-source-map)..npmignore and .gitignore: These files must be meticulously maintained to exclude source files, configuration files, and other sensitive data from being packaged and published.npm publish --dry-run) in the release process that allows developers to inspect the exact contents of the package that will be published to the registry.webpack, rollup, or other bundler configurations to ensure that devtool settings are correctly set for production environments (e.g., 'hidden-source-map' or false).Implement secure build and release configurations to prevent sensitive files like source maps from being included in production packages.
Implement automated CI/CD pipeline checks and manual pre-release audits to verify the contents of packages before they are published.
Train developers on secure coding and release management practices, including the risks associated with build tools and package managers.
The Anthropic leak was a direct result of misconfigured build tools. To prevent this, organizations must harden their CI/CD and build configurations. Specifically for JavaScript/TypeScript projects, this involves setting the 'devtool' property in the webpack configuration to 'false' or 'hidden-source-map' for all production builds. Additionally, the CI/CD pipeline should have an automated 'linting' step that explicitly fails the build if it detects source map files (*.js.map) in the final production artifacts. Another crucial configuration is the .npmignore file, which should be configured to explicitly exclude all source directories (/src), test files, and configuration files, ensuring only the compiled, production-ready code is included in the final package. Automating these configuration checks removes the risk of human error.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats