codex mcp login opens your browser for the SecureFlag sign-in and stores the resulting credentials securely; refreshes happen automatically. On the authorization screen, select the scopes to grant (threat modeling and/or training) so the assistant only gets the access you intend.
Usage Examples
The prompts below work the same way in any connected assistant. Phrase them in your own way, and the assistant will select the right SecureFlag tools.
Manage Threat Models
Create a threat model from your repository
With your coding agent open, ask:
Create a SecureFlag threat model of this application.
The assistant explores the repository, identifies the components and how they connect, and sends that description to ThreatCanvas. For example, it might identify a React front end, a Spring Boot API, a PostgreSQL database, and an S3 bucket, along with context you provide such as whether it's internet-facing or handles personal data.
ThreatCanvas analyzes the scenario asynchronously. The assistant reports that the model was created, re-checks it until the analysis is complete, then summarizes the identified threats and recommended controls for each component, with a direct link to open the model in ThreatCanvas.
Keep the model in sync as the code evolves
Threat models drift when the architecture changes; with the MCP server connected, updating the model is part of the same conversation as the code change:
We received pull request #203 (branch feature/redis-cache) to add a cache mechanism - investigate the changes and update the threat model accordingly.
The assistant sends only the incremental change; ThreatCanvas merges the new component into the existing diagram and re-derives the affected data flows, threats, and controls. Your existing risk assessments are preserved.
Review the risks in a model
Ask about the current state at any time:
What are the highest risks in our threat model, and are the controls on the API component implemented?
The assistant retrieves a compact summary of the model, including threats and controls grouped by component and trust boundary, plus the data flows between them, and answers from it. You can also ask questions across models, such as “Which of my threat models has the highest risk score?”
Create a model for a teammate (admins)
Create a model on behalf of a teammate (admins). Administrators can create a model on behalf of another user, who becomes its owner from the start:
The model is created directly under the named user, who must be an active member of the same organization. Ownership can only be set this way at creation time; if the request isn't permitted, the model is still created (owned by you), and the assistant explains exactly why.
Get Contextual Training
Train for the feature you are about to build
Before starting a security-sensitive task, ask for the training that matches it:
I have to implement an image upload functionality. Which SecureFlag training should I take first?
The assistant recognizes the security topics the task involves and knows your project's technology and framework, so the recommendations are matched to your stack. They include knowledge-base articles and relevant hands-on labs, weighted toward the categories where your recent training accuracy is lowest, with each provided as a direct link to the SecureFlag platform.
Turn threat-model risks into a training plan
Combine both products in one prompt:
Take the top three risks from our threat model and recommend SecureFlag training for each.
The assistant reads the model, extracts the highest-rated threats, and requests training recommendations topic by topic. The result is a ready-made, prioritized practice plan grounded in your actual architecture.
Recommend training for a teammate (admins)
Administrators can personalize recommendations for someone else:
Recommend XSS training for jane.doe@acme.com (she will work on this project React front end)
The recommendations are weighted by that user's training history instead of yours, so they prioritize the areas where the teammate needs the most practice.
Tips & Troubleshooting
- Threat modeling is asynchronous: Model creation and updates can take some time; the assistant re-checks the model and reports when the results are in. If it presents results as pending, ask it to check again.
- Permission errors: A message like "This tool requires the 'threat-models:write' scope" means your SecureFlag account doesn't grant that permission. Ask your administrator.
- Authentication expired or rejected: Sign in again: in Claude Code, open /mcp and re-authenticate the SecureFlag server; in Codex, run codex mcp login secureflag.
- Be specific in prompts: The best models come from prompts that state the deployment context the code can't show, such as whether the system is internet-facing and whether it handles payment, personal, or health data.
With the MCP server connected, valuable training and threat modeling becomes part of the development process. The agents building in your SDLC code keeps the threat model and your security training in step with it.