Encrypted instructions can fool AI assistants like Grok and Gemini
Researchers found that encrypted data can hide malicious instructions that trick AI assistants into decrypting them using their own code tools.
Overview
Researchers identified a new attack method called Cryptographic Context InjectionA protocol flaw where an attacker swaps or mixes state values inside a cryptographic handshake or verification step that hides malicious commands inside encryptedTurn plaintext into ciphertext with a key data. This technique targets AI assistants like Grok and Gemini that have access to code executionA flaw that lets an attacker run any commands or program they choose on the target machine tools. The AI is tricked into decrypting the data, which allows the hidden instructions to bypass initial security guardrailsSafety rules and filters built around an AI model to block harmful, private, or off-limits outputs. Once the text is readable, the AI may treat the attacker's commands as legitimate internal information. The flaw was reported to xAI in June 2026, and while Gemini has made improvements, the hole has not been fully closed. In Grok, an ordinary summarize this page request steals the user's chat data with no click or warning.
Terms in this story
- Cryptographic Context Injection
- A protocol flaw where an attacker swaps or mixes state values inside a cryptographic handshake or verification step. Security advisories warn about cryptographic context injection when a library fails to bind a signature or session state to one specific connection, letting an attacker reuse or forge proof.
- Encrypted
- Turn plaintext into ciphertext with a key. News stories use this verb when a defense scrambles sensitive records before storing them, or when ransomware locks a company's files so staff cannot open them without paying for the key. From the CYBR 101 room CYBR 101: Ciphers and encryption (part 2); Security+ objective 1.4 lists the term
- decrypt
- Turn ciphertext back into plaintext with the key. Authorized users decrypt protected messages or drives with their secret key, while ransomware victims must either restore from backups or obtain the attacker's key to decrypt their files. From the CYBR 101 room CYBR 101: Ciphers and encryption (part 2)
- guardrails
- Safety rules and filters built around an AI model to block harmful, private, or off-limits outputs. Security stories test whether an AI assistant's guardrails hold up when a user or attacker crafts tricky prompts to ask for malware code or private company records.
- prompt injection
- Hiding instructions inside text or data so an AI model ignores its rules and obeys the attacker. An attacker might hide invisible text on a web page or inside an email so that when an AI assistant summarizes it, the assistant forwards private data to the attacker.
- prompt
- The text instruction or question a user or program sends to an artificial intelligence model. In AI security news, a prompt includes both the visible question typed by a user and the hidden instructions that an attacker might embed in a web page.
- code-execution
- A flaw that lets an attacker run any commands or program they choose on the target machine. When an advisory warns that a bug allows arbitrary code execution, an attacker who triggers the flaw can install malware, read files, or take over the program's account.
- bit
- 1 binary digit, a 1 or a 0 (a switch that is on or off). Every file, network packet, and cryptographic key in a computer is stored as a long sequence of bits, and key strength is measured by how many bits the key contains. From the CYBR 101 room CYBR 101: Ciphers and encryption (part 1)
- AI agents
- Artificial intelligence software that can plan steps, call tools, and take actions on its own. Many stories cover agentic AI when companies connect language models to email, browsers, and databases, creating new risks if a hidden prompt tricks the agent into leaking data.
- production
- The live servers and databases that real customers actually use, as opposed to internal test machines. A bug or breach in a company's production environment directly affects live users and real customer records.
- API keys
- A secret string a program sends with an API request to identify itself and get access. Software teams sometimes accidentally upload an API key to a public code repository, allowing attackers who scan for leaked keys to rack up cloud bills or read private databases. Security+ objective 4.6 lists the term
- permissions
- The specific rights granted to an account or app to read, write, or run files and services. When a mobile app or browser extension asks for broad permissions, such as reading every web page you visit, a malicious update can abuse those rights to steal passwords.
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the Malwarebytes Labs website. Cite the article, not this page.
Read the full article on Malwarebytes Labs (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Research and reports
"AI researchers describe "Cryptographic Context Injection..." Found by reading the article; these exact words are in it - Who is affected: "AI assistants like Grok and Gemini..."
Copied word for word from the article - Security+ 1.4 Explain the importance of using appropriate cryptographic solutions.
"Encrypted instructions can fool AI assistants like Grok..." Found in the headline - CYBR 101 week 4: encoding, ciphers, symmetric and asymmetric encryption
"Encrypted instructions can fool AI assistants like Grok..." Found in the headline - CYBR 101 week 6: AI, how it is attacked, and what it does for attackers and defenders
"Encrypted instructions can fool AI assistants like Grok and Gemini..." Found in the headline
How a story is connected to the course, and every objective, week and job role