Microsoft warns of device code phishing risks targeting AI coding agents like GitHub Copilot CLI

Published:

Microsoft has issued a warning regarding the rising threat of device code phishing, particularly targeting AI coding agents like GitHub Copilot CLI. This method allows attackers to gain unauthorized access by tricking users into approving sign-in requests on legitimate platforms. The implications of such attacks can be severe, as they may lead to unauthorized access to sensitive code repositories and other critical resources.

In a recent analysis, Microsoft highlighted how device code phishing has evolved from traditional account takeover methods. Instead of merely stealing passwords, attackers can now exploit the OAuth device flow, which is designed to facilitate secure sign-ins without displaying a full browser. This technique was notably used in previous campaigns, such as EvilTokens, which Microsoft disrupted in September 2026.

Understanding Device Code Phishing

The device code phishing technique involves an attacker initiating a sign-in request and then persuading a victim to approve it. In a controlled lab simulation using GitHub Copilot CLI, Microsoft demonstrated several potential outcomes of such an attack. Once a victim approves a device code request, the attacker can:

  • Steer an active Copilot CLI session remotely, provided the user has enabled remote control and organizational policies permit it.
  • Add misleading entries to the agent’s memory, potentially influencing future interactions.
  • Access synchronized Copilot CLI sessions stored in the cloud, which may contain sensitive information.
  • Gain access to private repositories associated with the affected account.

These outcomes underscore the risks associated with device code phishing, particularly as AI agents become more integrated into development workflows. While these scenarios were demonstrated in a controlled environment, they have not yet been observed in real-world attacks.

Mechanics of the Attack

The attack begins with the attacker initiating a device code sign-in request. The victim receives a legitimate-looking verification link and code, which they are tricked into approving. This social engineering step is critical, as it relies on the victim’s trust in the legitimacy of the request. Once approved, the attacker can complete the sign-in process and operate within the permissions granted to the application.

Microsoft’s simulation revealed that the approval process appears legitimate, as users interact with the actual GitHub site. However, the request may originate from an attacker-controlled client, making it crucial for users to be vigilant about unsolicited requests.

Defensive Measures and Recommendations

To combat the threat of device code phishing, Microsoft recommends several defensive strategies:

  • Educate users to only enter device codes for sign-ins they initiated themselves. Any unexpected requests should be treated as potential phishing attempts.
  • Implement Safe Links policies in Microsoft Defender for Office 365 to protect against malicious links.
  • Regularly review and revoke unexpected OAuth authorizations in GitHub account settings.
  • Utilize Microsoft Defender to gain visibility into GitHub activity and support investigations of suspicious authorization patterns.

By fostering user awareness and employing robust security measures, organizations can better protect themselves against the evolving landscape of phishing threats targeting AI coding agents.

For further insights into these risks and protective measures, Microsoft has detailed their findings and recommendations in their security blog, emphasizing the importance of vigilance in the face of sophisticated phishing tactics.

CHAPTER X // CYBER AWARENESS CAMPAIGN
BEYOND THE BALLROOM
[C://ME] // CHAPTER X

REQUEST THE MEDIA KIT

Tell us where to send the Beyond the Ballroom media deck. Every field is required.

We will use these details to respond to your media-kit request. Privacy Policy

Cyber Warriors Conclave Chapter X — Beyond the Ballroom

Related articles

Recent articles

AI-driven vulnerability discovery accelerates cyber threats, warns Microsoft Perception

A year ago, the process of identifying exploitable vulnerabilities was a labor-intensive task reserved for elite security researchers. However, recent advancements in frontier AI...

AI & Governance Leadership Forum 2026 highlights cybersecurity and governance in Abu Dhabi

The AI & Governance Leadership Forum and Awards 2026, held at The Ritz-Carlton Abu Dhabi, Grand Canal, spotlighted the critical intersection of artificial intelligence...

Sean Cairncross departs as national cyber director amid leadership changes

Sean Cairncross has been removed from his position as the national cyber director, a role he held within the Office of the National Cyber...

Bipartisan lawmakers form AI Safety and Innovation Caucus to address security risks

A bipartisan coalition of over two dozen U.S. House lawmakers has established the AI Safety and Innovation Caucus, aimed at addressing the security risks...