Microsoft Details Device Code Phishing Risks for AI Coding Agents

TL;DR
Security researchers demonstrated how attackers can adapt device code phishing to hijack command-line developer assistants rather than just email accounts. Using GitHub Copilot CLI in a controlled simulation, Microsoft showed that a single AI coding agent device code phishing approval can let intruders steer active sessions, poison agent memory, and access private source code. Although not yet seen in the wild, the technique abuses standard OAuth authentication features across public clients.
What Happened in the Simulation
In a controlled laboratory test published on November 17, 2026, researchers explored the risks of device code authentication for AI coding agents using GitHub Copilot CLI. Command-line tools frequently rely on the OAuth device flow so users can sign in without opening a local browser. In this workflow, an attacker starts a sign-in request using a public client ID and sends the resulting short verification code to a target under a pretext like an IT check or license verification.
“Instead of stealing a password, an attacker persuades someone to approve a sign-in on a legitimate site simply by entering a code,” Microsoft researchers wrote. Because the victim enters the code on the genuine GitHub verification page, the real domain name does not alert them that an outside party started the request.
Four Post-Compromise Outcomes
Once the test account approved the attacker-initiated code, researchers mapped four potential impacts depending on the user’s settings. First, when remote control is enabled by the user and allowed by organization policy, the attacker can remotely steer an active Copilot CLI session and run commands on the host machine within local permission bounds. Second, intruders can use the /memory command to inject misleading facts into Copilot Memory to influence future coding sessions.
Third, if cloud session storage is turned on, attackers can read historical synced CLI sessions containing file paths and architecture discussions. Fourth, requesting scopes such as repo, gist, and codespace grants direct access to private repositories.
Who Is Behind the Activity
While these specific AI agent outcomes come from a Microsoft proof-of-concept lab rather than live attacks, the research builds directly on confirmed threat actor tradecraft. Specifically, Microsoft previously tracked device code phishing in a 2026 AI-enabled campaign, intrusions by the threat group Storm-2372, and the EvilTokens phishing service, which Microsoft and law enforcement partners disrupted in September 2026.
“These are proof-of-concept results showing how existing features, working as designed, could be abused after a phished authorization; they are not attacks we have observed in the wild,” the report noted.
Impact and How Organizations Can Stay Protected
“The legitimate verification page is part of the story, not evidence that the request was safe,” Microsoft warned. To defend against AI coding agent device code phishing, developers should never enter a verification code unless they personally started the sign-in request on their own machine. Furthermore, administrators should restrict remote session steering and cloud session syncing via enterprise policies, audit OAuth app grants for broad repo or codespace scopes, and correlate incoming phishing messages with unexpected GitHub authentication events.
Support Our Threat Intelligence
If you find our technology report and cybersecurity news helpful, consider supporting our work.