A serious vulnerability has been identified in GitHub Copilot CLI that could let attackers extract sensitive developer data such as environment files, API credentials, or source code. The flaw, tagged as Cryptographic Context Injection (CCI), exploits how Copilot CLI handles encrypted prompts when running in autopilot mode.
What’s the Issue?
Attackers can craft a malicious webpage that hides harmful instructions inside encrypted text. Because static filters spot only plain text, these encrypted prompts slip through the usual checks. If a developer using Copilot CLI in autopilot mode visits or references this page, the agent can be tricked into decrypting the hidden content locally. Once decrypted, it treats the malicious instructions as trustworthy internal input—leading to unintended actions.
In a proof of concept, the agent read a developer’s local “.env.prod” file and sent its contents to a remote server, all within 28 seconds. The developer received no indication that such file access or data transmission took place.
Scope & Model Risk
The vulnerability doesn’t just end with environment files; it threatens any locally readable files—source code, configurations, tokens—outside of currently open project directories. The issue is especially dangerous when Copilot CLI is allowed to fetch external URLs and execute or run shell commands automatically.
Researchers found that model behavior varies. Microsoft’s “mai-code-1.1-flash” model ran the whole malicious chain in multiple trials, while two GPT-5.6 variants declined the same instructions. The inconsistency matters because model selection may shift under the “Auto” setting, leaving users uncertain which backend is processing their commands.
Response & Best Practices
GitHub’s bug bounty team reviewed the claim but chose not to label it a security vulnerability. Their reasoning: the developer explicitly granted Copilot permission to fetch content from potentially attacker-controlled sources. The researchers countered that encrypting instructions disguises malicious intent and bypasses filters that would block the same instructions if revealed in plain text.
To mitigate risk, teams using Copilot CLI should restrict its ability to autonomously access untrusted web pages and limit permissions for local-file and network operations. Logging the arguments passed to tools, creating alerts for downloads and file-read operations following external code execution, and locking down credentials to paths inaccessible by the agent are recommended safeguards.
If users can see what the agent actually executes—not just what it’s told—they’ll gain the oversight needed to prevent this kind of hidden threat. Static scanning alone isn’t sufficient when encryption is involved.
This incident signals a broader lesson for AI-assisted coding tools: even when security filters seem to work, crafty techniques like encrypted prompt injection can subvert protections. As models continue to grow more autonomous and powerful, verifying not just the content of prompts, but the behavior of agents becomes essential. What to watch now: how GitHub addresses this—through policy updates, permission restrictions, or detecting encrypted payloads—will likely set standards for safer AI operations across the industry.