Threat Designer is an AI-driven agent that automates and streamlines the threat modeling process for secure system design. Harnessing the power of large language models (LLMs), it analyzes system architectures, identifies potential security threats, and generates detailed threat models—empowering developers and security professionals to incorporate security from the earliest stages of development.
- 📖 Read the AWS Blog Post
- ⭐ Star this repo to support the project
- 📚 Getting started Guide
- 💻 CLI Quick Start — no deployment needed, runs fully local
- 📘 Code Wiki
Want to run threat modeling without deploying any AWS infrastructure? The Threat Designer CLI lets you generate STRIDE-based threat models entirely on your local machine, using only your existing Amazon Bedrock or OpenAI credentials.
pip install ./cli
threat-designerSee the CLI Quick Start guide to get up and running in minutes.
- Architecture Analysis - Submit up to 3 architecture diagrams per submission and analyze for threats
- Interactive Editing - Update threat modeling results via the user interface
- Iterative Refinement - Replay threat modeling based on your edits and additional input
- Multiple Export Formats - Export results in PDF, DOCX, or JSON format
- AI Assistant (Sentry) - Interact with a built-in assistant to dive deep into threat models
- Spaces - Attach a knowledge base of your own documents (runbooks, policies, diagrams) to enrich threat modeling with organization-specific context
- Threat Catalog - Explore and manage past threat models
AWS Services Used:
- AWS Amplify
- Amazon API Gateway
- Amazon Cognito
- AWS Lambda
- Amazon Bedrock AgentCore Runtime
- Amazon Bedrock Knowledge Bases
- Amazon OpenSearch Serverless
- Amazon DynamoDB
- Amazon S3
Required Tools:
The following tools must be installed on your local machine:
- Node.js (v18 or later) and npm
- curl
- jq
- Python (v3.12 or later) and pip
- Terraform CLI
- Docker running
- AWS CLI configured with appropriate credentials
AI Model Provider:
Threat Designer supports two AI providers. Choose one based on your preference:
You must enable access to the following models in your AWS region:
- Claude Opus 5
- Claude Sonnet 5
- Claude Haiku 4.5
To enable Claude models, follow the instructions here. Make sure you are already subscribed to the models otherwise you will receive an AccessDeniedException exception whe using the application.
Note: If deploying in a non-US region, verify the inference profile ID for your region. See Supported Regions and models for inference profiles.
You'll need:
- A valid OpenAI API key
- Access to the GPT-5.6 family models (Sol, Terra, Luna)
You'll be prompted to enter your API key during deployment.
The same GPT-5.6 family models served through the Bedrock Mantle OpenAI-compatible endpoint — no OpenAI API key required. Authentication uses SigV4-derived bearer tokens minted from the agent's IAM role.
Warning: GPT-5.x on Bedrock Mantle is only served from US regions. Model inference is locked to
us-east-2(configurable tous-west-2via themantle_regionTerraform variable), regardless of the region you deploy the application to.
- Clone the Repository
git clone https://github.com/awslabs/threat-designer.git
cd threat-designer- Make the deployment script executable:
chmod +x deployment.sh- Export AWS credentials
# Option I: Export AWS temporary credentials
export AWS_ACCESS_KEY_ID="your_temp_access_key"
export AWS_SECRET_ACCESS_KEY="your_temp_secret_key"
export AWS_SESSION_TOKEN="your_temp_session_token"
export AWS_DEFAULT_REGION="your_region"
# Option II: Export AWS Profile
export AWS_PROFILE="your_profile_name"- Run the deployment:
./deployment.shDuring deployment, you'll be prompted to:
- Select your AI model provider (Amazon Bedrock, OpenAI, or Bedrock Mantle)
- Enter your OpenAI API key (if using OpenAI)
- Provide a valid email address for user credentials
- Choose whether to enable Sentry AI Assistant
- Select a web search provider for Sentry (none, Tavily, or Amazon Bedrock AgentCore)
Note: A user will be created in Amazon Cognito User Pool and temporary credentials will be sent to the configured email address.
After successful deployment, you can find the Login URL in the output:
Application Login page: https://dev.xxxxxxxxxxxxxxxx.amplifyapp.comThreat Designer supports three AI provider options that can be selected during deployment:
Select AI model provider:
1) Amazon Bedrock (Claude) (default)
2) OpenAI (GPT-5.6)
3) Amazon Bedrock Mantle (GPT-5.6, no OpenAI API key needed)
Used Models:
- Claude Opus 5 — main threat modeling workflow
- Claude Sonnet 5 — Sentry assistant and structured output
- Claude Haiku 4.5 — summaries
Key Characteristics:
- Reasoning: Adaptive thinking (Claude 5 family)
- Reasoning Levels: Low, Medium, High, Extra High (maps to adaptive effort levels; token budgets remain only for pre-4.6 models)
Note: Models listed in the
adaptive_thinking_modelsTerraform variable (e.g., Claude Opus 5, Claude Sonnet 5) use adaptive thinking with effort levels instead of token budgets. For these models, thereasoning_budgetconfiguration is ignored — the reasoning level from the UI is mapped directly to an effort string. Pre-4.6 models continue to use token-budget-based reasoning as before.Note: The highest selectable level (Extra High) maps to
xhigh, the recommended effort for demanding coding and agentic work. The models also supportmaxabove it, but it costs substantially more for marginal gains — opt in per stage by setting"4" = "max"in that stage'seffort_mapininfra/variables.tf.Note: There is no "off" reasoning level. Every current model is a reasoning model, and on Claude Opus 5 thinking is on by default and cannot be disabled above effort
high— omitting the thinking config does not turn it off, it just runs adaptive thinking at the provider's default effort. An "off" level therefore billed for thinking while discarding the reasoning output, so the ladder starts at Low. Levels are1–4; a legacy0from an older client is accepted and normalized to1.Note: Claude 5 family models support a maximum output of 128K tokens, while older Claude 4.x models may support less. If switching between models, make sure to update the
max_tokensconfiguration accordingly to avoid API errors.
Used Models:
- GPT-5.6 Sol — main threat modeling workflow (flagship capability; the
gpt-5.6alias routes to it) - GPT-5.6 Terra — Sentry assistant and structured output (strong performance at lower price)
- GPT-5.6 Luna — summaries (efficient, high-volume workloads)
Key Characteristics:
- Reasoning: Reasoning models on the Responses API
- Reasoning Levels: Low, Medium, High, Extra High (maps to OpenAI's
reasoning_effort:low,medium,high,xhigh). GPT-5.6 also supportsmaxabovexhigh— opt in viareasoning_effortininfra/variables.tf— and no longer acceptsminimal.
To use OpenAI:
- Select option
2when prompted for model provider during deployment - Enter your OpenAI API key when prompted
- The system will configure both Threat Designer and Sentry to use OpenAI
Runs the same GPT-5.6 models (and prompts) as the OpenAI option, but served by the Bedrock Mantle OpenAI-compatible endpoint:
- No OpenAI API key — auth is a SigV4-derived bearer token minted from the agent's IAM role (
bedrock-mantle:*permissions are granted automatically at deploy time) - US-locked inference — Mantle serves GPT-5.x only from
us-east-2/us-west-2; the deployment shows a warning and defaults tous-east-2(override with themantle_regionTerraform variable) - Model IDs are automatically prefixed with
openai.(e.g.,openai.gpt-5.6-sol) as Mantle requires
To use Bedrock Mantle:
- Select option
3when prompted for model provider during deployment - The system will configure both Threat Designer and Sentry to use GPT-5.6 via Mantle
To switch between Amazon Bedrock and OpenAI:
- Redeploy the solution using
./deployment.sh - Select a different provider when prompted
Important: Existing conversation sessions from one provider cannot be continued with a different provider. You'll need to start new threat modeling sessions after switching.
Sentry can perform real-time web searches to research CVEs, vulnerabilities, and security topics. This feature is optional, and you choose the provider at deployment time.
During deployment, you will be prompted:
Select web search provider for Sentry:
1) None (default)
2) Tavily (search + page extraction, requires an API key)
3) Amazon Bedrock AgentCore (search only, no API key needed)
| Provider | Tools Sentry gains | Credentials |
|---|---|---|
| None | — | — |
| Tavily | tavily_search + tavily_extract |
Tavily API key |
| Bedrock AgentCore | web_search only |
None — SigV4 from the Sentry execution role |
Note: The AgentCore connector offers search only — there is no page-extraction counterpart. When it is selected the extract tool is simply absent, and Sentry's prompt is adjusted so it works from result snippets and does not offer to read a page in depth. Choose Tavily if you need full page content.
AgentCore's web search is reachable only as a built-in connector target on an AgentCore Gateway (there is no direct search API), so selecting it provisions a gateway with AWS_IAM inbound auth plus its service role, and Sentry calls it over MCP signed with SigV4 from its own execution role. No API key is stored anywhere.
Warning: The connector is only offered in
us-east-1,eu-west-1, andap-northeast-1. The gateway is created inweb_search_region(defaultus-east-1), which may differ from your deployment region — queries are served inside AWS but can leave the deployment's region. Tune result volume with theweb_search_max_resultsTerraform variable (1–25, default 5).
- Sign up at tavily.com
- Navigate to your dashboard to get your API key
- Keys start with
tvly-prefix
When enabled, Sentry can:
- Search for CVEs and vulnerability information
- Research threat intelligence and attack techniques
- Look up technical security documentation
- Extract content from security advisories and research papers
Web search is focused on security-related topics and will not search for general information, people, or organizations.
Sentry is an AI-powered assistant that helps you analyze and explore threat models through conversational interaction. This feature is optional and can be enabled or disabled during deployment.
When you run ./deployment.sh, you will be prompted:
Enable Sentry AI Assistant? (y/n, default: y)
- Enable (y): Deploys the full Sentry infrastructure including Amazon Bedrock AgentCore Runtime, DynamoDB session table, and ECR repository. The Assistant drawer will be available in the UI.
- Disable (n): Skips Sentry infrastructure deployment. The Assistant drawer will be hidden from the UI, and core threat modeling features will continue to work normally.
To disable Sentry:
- Update the
.deployment.configfile in the project root:
ENABLE_SENTRY=false- Redeploy the solution
To enable Sentry:
- Update the
.deployment.configfile in the project root:
ENABLE_SENTRY=true- Redeploy the solution
Threat Designer supports two methodologies, selectable per threat model:
- STRIDE (default) — classifies threats by kind: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege.
- MAESTRO — the Cloud Security Alliance's agentic AI threat modeling framework. Classifies threats by where they sit in the agentic stack across seven layers, and is the better fit for systems built around agents, tools and multi-agent collaboration.
Existing threat models are unaffected — they remain STRIDE, and a model's methodology is fixed once created so a catalog is never classified along two axes at once.
MAESTRO is enabled by default. To disable it, update the .deployment.config file in the project root and redeploy:
ENABLE_MAESTRO=falseWhen disabled, the API rejects new requests that ask for MAESTRO rather than silently falling back to STRIDE. Replaying or versioning an existing MAESTRO model is unaffected by the flag — its methodology is fixed at creation and is loaded from the stored record either way, so disabling MAESTRO doesn't strand catalogs created while it was on. STRIDE threat modeling is unaffected either way.
-
Empty the Architecture Bucket, following instructions here
-
Make the destroy script executable:
chmod +x destroy.sh- Export AWS credentials
# Option I: Export AWS temporary credentials
export AWS_ACCESS_KEY_ID="your_temp_access_key"
export AWS_SECRET_ACCESS_KEY="your_temp_secret_key"
export AWS_SESSION_TOKEN="your_temp_session_token"
export AWS_DEFAULT_REGION="your_region"
# Option II: Export AWS Profile
export AWS_PROFILE="your_profile_name"- Execute the script:
./destroy.shThe frontend has a Playwright suite that runs the app against a fully mocked
backend — no AWS, Cognito, or Bedrock required. VITE_E2E_MOCK=true swaps
Amplify auth for a mock module (src/e2e/amplifyAuthMock.js) and Playwright
intercepts every business API call.
bun install
bunx playwright install chromium # one-time browser download
bun run test:e2e # full suite, headless (~24s)
bun run test:e2e:headed # visible browsers
bun run test:e2e:ui # interactive runner
bun run test:e2e -- e2e/tests/wizard # scope to one suitePlaywright auto-boots bun run dev:e2e on port 5173 — no need to start the
dev server separately. The HTML report opens with
open playwright-report/index.html after a run. See
e2e/README.md for the harness details and how to add
suites.
See CONTRIBUTING for more information.
This library is licensed under the Apache License. See the LICENSE file.

