Skip to content

Threat Designer is a GenerativeAI application designed to automate and streamline the threat modeling process for secure system design.

License

Notifications You must be signed in to change notification settings

awslabs/threat-designer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Threat Designer Logo

Threat Designer: AI-powered threat modeling for secure system design

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.


🚀 Try It Now - Lightning Mode

Experience Threat Designer instantly in your browser - no deployment required!

Launch Lightning Mode →

Lightning Mode provides:

  • ✅ Core AI-powered threat modeling
  • ✅ Instant access - runs entirely in your browser
  • ✅ Perfect for evaluation and quick threat assessments
  • ✅ No AWS account or infrastructure needed

📖 Lightning Mode Quick Start Guide


Quick Links


Features

  • Architecture Analysis - Submit architecture diagrams 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
  • Threat Catalog - Explore and manage past threat models
sign in wizard processing sentry sentry sentry threat catalog

Architecture

Solution Architecture

solutions_diagram

AWS Services Used:

  • AWS Amplify
  • Amazon API Gateway
  • Amazon Cognito
  • AWS Lambda
  • Amazon Bedrock AgentCore Runtime
  • Amazon DynamoDB
  • Amazon S3

Agent Logic Flow

Threat Designer Agent Flow


Getting Started

Prerequisites

Required Tools:

The following tools must be installed on your local machine:

AI Model Provider:

Threat Designer supports two AI providers. Choose one based on your preference:

Option 1: Amazon Bedrock (Default)

You must enable access to the following models in your AWS region:

  • Claude 4.6 Opus
  • Claude 4.5 Sonnet
  • Claude 4.5 Haiku

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.

Option 2: OpenAI

You'll need:

  • A valid OpenAI API key
  • Access to GPT-5.2 or GPT-5 Mini models

You'll be prompted to enter your API key during deployment.

Installation and Deployment

  1. Clone the Repository
git clone https://github.com/awslabs/threat-designer.git
cd threat-designer
  1. Make the deployment script executable:
chmod +x deployment.sh
  1. 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"
  1. Run the deployment:
./deployment.sh

During deployment, you'll be prompted to:

  • Select your AI model provider (Amazon Bedrock or OpenAI)
  • Enter your OpenAI API key (if using OpenAI)
  • Provide a valid email address for user credentials
  • Choose whether to enable Sentry AI Assistant

Note: A user will be created in Amazon Cognito User Pool and temporary credentials will be sent to the configured email address.

Accessing the Application

After successful deployment, you can find the Login URL in the output:

Application Login page: https://dev.xxxxxxxxxxxxxxxx.amplifyapp.com

Configuration Options

AI Model Provider Selection

Threat Designer supports two AI providers that can be selected during deployment:

Select AI model provider:
1) Amazon Bedrock (Claude) (default)
2) OpenAI (GPT-5.2)

Amazon Bedrock Configuration (default model)

Used Models:

  • Claude 4.X family models

Key Characteristics:

  • Reasoning: Hybrid model
  • Reasoning Levels: None, Low, Medium, High, Max (maps to different reasoning token budgets or adaptive effort levels)

Note: Models listed in the adaptive_thinking_models Terraform variable (e.g., Claude Opus 4.6) use adaptive thinking with effort levels (low, medium, high, max) instead of token budgets. For these models, the reasoning_budget configuration is ignored — the reasoning level from the UI is mapped directly to an effort string. Standard models continue to use token-budget-based reasoning as before.

Note: Claude Opus 4.6 supports a maximum output of 128K tokens, while other Claude 4.x family models support up to 64K tokens. If switching between models, make sure to update the max_tokens configuration accordingly to avoid API errors.

OpenAI Configuration

Used Models:

  • GPT-5 Mini (default) - Faster and more cost-effective
  • GPT-5.2 - Maximum reasoning capability

Key Characteristics:

  • Reasoning: Always enabled (built-in capability that cannot be disabled)
  • Reasoning Levels: Low, Medium, High (maps to OpenAI's reasoning effort)

To use OpenAI:

  1. Select option 2 when prompted for model provider during deployment
  2. Enter your OpenAI API key when prompted
  3. The system will configure both Threat Designer and Sentry to use OpenAI

Switching Between Providers

To switch between Amazon Bedrock and OpenAI:

  1. Redeploy the solution using ./deployment.sh
  2. 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.

Web Search Integration (Optional Feature)

Sentry can perform real-time web searches to research CVEs, vulnerabilities, and security topics using Tavily. This feature is optional and requires a Tavily API key.

Enabling Web Search

During deployment, you will be prompted:

Enter your Tavily API key (optional, press Enter to skip):
(Enables web search and content extraction in Sentry assistant)
  • With API key: Sentry gains access to tavily_search and tavily_extract tools for real-time security research
  • Without API key: Sentry works normally but cannot perform web searches

Getting a Tavily API Key

  1. Sign up at tavily.com
  2. Navigate to your dashboard to get your API key
  3. Keys start with tvly- prefix

Web Search Capabilities

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 AI Assistant (Optional Feature)

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.

Enabling/Disabling Sentry 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.

Toggling Sentry in Existing Deployments

To disable Sentry:

  1. Update the .deployment.config file in the project root:
ENABLE_SENTRY=false
  1. Redeploy the solution

To enable Sentry:

  1. Update the .deployment.config file in the project root:
ENABLE_SENTRY=true
  1. Redeploy the solution

Clean Up

  1. Empty the Architecture Bucket, following instructions here

  2. Make the destroy script executable:

chmod +x destroy.sh
  1. 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"
  1. Execute the script:
./destroy.sh

Contributing

See CONTRIBUTING for more information.

License

This library is licensed under the Apache License. See the LICENSE file.