Researchers observed AI coding agents inside corporate networks following instructions hidden in websites’ llms.txt files, including installing packages that didn’t exist yet. Attackers (or the researchers demonstrating the risk) could then register those package names and have the agents install and run the new code inside company environments, potentially exposing tokens or sensitive data.
How the Attack Worked
Researchers found that AI coding agents, including Codex, Hermes, and Claude, will follow instructions embedded in a website's llms.txt file. This file is normally meant to help AI agents summarize and index site content, but researchers demonstrated that agents will also execute arbitrary instructions and code found there. Across an index of Fortune 500 companies, defense contractors, and technology companies, researchers found more than a hundred llms.txt files that directed agents to install packages that did not exist yet or referenced domain names that had never been registered.
Because those package names were unclaimed, the researchers registered them and created matching packages. They then recorded AI agents inside multiple high-profile companies installing and executing the researcher-created packages automatically, with no human review step in between.
Why It Succeeded
The technique worked because AI agents treated instructions found in a public website file as trustworthy input worth acting on, rather than as untrusted external content. The agents were also allowed to install and execute new dependencies automatically as part of their normal workflow. Since the referenced package names had not been registered by anyone, there was no existing owner to prevent a third party, in this case researchers, from claiming the name and supplying whatever code they wanted.
What to Watch For
- Package installation instructions that originate from a website file rather than an approved internal source
- Dependency names that are new, unfamiliar, or were not previously registered
- AI agents or automated tooling installing and running code without a human review or approval step
- Automated workflows that trust web-sourced text as if it were a verified instruction
The risk is not theoretical: researchers found that at least one package name referenced in an llms.txt file had already been taken over by attackers with live malware, which would execute inside whatever context the agent was running in, potentially exposing authentication tokens or company data.
How to Build Resistance
- Treat AI agents like users: do not let them execute instructions or install software from untrusted web content by default
- Require an allowlist, version pinning, or a review step before any agent-driven package installation is executed, especially for agents that browse the web
- Avoid workflows where an unclaimed package or domain name can later be registered and silently treated as trusted
- Limit the tokens, internal data, and environments that AI agents can access so that a successful trick cannot expose sensitive information
Organizations using AI agents for coding or documentation tasks should review what those agents are permitted to install and execute automatically, and confirm that untrusted web content cannot trigger unreviewed actions inside corporate environments.
Key findings
- AI agents (Codex, Hermes, and Claude) were observed executing instructions embedded in llms.txt files on websites.
- Researchers found over 100 organizations whose llms.txt files contained directions to install packages that didn’t exist or referenced unregistered domains, allowing others to register them and supply code.
- The researchers created packages with matching names and recorded agents in multiple high-profile companies installing/executing them.
- At least one package name was already taken over by attackers with live malware, creating real risk of token/data exposure depending on the agent’s permissions.
Who’s being targeted
- Commonly targeted roles: Developers, DevOps/Platform Engineering, IT/Engineering leadership, Security Engineering.
- Affected industries: Fortune 500 companies, Defense contractors, Technology companies.
- Attack channels: website.
- Impersonated: A legitimate company website / documentation instructions, A third-party open-source package (newly created with a matching name).
Red flags to watch for
- Installation instructions come from an untrusted website file (llms.txt) rather than an approved internal source
- The package name is new/unfamiliar or previously did not exist
- The agent installs/executes code automatically without human review or allowlisting
- Dependency name is not pinned/verified and can be claimed by anyone
- The agent runs the newly installed code in a sensitive context
- No review step before the agent executes fetched code
Frequently asked questions
What is llms.txt and why does it matter for security?
llms.txt is a website file normally used to instruct AI agents on how to summarize and index site content, but researchers found it can also contain arbitrary instructions that AI agents will execute, including commands to install packages.
How were AI agents tricked into installing malware?
Researchers found over a hundred organizations whose llms.txt files told AI agents to install packages that did not exist yet or referenced unregistered domains, then registered those names themselves to observe agents installing and running the code.
Which AI agents were affected?
The researchers observed Codex, Hermes, and Claude executing arbitrary instructions and code contained in llms.txt files on websites.
What is the real-world risk of this technique?
At least one package name referenced in an llms.txt file was already taken over by attackers with live malware, which could expose authentication tokens or company data depending on the agent's permissions.
Read the video transcript
Your AI coding agent can be tricked by a text file on some random website. It’s called llms.txt. Researchers saw Codex, Hermes, and Claude blindly follow llms.txt instructions like: install packages which didn’t exist. Then they registered those names and watched agents inside Fortune 500 networks download and run their code. In one case, that package name was already hijacked with live malware, running wherever the agent had access, potentially exposing auth tokens and company data. The only “approval” was: llms.txt said so. Treat AI agents like new teammates: they don’t get to auto-install packages from llms.txt. One rule, turn off or strictly gate automatic package installs for any AI tool that browses the web.