[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fqDD1DTF5mLk28qTvUlyhWoNPoJbeejbv7GQO9jDZFOU":3},{"lesson":4},{"id":5,"slug":6,"article_id":7,"title":8,"body":9,"prevention":10,"framework_refs":11,"framework_notes":17,"status":23,"created_at":24,"published_at":25,"article":26,"tags":30,"podcasts":43,"controls":44},"66639f55-56ca-4385-a0bd-62ef96f8ba4a","device-code-phishing-can-hijack-ai-coding-agents","f32b3095-7e26-4260-bb28-e8d4dcbb667e","Device Code Phishing Can Hijack AI Coding Agents","Researchers demonstrated that the device code authentication flow — designed for input-limited devices — can be weaponized against AI coding agents like GitHub Copilot CLI by tricking users into approving a malicious sign-in request. Once a user approves the phished device code, attackers gain the ability to steer remote sessions, execute arbitrary commands on the victim's machine, manipulate agent memory, and access private repositories. The attack succeeds because device code flows shift authentication approval entirely to the human user, bypassing technical controls and exploiting the trust users place in familiar-looking prompts. This matters because AI coding agents operate with significant privileges — file access, code execution, repository permissions — meaning a single social engineering success can yield deep and persistent access.","**Immediate actions:**\n- Train developers and AI tool users to scrutinize every device code authorization prompt and never approve requests they did not personally initiate.\n- Restrict which OAuth applications and device code flows are permitted within your organization via identity provider (IdP) conditional access policies.\n\n**Long-term improvements:**\n- Adopt phishing-resistant authentication methods (e.g., FIDO2\u002Fpasskeys) for AI agent integrations wherever the platform supports them.\n- Apply the principle of least privilege to AI agent OAuth scopes, limiting access to only the specific repositories and actions each agent genuinely requires.\n- Establish a formal review process for evaluating the authentication mechanisms of any AI tooling before organizational adoption.\n\n**Detection measures:**\n- Enable and monitor audit logs for OAuth token issuances and device code grants across your identity provider and GitHub organization.\n- Alert on anomalous agent behaviors such as unexpected repository access, command execution patterns, or session activity from unfamiliar IP addresses.",[12,13,14,15,16],"MITRE ATT&CK T1528: Steal Application Access Token","NIST SP 800-53 IA-2: Identification and Authentication (Organizational Users)","NIS2 Article 21(2)(j)","Nist CSF 2.0 PR.AA-05: Access permissions, entitlements, and authorizations are defined in a policy, managed, enforced, and reviewed","CIS Control 14: Security Awareness and Skills Training",{"NIS2 Article 21(2)(j)":18,"MITRE ATT&CK T1528: Steal Application Access Token":19,"CIS Control 14: Security Awareness and Skills Training":20,"NIST SP 800-53 IA-2: Identification and Authentication (Organizational Users)":21,"Nist CSF 2.0 PR.AA-05: Access permissions, entitlements, and authorizations are defined in a policy, managed, enforced, and reviewed":22},"This point specifically mandates multi-factor authentication and secured communications, which directly addresses the weak device code approval mechanism that enabled the phishing attack.","The device code phishing technique results in the attacker obtaining a valid OAuth access token for the victim's AI coding agent session, which is precisely what this technique describes.","Because the attack requires the user to approve the malicious device code prompt, human recognition through trained awareness is the critical last line of defense this control addresses.","This control requires the use of multi-factor and phishing-resistant authentication mechanisms; had phishing-resistant MFA been enforced for the device code flow, the social engineering step could not have succeeded.","Applying least-privilege OAuth scopes to AI agent authorizations — a gap exploited here — falls under managing and enforcing access entitlements as this category requires.","published","2026-11-17T17:22:36.511866+00:00","2026-11-17T17:22:36.496+00:00",{"id":7,"url":27,"slug":28,"title":29},"https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fsecurity\u002Fblog\u002F2026\u002F11\u002F17\u002Fthe-risks-of-device-code-authentication-for-ai-coding-agents\u002F","the-risks-of-device-code-authentication-for-ai-coding-agents-636abb","The risks of device code authentication for AI coding agents",[31,37],{"id":32,"name":33,"slug":34,"description":35,"color":36},"1ec88fde-2d0f-4ed8-932a-33f5ccc0fdc7","Access Control","access-control","Excessive privileges, missing MFA, weak auth","#f97316",{"id":38,"name":39,"slug":40,"description":41,"color":42},"7261eb8f-acd4-4d93-a489-7fdd652ec0ea","Security Awareness","security-awareness","Phishing, social engineering, human error","#22c55e",[],[45,49,53],{"slug":46,"name":47,"problem":48},"phishing-resistant-mfa","Phishing-resistant MFA","A stolen password, or a user who taps Approve on a push prompt, is no longer enough to log in.",{"slug":50,"name":51,"problem":52},"identity-threat-detection","Identity threat detection and response (ITDR)","Attackers who log in with real, stolen credentials get noticed.",{"slug":54,"name":55,"problem":56},"ai-security","AI application security","Prompt injection, data leaks through AI tools and unapproved AI use get caught."]