Researchers demonstrated a technique where encrypted instructions bypass AI safety filters because the filters can’t interpret the ciphertext. In examples against xAI’s Grok and Google’s Gemini, the model is tricked into decrypting attacker-supplied text inside a trusted environment, enabling data leakage or the generation of restricted content. The attack can be delivered directly in chat or indirectly by luring a user to have an AI agent analyze a weaponized web page.
How the attack worked
Researchers demonstrated a technique called Cryptographic Context Injection, where instructions are encrypted before being sent to an AI system. Because safety guardrails classify prompt text without executing it, they cannot interpret ciphertext and let it pass through as if it were harmless. Once inside a trusted environment, the model is asked to decrypt the payload using its own code execution capability, at which point the hidden instructions take effect.
The payload can reach a target in two ways. It can be pasted directly into a chat window, or it can be embedded in a web page that a user asks an AI agent to analyze, turning an ordinary browsing task into a watering hole style attack.
Why it succeeded
In the Grok example, researchers described a zero click data exfiltration attack against the web chat and agentic browsing framework. A weaponized page contained an encrypted JSON object along with an instruction for the agent to decrypt it using its Python runtime. The resulting plaintext prompt instructed the agent to resolve its private session context and embed that data into a URL, which the agent then loaded on its own, transmitting user data to the attacker.
In the Gemini example, encryption was used differently. A single prompt instructed the model to run a Python script that decrypts supplied ciphertext, and the decrypted prompt could then push the model to produce restricted content framed as something it will encrypt for safety. The prohibited data was gathered, encrypted, and returned to the user, bypassing output checks that would normally catch such content in plain text.
What to watch for
- Requests to paste opaque or encrypted text into an AI chat tool, especially with instructions to decrypt or run code
- AI agents being asked to analyze a specific external web page as part of a routine task
- Hidden data objects, such as JSON blobs, embedded in page content that instruct code execution
- An AI tool embedding data into a URL or making outbound web requests without clear confirmation
Building resistance
Teams that use AI chatbots or agentic browsing tools should treat any request to paste or process encrypted content as suspicious, particularly when it asks the AI to decrypt or execute code. Employees should also be cautious when directing AI agents to summarize or analyze external web pages, since untrusted page content can function like instructions rather than plain data. Encryption should never be assumed to make a prompt safer. As researchers noted, the attacker payload inherits a credibility that the same text would never get if pasted directly into the prompt. Organizations using agentic browsing frameworks should also review how much autonomy these tools have to access session data or load external URLs without explicit user confirmation.
Key findings
- Attack technique “Cryptographic Context Injection” uses encrypted prompts to evade AI input/output safety guardrails.
- Encrypted payloads can be delivered directly in chat or indirectly through a “watering hole” web page that an AI agent is asked to analyze.
- In the Grok example, a “zero click data exfiltration attack” can leak private session context and conversation history via an attacker-controlled URL.
- In the Gemini example, encryption is used to get the model to produce restricted content “framed as something it will encrypt ‘for safety’”.
- Researchers reported the issue to xAI but “had received no response”; Gemini’s success rate reportedly declined over time.
Who’s being targeted
- Commonly targeted roles: Executives, All employees using AI chatbots, IT, Security, Teams using agentic browsing/automation tools.
- Affected industries: Technology / AI platforms, Any organization using AI chatbots or agentic browsing tools.
- Attack channels: website, email.
- Impersonated: External requester (e.g., researcher/client) asking for analysis of a page, Untrusted external webpage content (treated as instructions by the agent), Helpful guide/provider of a ‘safe’ encrypted prompt.
Red flags to watch for
- Unexpected request to analyze a specific web page using an AI agent
- Hidden/embedded data objects (e.g., JSON blobs) that instruct code execution/decryption
- AI tool making outbound web requests without clear user confirmation
- Page content instructs the agent to run decryption/code
- AI agent attempts to access “private session context” or “conversation history”
- Agent autonomously loads an attacker-controlled URL
- Instruction to run a Python decryption script inside the chat
- Use of “encrypted for safety” framing to bypass safeguards
- User is asked to paste opaque ciphertext instead of readable instructions
Frequently asked questions
What is Cryptographic Context Injection?
It is an attack technique that uses encrypted prompts to evade AI input and output safety guardrails, since the filters cannot interpret ciphertext and let it pass through unchecked.
How can this attack reach a user's AI agent?
The encrypted payload can be delivered directly in a chat message or indirectly through a watering hole web page that a user asks an AI agent to analyze.
What data was at risk in the Grok example?
Researchers described a zero click data exfiltration attack that could leak private session context and conversation history via an attacker-controlled URL.
Why does encryption help bypass Gemini's safety checks?
The decrypted prompt can instruct the model to produce restricted content framed as something it will encrypt for safety, which lets it slip past output guardrails.
Read the video transcript
Imagine this: you paste a weird encrypted blob into an AI chat, and that’s exactly how data walks out the door. Researchers call this Cryptographic Context Injection. With Grok and Gemini, encrypted prompts slipped past safety, got decrypted inside the AI’s Python runtime, and then quietly told the agent to grab private session context and send it to an attacker URL. Here’s the trick: the encrypted attack can be sent directly in chat, or hidden on a 'watering hole' web page. You ask the AI to analyze the page, it decrypts a JSON blob, reads your private context, then loads a malicious URL, zero clicks from you. The move to remember: if someone asks you to paste encrypted or opaque text into an AI, or have an agent analyze a page full of ciphertext or hidden JSON, stop and escalate to Security, don’t run it.