TUI, a large travel organization, addressed the challenge of scaling threat modeling across 100+ digital product teams with limited security engineers by developing an AI-powered system. This article details the serverless architecture built on Amazon Bedrock, AWS Lambda, and other AWS services, enabling automated, consistent, and significantly faster security assessments. The solution highlights an iterative design process, particularly around intelligent knowledge base selection and agentic threat generation.
Read original on AWS Architecture BlogTUI faced a significant bottleneck in their security assessment process: a small security team (four engineers) attempting to manually threat model for over 100 product teams. Each manual session was time-consuming (4-6 hours) and inconsistent, leading to a large backlog. To address this, TUI developed an automated threat modeling system leveraging generative AI, specifically Amazon Bedrock with Anthropic's Claude Sonnet 4.5.
The core of TUI's solution is a serverless architecture deployed on AWS, designed to extend AWS Threat Designer with TUI-specific capabilities. This system replaces manual reviews with an automated workflow that consistently applies TUI's security standards. Key components include:
Agentic Workflows for Complex Tasks
This architecture demonstrates a powerful pattern for integrating generative AI into complex workflows. Instead of relying on a single-pass LLM interaction, an "agentic workflow" breaks down the problem into smaller, manageable steps. The agent uses a set of defined tools (e.g., add threats, delete threats, run gap analysis) and autonomously decides the order of operations, mimicking human problem-solving and allowing for iterative refinement.
A crucial learning in TUI's development journey was the optimization of how the LLM interacts with the security standards knowledge base. Initially, loading all 192 standards (338 KB) directly into the prompt failed due to token limits and model confusion from excessive context.
The breakthrough involved a metadata-driven approach. Instead of the full documents, lightweight metadata (keywords, component types, STRIDE categories, relevance scores) for each standard was generated. At runtime, the LLM reviews this 60 KB metadata to select only the ~16 most relevant standards (21 KB of content) for a given architecture, achieving a 94% context reduction. This intelligent selection ensures the model receives focused, relevant information, improving accuracy and reducing costs.
Within the agentic workflow, the "threat generation" node employs a "Reason and Act" pattern using a LangGraph subgraph. The agent uses tools to add, delete, and analyze threats. It initially generates threats using STRIDE, then iteratively refines them against TUI standards, assigning likelihood/impact scores and suggesting mitigations with approved tools. A built-in "tool budget" forces the agent to perform a gap analysis after a set number of generations, preventing infinite loops and ensuring a comprehensive review process, mirroring how human experts work.