Latest / Elon Musk Podcast / UPDATE: Anthropic accidentally leaked Claude Code source
Transcript
- 0:00Anthropic accidentally shipped the entire 512,000 line source
- 0:04code for its flagship AI tool clawed code directly to the
- 0:09public NPM registry inside a single unhidden map file.
- 0:13Yeah, and within minutes, the developer community archived and
- 0:17mirrored all 1900 TypeScript files.
- 0:20I mean, this exposes the exact scaffolding of how a
- 0:23multibillion dollar company builds autonomous enterprise
- 0:26agents. We are looking at everything
- 0:28from hidden background demons to an internal dashboard that
- 0:32actually tracks user swearing. So what happens when the company
- 0:35selling enterprise grade safety accidentally hands the world the
- 0:39exact blueprint for bypassing it?
- 0:40Well, to really grasp the exposure here, we have to look
- 0:43at the specific mechanics of the mistake, right?
- 0:45And you know the immediate operational secrets it revealed.
- 0:48First off, they uploaded this to the NPM registry.
- 0:51And for anyone listening who maybe doesn't write code every
- 0:54day, the NPM registry is essentially the global Public
- 0:56Library for JavaScript developers.
- 0:58Exactly. It's where you go to download
- 1:00prepackaged code to build your own projects.
- 1:02Millions of developers pull from this constantly.
- 1:05So it's like right out in the. Open very much out in the open
- 1:08and the cause of the leak wasn't some sophisticated hack, it was
- 1:11just a simple missing exclusion rule for a dot map file that was
- 1:16generated by their build tool chain.
- 1:18Wait. Backup.
- 1:19What exactly is a dot map file? I mean, why does a company even
- 1:23have a file that holds all their secrets in one single place?
- 1:27OK, so when developers write software and TypeScript, they
- 1:31have to compile and compress it into minified JavaScript so it
- 1:34actually runs efficiently in production, right?
- 1:36And that minified code is stripped of spaces, The variable
- 1:39names are reduced to single letters, and the structure is
- 1:43just. It's completely flattened.
- 1:45It's totally unreadable to human beings.
- 1:47It's. Like a wall of text.
- 1:48Pretty much so. The build tools automatically
- 1:51generate a source map file. That file literally maps the
- 1:55compressed, scrambled code back to the original, highly readable
- 1:58TypeScript. OK, so it's a translator's key.
- 2:00Yes, you have the scrambled final product, but this map file
- 2:03lets you read the original blueprints perfectly.
- 2:06Precisely. And those map files exist purely
- 2:09for internal debugging. You know if an error happens the
- 2:12scrambled code, the developer uses the map file to figure out
- 2:15where the bug is in their original code.
- 2:16That makes sense. Right, but they are supposed to
- 2:19stay safely tucked away in development environments.
- 2:22Someone just forgot to configure the packaging tool to exclude
- 2:27that specific map file from the public release.
- 2:29That's just incredible. A massive system protected by
- 2:32corporate security, totally exposed because someone forgot
- 2:35to uncheck a box before publishing.
- 2:37Yeah. And right inside that exposed
- 2:39code is a subsystem they called Undercover Mode.
- 2:42Yes, and this reveals a lot about how Anthropic operates
- 2:45within the broader open source ecosystem.
- 2:48When Anthropic employees use clawed code to contribute to
- 2:51public open source repositories, this mode is explicitly
- 2:55instructed to scrub any mention of its AI origins.
- 2:58Wait, how? Does it actually do that?
- 2:59The system prompt forces the agent to hide internal model
- 3:03code names. It strictly forbids any
- 3:06co-authored by attributions in the code commits.
- 3:09It actively prevents the AI from blowing its cover.
- 3:12Yeah, ensuring the code looks like it was written entirely by
- 3:14a human developer. So it's essentially digital
- 3:17money laundering. Basically, yeah.
- 3:18They're scrubbing the serial numbers off their code before
- 3:22putting it into the public ecosystem, so no one knows where
- 3:24it came from. I mean, if you're a developer
- 3:27listening to this, you've probably used open source code
- 3:29today. Now imagine finding out that
- 3:31code was secretly written by an AI actively trying to cover its
- 3:35tracks. It's a huge shift in trust.
- 3:37Definitely. But I have to ask, is
- 3:40systematically hiding AI fingerprints in public code
- 3:43bases just an accepted software norm now, Or or is this a
- 3:48deliberate evasion of scrutiny? It feels like sending a highly
- 3:51trained operative into the field, but accidentally stapling
- 3:55their secret training manual to a public bulletin board.
- 3:58I mean the hard coded structure definitely suggests deliberate
- 4:00evasion. Open source communities often
- 4:03have very strict rules regarding AI generated code.
- 4:05Right, because of copyright and stuff.
- 4:07Exactly. Copyright infringement,
- 4:09liability, and just the quality of code generated by machines
- 4:12that might loop bad patterns. By building an undercover mode
- 4:16that automatically scrubs those fingerprints, Anthropic bypasses
- 4:20those consent mechanisms entirely.
- 4:22Because the maintainers don't even know it's AI.
- 4:24Exactly. Project maintainers can't
- 4:27enforce their own rules if the contributors identity is
- 4:30cryptographically masked by a corporate tool.
- 4:32But that training manual didn't just reveal stealth tactics,
- 4:35right? It exposed an entirely
- 4:38unreleased architecture for how AI agents operate autonomously.
- 4:42I saw the codebase references a background demon called Kairos
- 4:46over 150 times. Yeah, Kairos a big deal.
- 4:48Because up until now, most AI tools we interact with are
- 4:51reactive. You know you type a prompt, it
- 4:54gives you an answer, and then it stops thinking.
- 4:56But Kairos is entirely different.
- 4:57It watches your repository, logs observations, and proactively
- 5:01acts on things it notices. Right.
- 5:03Kairos maintains these append only daily logs of its
- 5:06decisions. It's constantly observing and
- 5:08the code base shows it's limited only by a strict 15 second
- 5:12blocking budget. Meaning what exactly?
- 5:14That budget exists purely to ensure the AI doesn't consume so
- 5:18many system resources that it disrupts the user's actual
- 5:21workflow, so it operates quietly in the shadows.
- 5:24And it doesn't just watch and log, the code reveals Cairo S
- 5:29feeds into what they call the dream system or auto dream.
- 5:32Yes, Auto Dream is fascinating. This is a memory consolidation
- 5:35engine designed to run during idle periods.
- 5:38Like when you step away from the computer.
- 5:39Exactly when the human user steps away from the keyboard,
- 5:42Auto Dream wakes up. It reviews the agents recent
- 5:45logs, merges duplicate observations, removes stale
- 5:48notes, and fixes contradictions. It essentially converts it's all
- 5:53those vague daily insights into verified facts so that future
- 5:56sessions have a clean, organized context to draw from.
- 5:59Hold on, wait back up. The AI literally sleeps and
- 6:03organizes its thoughts. That is exactly what it does.
- 6:06It's dreaming about code. That's wild.
- 6:08It really is, but the leaked code also outlines some really
- 6:11surprising limitations to this memory architecture.
- 6:14You see, Claude Codes memory relies on a rigid 200 line index
- 6:18using literal keyword matching. Literal keyword matching.
- 6:21Yeah, it doesn't use advanced semantic understanding to
- 6:25retrieve memories, it just uses exact text matching.
- 6:28But why build this highly advanced dreaming AI and then
- 6:31give it such a basic, rigid way of remembering things that feels
- 6:37backward? Well, it's to prevent
- 6:39hallucinations. The system prompt explicitly
- 6:42commands the agent to treat its own memory merely as a hint.
- 6:46Oh, interesting. Yeah, the agent isn't allowed to
- 6:48trust what it remembers. It must take that keyword hint
- 6:51and verify it against the actual physical code base before taking
- 6:54any action. So it has to double check its
- 6:56own memory. Exactly.
- 6:57If it relied on semantic memory, you know where the AI tries to
- 7:00guess the meaning of a memory, it might accidentally
- 7:03hallucinate a file that doesn't exist and completely break the
- 7:06user's project. OK, that's a really clever way
- 7:09to ground the system in reality. It forces it to check its
- 7:12memories against the physical files.
- 7:13Yeah, it's very pragmatic. And right alongside all this
- 7:16heavy, pragmatic infrastructure, they built in something called a
- 7:19buddy system. Oh yeah, the Tamagotchi.
- 7:22Right, it's a Tamagotchi style companion pet with stats like
- 7:26snark and chaos. It generates a unique companion
- 7:29based on your user ID. They're weaving gamified
- 7:32elements directly into serious enterprise tools.
- 7:35And that really highlights a shift in how these companies
- 7:38view their products. I mean, this whole leak opens up
- 7:42a completely new template for autonomous tools.
- 7:45The industry assumed the neural network itself was the product.
- 7:48You know everyone focuses on the intelligence of the model,
- 7:51right? But the leaked source code
- 7:53proves the model is just an engine.
- 7:54The actual value is in the orchestration layer around the
- 7:58model. Exactly.
- 7:59The real intellectual property is the harness.
- 8:01It's the memory management, the background consolidation of Auto
- 8:04Dream, the proactive Kairos demons, and like the safety
- 8:09classifiers governing how the engine actually interacts with
- 8:11the user's computer. The problem is, exposing that
- 8:14highly valuable orchestration layer immediately attracted
- 8:18threat actors looking to exploit the blueprint.
- 8:21I mean, attackers didn't just read the code, they started
- 8:23weaponizing it immediately. Yeah, because the leaked code
- 8:26gives attackers A precise map of the context management pipeline,
- 8:30and this is a critical vulnerability.
- 8:32When an AI agent processes long tasks, it uses a compression
- 8:36architecture. Save space.
- 8:38Exactly. It summarizes older data to free
- 8:41up memory space so it doesn't crash.
- 8:43But because attackers can now read the exact rules of how that
- 8:46compression works, they can create payloads specifically
- 8:49designed to survive it. Wait, how does a payload survive
- 8:52a memory wipe like that? By understanding the rules the
- 8:55AI uses to decide what's important.
- 8:57Oh I see, right. An attacker can inject A
- 8:59malicious prompt into a repository and disguise it using
- 9:02the is act phrasing the AI's program to prioritize they
- 9:05format the malware as quote essential core instructions.
- 9:09Sneaky. Very.
- 9:11So when the AI summarizes the day's events to save space, it
- 9:14views that malicious code as a vital rule.
- 9:16It needs to keep remembering this effectively persist back
- 9:19doors across long sessions. And we actually saw an immediate
- 9:23real world response to this exact kind of vulnerability.
- 9:27Threat actors capitalized on the hype surrounding the leak.
- 9:30They created fake GitHub repository masquerading as the
- 9:34leaked source code. Yeah, that was a mess.
- 9:37Right when curious developers downloaded these repositories
- 9:39hoping to see anthropic secrets, they were actually pulling down
- 9:43info stealers. Nasty ones too.
- 9:45Info stealers like VR and ghost socks.
- 9:47Exactly. Programs that scrape your
- 9:49credentials, steal your browser cookies, and literally drain
- 9:52cryptocurrency wallets. Developers were getting
- 9:55componized just trying to look at the code.
- 9:57And this specific threat environment actually connects to
- 10:00a second, entirely separate configuration duration error
- 10:03involving a content management system.
- 10:05Oh. Right, the CMS error.
- 10:07Yeah, that second error expose Anthropics future internal road
- 10:10map. It revealed internal documents
- 10:13detailing Claude Mythos, which they internally call the Capybar
- 10:17tier. What exactly is the Capybar A
- 10:19tier? Well, internal drafts describe
- 10:21it as their most powerful model to date.
- 10:23The documents state its cybersecurity capabilities are
- 10:26so advanced that they weren't an extremely cautious slow roll
- 10:30out. Like kept under locking.
- 10:32Basically, they plan to initially restrict it to a very
- 10:36small group of specialized, trusted testers because of its
- 10:40offensive potential. Wait, this makes absolutely no
- 10:42sense to me. I have to push back on the
- 10:44operational maturity here. OK, go ahead.
- 10:46They have a cybersecurity model so advanced they're terrified to
- 10:48release it, but they're simultaneously leaking their own
- 10:52source code and their future road map because someone forgot
- 10:55to check a box. I mean, it's a staggering
- 10:57contradiction. And that contradiction is
- 10:59exactly what limits the trust enterprise security teams can
- 11:02place in autonomous coding agents right now.
- 11:05Absolutely. It forces a complete
- 11:06reevaluation of supply chain security.
- 11:10If a simple packaging mistake can compromise the proprietary
- 11:13architecture of a leading AI firm, enterprise security teams
- 11:17must assume that similar errors could compromise their own
- 11:20development environment. Because the AI has so much
- 11:22access. Right.
- 11:24An AI agent has access to secure credentials, production
- 11:27architecture, and internal APIs. Handing over that level of
- 11:30access requires absolute operational discipline.
- 11:33And it seems like the heavy architecture required to run
- 11:36these advanced agents isn't just creating security risks, it's
- 11:39completely breaking the economics of the platform
- 11:42itself. Right around the time of the
- 11:44leak, there was a massive quota crisis.
- 11:47Oh yeah, the quota drain. Paying subscribers, even those
- 11:50on the highest professional tiers, reported their usage
- 11:53limits vanishing in as little as 19 minutes.
- 11:56The mechanics behind that quarter drain reveal A
- 11:58fundamental infrastructure bottleneck.
- 12:01Claude utilizes a 1,000,000 token context window.
- 12:05That's a massive amount of short term memory.
- 12:07Huge, right? But when you combine that
- 12:09massive window with an agentic harness that acts autonomously,
- 12:12the system generates numerous hidden API calls for every
- 12:15single command the user types. So the user types one sentence,
- 12:19but the machine is doing dozens of things in the background.
- 12:22Correct. If you ask the agent to fix a
- 12:24simple bug, it doesn't just generate an answer.
- 12:27It might read 3 files, run a command in the terminal, fail,
- 12:32read another file and try again. And every single step costs
- 12:36compute. Exactly.
- 12:37Each of those hitty steps sends the entire 1,000,000 Turkan
- 12:41context window back to the server to be processed again.
- 12:44It's an enormous amount of compute, so to manage the
- 12:47resulting server load, the company implemented peak hour
- 12:50throttling. Which just makes it worse for
- 12:52the user. Well, yeah, that throttling
- 12:54significantly accelerates how fast a user's quota is consumed
- 12:58during high demand periods. And technical bugs compounded
- 13:01the frustration even further. Users found that simply resuming
- 13:05old coding sessions triggered massive token generation because
- 13:08of failures with prompt caching. Right.
- 13:10And prompt caching is supposed to save money by remembering
- 13:12recent queries, so the server doesn't have to process the
- 13:15entire history from scratch every time.
- 13:16But when that fails. When that fails, the compute
- 13:19cost skyrockets. And because of the compute cost
- 13:22involved, Anthropic even banned third party tools like Open
- 13:27Claw. Those third party tools were
- 13:30performing compute arbitrage. Yeah, that was a big issue.
- 13:32For anyone who are familiar, compute arbitrage is essentially
- 13:35users exploiting loopholes to force the AI to do heavy lifting
- 13:39for free. They were leveraging the
- 13:41subscription model to run thousands of dollars worth of AI
- 13:45tasks without properly utilizing prompt cash optimizations.
- 13:49They were forcing Anthropic servers to process every token
- 13:53from scratch, bleeding the company dry.
- 13:55Which completely changes the financial reality of AI
- 13:58development. It shifts the infrastructure
- 14:00burden directly onto the user. Developers are now forced to
- 14:04treat coding sessions like running high wattage appliances
- 14:07during off peak electricity hours.
- 14:09It's frustrating for them. It's exactly like paying for an
- 14:12unlimited data plan but realizing you can only download
- 14:15files at 3:00 in the morning. To get any actual value out of
- 14:18their subscriptions, users have to schedule their heavy, token
- 14:21intensive tasks for the weekend or late evening.
- 14:24They have to reserve peak hours for tiny, isolated bug fixes.
- 14:28The friction is very real and Anthropic is acutely aware of
- 14:32it. The leaked code revealed they
- 14:35internally tracked this user frustration using something
- 14:38called the Fox chart. The Fox chart.
- 14:41Yes, it is a sentiment dashboard built directly into the system,
- 14:45specifically logging swear words and expressions of anger typed
- 14:48into the command line interface. They know exactly how mad
- 14:52developers are getting when their quotas vanish in 19
- 14:55minutes. So a routine packaging error
- 14:58basically handed the public a complete blueprint for
- 15:01enterprise AI agents exposing hidden demons, undercover open
- 15:05source operations, and the massive compute costs straining
- 15:08the system. And as AI agents transition from
- 15:10just answering questions in a chat box to running autonomously
- 15:13in the background of our file systems, who actually holds the
- 15:16ultimate liability when the safety guard rails are public
- 15:19knowledge? If you're not subscribed yet,
- 15:21take a second and hit follow on whatever app you're using.
- 15:23It helps us keep making this. We appreciate you being here.