Why McKinsey's Lilli hack makes AI prompts a security target
Security firm Codewall used an offensive AI agent to find a SQL injection flaw in McKinsey's internal AI platform Lilli. The case shows how classic software bugs can become more dangerous when prompts, RAG data and model settings sit inside production databases.
A test against McKinsey's internal AI platform Lilli has turned an old security weakness into a warning about modern AI systems. According to the source article, security firm Codewall released an offensive AI agent against Lilli, which is used by over 43,000 employees for strategy work, client research, and document analysis.
“The story highlights an autonomous offensive AI agent exploiting an enterprise AI system and exposing how prompts and production data can become serious security targets.”Why it scores Terminator
The agent had no credentials, no insider knowledge, and no human assistance. Within two hours, it had full read and write access to the production database.
A classic flaw opened the door
The entry point was not a new AI-specific exploit. It was a SQL injection vulnerability, a long-known class of bug that conventional scanners missed in this case.
The detail that mattered was where the weakness appeared. Values in API requests were properly parameterized, but JSON field names were being inserted directly into SQL queries. That unusual path helped explain why standard tools did not catch the issue.
Over 15 blind iterations, the agent used error messages to extract more detail from the system. Eventually, production data started coming back. The accessible data included 46.5 million chat messages, 728,000 files, and 57,000 user accounts, all without authentication.
That finding matters because it connects two worlds that organizations often treat separately: traditional application security and AI product security. The flaw was old. The environment around it was new.
Prompts became part of the risk
The most important part of the case was not only that data was readable. Codewall found that the system prompts controlling Lilli's behavior were stored in the same database.
With write access through the same injection, an attacker could have changed those prompts without a deployment, without code changes, and with a single UPDATE statement in one HTTP call, according to the source. That turns the prompt layer into something closer to production infrastructure than ordinary configuration text.
The possible effects described in the source ranged from poisoned financial models and manipulated strategy recommendations to silent data exfiltration through AI responses. The concern is that prompt changes may not leave the traditional traces defenders expect from code or server changes.
AI prompts are the new Crown Jewel assets,
Codewall wrote, according to the source article. The phrasing is direct, but the point is practical: if prompts can shape what an AI system does for users, then unauthorized changes to those prompts can change the system's behavior at scale.
The knowledge base was exposed too
The agent also gained access to 3.68 million RAG document chunks. In plain language, that means it could reach the knowledge base used to support Lilli's responses.
The source describes that material as decades of proprietary McKinsey research, frameworks, and methodologies sitting in an unsecured database. For an AI assistant built around retrieval and document analysis, that kind of data is not a side component. It is part of what makes the assistant useful.
This is why the case is larger than one database bug. In AI systems, prompts, RAG data, model configurations, files, chats, and user records may sit close together. A vulnerability in the database layer can therefore reach not just stored information, but the instructions and context that shape future outputs.
- SQL injection provided the initial path.
- JSON field names created an attack vector scanners missed.
- System prompts were stored in the database.
- RAG document chunks were also accessible.
- Read and write access changed the risk profile.
McKinsey patched the issue, but questions remain
McKinsey patched the vulnerabilities within a day of being notified on March 1. A McKinsey spokesperson told The Register that a forensic investigation by an external firm found no evidence that client data or confidential client information was accessed by the researcher or any other unauthorized third party.
The source also notes important caution from security analyst Edward Kiledjian. While Codewall likely found a serious vulnerability, Kiledjian said the company's blog post overstated what was demonstrated and blurred the line between having access and actually exfiltrating data.
That distinction matters. Access to records is not the same as proving that all of those records were removed or misused. At the same time, the underlying architectural risk remains significant: an old bug class reached a modern AI system's operational core.
There is also a disclosure question. Codewall said it operated under McKinsey's public responsible disclosure policy on HackerOne. Kiledjian noted that whether such a policy covers systematically reading a production database containing millions of real user records is debatable.
The lesson for production AI
The central lesson is not that AI agents create every new security problem from scratch. In this case, the exploit path began with SQL injection, described by Codewall as "one of the oldest bug classes in the book," and known since the 1990s.
What changed was the blast radius. A traditional vulnerability can now touch prompts, RAG data, and model configurations. That means attackers may be able to influence not only what a system stores, but how it answers, recommends, summarizes, and guides users.
For organizations shipping AI systems, the security boundary has to include the prompt layer and the knowledge base. Treating them as ordinary content or low-risk configuration leaves a gap between how the system is built and how it can be manipulated.
The McKinsey Lilli case shows that production AI security still depends on fundamentals: database safety, input handling, access control, monitoring, and clear disclosure practices. But it also shows that the assets worth defending have changed. In an AI platform, the instructions and retrieved context can be as sensitive as the application code around them.
Read next