Guide · Agent skill
How to use the Device-Code Phishing Simulation agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains what the attacking-oauth-with-device-code-phishing skill does, how to install it for an AI agent, and how to ask for its help safely. It is written for security professionals running authorized red-team or detection work against Microsoft 365 and Entra ID. By the end you will know the prerequisites, how to trigger the skill with natural requests, and the safety limits that apply.
Quick start
- 1Confirm authorization. Get written authorization and rules of engagement for the target tenant before you install or run anything.
- 2Install the prerequisites. Install Python 3.8 or newer and PowerShell 7 or newer, then add the ROADtools packages and the TokenTactics module.
- 3Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder.
- 4Or upload the ZIP in the Claude apps. In the Claude apps, open Settings → Capabilities → Skills and upload the ZIP.
- 5Review the bundled files. Read SKILL.md, the references folder and scripts/agent.py to understand what the skill will run and which network endpoints it contacts.
- 6Make a scoped request. Describe the authorized engagement, the target tenant and the control you want to test in a natural request.
- 7Document and clean up. Record findings and remediation steps, then securely remove any captured tokens when the engagement ends.
What the skill makes the agent do
The skill gives an AI agent a structured playbook for simulating OAuth 2.0 device-code phishing and illicit consent grant attacks against Microsoft Entra ID. In a device-code attack, a victim is tricked into entering an attacker-generated code on Microsoft's genuine login page, so the tokens are issued to the attacker rather than the victim. The skill covers this flow along with consent-grant phishing and token reuse across Microsoft 365 services.
A bundled Python script implements the device-code flow, so the agent can request codes, poll for tokens and optionally reuse a refresh token. The skill's own text describes the purpose as testing defenses such as MFA enforcement, Conditional Access and token protection, and building detections.
- Simulates device-code phishing against a tenant you are authorized to test
- Covers illicit consent grants, where a malicious app is approved by a user
- Maps the activity to MITRE ATT&CK T1528 (Steal Application Access Token)
- Pairs with the blue-team hunting-saas-sso-token-abuse skill for detection work
How to install the skill
Download the skill ZIP from this page. Then choose one of two install paths. For a personal setup, unzip the folder into ~/.claude/skills/. For a single project, unzip it into the project's .claude/skills/ folder. Either way, the skill folder should contain SKILL.md at its top level.
In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
What you need before running it
The skill has several requirements. Confirm all of them before you start, because the skill runs scripts and makes network calls.
The skill's own legal notice says it should be used only against tenants you own or have explicit written authorization to test, with rules of engagement in place. Unauthorized use is illegal under laws such as the US Computer Fraud and Abuse Act.
- Python 3.8 or newer
- PowerShell 7 or newer, needed for the TokenTactics module
- ROADtools Python packages (roadtools and roadtools_auth) and the TokenTactics PowerShell module from GitHub
- Written authorization and rules of engagement for the target tenant
- A controlled phishing delivery channel approved for the test
- Network access to login.microsoftonline.com and Microsoft Graph
pip install roadtools roadtools_authHow to trigger the skill with natural requests
You do not need special syntax. Describe the authorized engagement and the outcome you want, and mention that the test is sanctioned. The agent should use the skill when your request matches its scope, such as device-code phishing, consent-grant phishing, or validating MFA and Conditional Access against these techniques.
Good requests state the authorization, the target type and the goal. Vague requests about getting into accounts are outside the skill's purpose.
- Help me plan an authorized device-code phishing simulation for our Entra ID tenant. We have signed rules of engagement.
- Check whether our tenant restricts the OAuth device-code flow, and explain what a test would show.
- Build detection ideas for device-code token abuse, using realistic telemetry from an authorized test.
- Review our Conditional Access and token protection settings against illicit consent grants.
- Write remediation recommendations from the findings of our authorized red-team report.
Safety notes on scripts and network access
This skill runs scripts and uses the network. Review the bundled files before use, including scripts/agent.py, and run the skill only from a controlled attacker-simulation host that is isolated from production systems, as your rules of engagement require.
Network traffic goes to login.microsoftonline.com and Microsoft Graph, which are real Microsoft services. Any tokens obtained during a test are real credentials for real accounts, so handle them under your engagement's data-handling rules and revoke or clean up as required.
- Read scripts/agent.py before running anything
- Use only the tenant named in your written authorization
- Keep the test scope and timing inside your rules of engagement
- Store captured tokens securely and delete them at engagement end
Tips for getting useful results
Ask the agent to work from the reference files, which list the endpoints, parameters and standards mappings used in the skill. Ask it to state each assumption and check it against your tenant's configuration.
Pair each simulation with a detection goal. Results are most useful when they produce a clear finding, a control to test, and a telemetry source your blue team can query.
- Name the control you want to test before starting
- Ask for the standards mapping (MITRE ATT&CK and NIST CSF references are included)
- Ask for remediation steps tied to each finding, such as phishing-resistant MFA or token protection
What people use it for
- Testing whether a tenant's Conditional Access policies block device-code sign-ins during an authorized red-team exercise
- Validating that token protection and phishing-resistant MFA limit the impact of a simulated device-code attack
- Generating realistic device-code and consent-grant telemetry so a blue team can build and tune detections
- Reviewing which multi-tenant app consents a tenant allows, as part of an illicit consent assessment
Frequently asked questions
Is the attacking-oauth-with-device-code-phishing skill free to use?
The skill is licensed under Apache-2.0, as stated on this page. Its required tools, including Python, PowerShell, ROADtools and TokenTactics, are separate projects with their own install requirements.
What do I need to install before using this skill?
You need Python 3.8 or newer, PowerShell 7 or newer, the ROADtools packages (roadtools and roadtools_auth), and the TokenTactics PowerShell module from GitHub. You also need network access to login.microsoftonline.com and Microsoft Graph.
Where do I put the skill folder after downloading it?
Unzip it into ~/.claude/skills/ for a personal install, or into a project's .claude/skills/ folder for a project install. In the Claude apps, you can upload the ZIP under Settings → Capabilities → Skills.
Can I use this skill against any Microsoft 365 account?
No. The skill is intended only for tenants you own or have explicit written authorization to test. Using it against other people's accounts is illegal under laws such as the Computer Fraud and Abuse Act.
What should I do if the skill does not load or run?
Check that the unzipped folder has SKILL.md at its top level and that it sits in one of the two skill folders. Confirm that Python, PowerShell and the ROADtools and TokenTactics installs are present, and that your host can reach the required Microsoft endpoints.
How does this compare with defensive identity guidance?
This skill is offensive tradecraft for authorized testing, not general account security help. For defensive guidance, look for material on hardening Conditional Access, token protection and phishing-resistant MFA, or use the blue-team hunting-saas-sso-token-abuse skill that the source links to.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits authorized red teams, security engineers testing Conditional Access and token protection, and blue teams who need realistic device-code telemetry, all working under written rules of engagement. It is a poor fit for anyone without written authorization for the target tenant, for general users seeking account security help, or for tasks unrelated to red-team or detection work.
Download the skill