Practical AI
Practical AI

Threat modeling LLM apps

If you have questions at the intersection of Cybersecurity and AI, you need to know Donato at WithSecure! Donato has been threat modeling AI applications and seriously applying those models in his day-to-day work. He joins us in this episode to discuss his LLM application security canvas, prompt inj

Featured Speakers

Donato Capitella Guest

Topics Discussed

Episode Summary

Executive Summary: Practical AI explores how to secure applications built with large language models (LLMs), featuring WithSecure security consultant Donato Capitella. He argues that security depends on the application’s use case—not whether a model is “secure”—and recommends threat modeling, validating inputs and outputs, limiting agent permissions, and monitoring for abuse. The episode also briefly introduces AssemblyAI’s speech-AI API and its developer use cases.

Main Topics: Threat-model the application, not the model: Capitella says asking whether an LLM is secure in isolation is misleading. Builders should identify the use case, data and “crown jewels” at risk, user-controlled inputs, attacker capabilities, and potential victims to understand how the complete application could be abused. Validate LLM inputs and outputs: The security canvas described in the interview emphasizes controls at both ends of the model. Output checks can screen harmful content, enforce expected formats, and block risky URLs, Markdown, HTML, or code. Input checks can assess topic, prompt-injection attempts, length, character set, language, and data provenance. Treat model responses and agent actions as untrusted: LLM output may be inaccurate or attacker-influenced, so neither users nor businesses should act on it blindly. This is especially important when an agent can use tools, browse websites, or perform actions: require human approval or downstream checks for consequential operations. Use layered, use-case-specific defenses: Capitella cautions against relying only on another LLM to judge an LLM. Traditional classifiers, rules, reputation checks, domain and URL analysis, and constrained workflows can be faster and less exposed to prompt injection. Narrowly defined tasks may benefit from decision-tree-like boundaries. Monitor for abuse and respond to repeated signals: Input and output filters are not enough. Applications should send high-fidelity, context-rich events to security monitoring systems and define responses—such as stopping an account—when a user repeatedly triggers safeguards. Protect infrastructure and sensitive conversation data: Self-hosted models still need conventional protections for privileged access, authentication, and infrastructure. Capitella stresses that stored conversations and application data may be more valuable targets than model weights, making their location and protection important. Speech AI creates new opportunities for developers: The opening segment describes AssemblyAI’s API for converting live or recorded audio into transcripts and extracting information such as summaries, entities, personally identifiable information, and speaker identities. The guest points to growing volumes of audio across meetings, calls, podcasts, videos, and messages.

Key Arguments: Security is a property of the end-to-end use case, not an intrinsic yes-or-no property of an LLM. The threat model depends on what data the system receives, what resources it can access, and what actions it can take. Model outputs must be treated as untrusted. A malicious prompt can induce output that causes harm when rendered or acted upon—for example, a Markdown image URL could cause a browser to transmit sensitive information. Prompt-injection detection and alignment cannot be assumed to eliminate risk. The range of possible inputs and outputs is vast, and more capable models can create a larger attack surface; layered defenses and limits on permissions remain necessary. Security controls should fit the task. Traditional NLP classifiers, rules, provenance and domain checks, format restrictions, and constrained decision flows can complement or replace LLM-based judging. Monitoring must lead to action. Repeated safeguard triggers can indicate an attack; application-level alerts should provide context to the SOC and support responses such as disabling or pausing an account. Autonomous agents amplify consequences because tool access and permission to act can turn prompt injection into data theft or unauthorized activity. Human approval and downstream validation are important for tool use.

Data Points: Speech-AI infrastructure reach: 30+ regions on six continents - Fly.io sponsor message, not a statistic about the security discussion. AssemblyAI starter offer: $50 credit - Promotional offer mentioned in the opening AssemblyAI segment. Guest’s time since university machine-learning coursework: 12–13 years - Capitella contrasts his earlier university experience with the capabilities he encountered using ChatGPT. Illustrative input volume for an LLM: About 50,000 tokens - Capitella uses this approximate scale to explain why the possible behavior space makes comprehensive alignment difficult. Illustrative token vocabulary: Over 100,000 tokens - A rough figure used in his explanation of the combinatorial scale of possible LLM outputs. Illustrative LLM behavior-space calculation: 50,000 to the power of 100,000 - Capitella’s illustrative expression for possible token sequences; not presented as a measured model statistic. Example of a Rubik’s Cube configuration count: About 43 quintillion combinations - Used as a comparison to convey the much larger scale of the proposed LLM output space. Example monitoring threshold: Four input checks within one minute - The host and guest discuss this as an example of an application-level alert that could flag suspicious activity, not a universal threshold. Estimated attacks stopped by controls: Maybe 80% - Capitella gives this as an illustrative estimate while arguing that monitoring is still needed for attacks that pass input and output checks.

Pivotal Quotes: "Don't ask if the knife or the LLM is safe. Ask if you're using the knife or the LLM for your use case in a secure way." — Donato Capitella: His central framing: assess the security of the system and its intended use rather than the model in isolation. "We don't trust anything the LLM produces." — Donato Capitella: A foundational principle for deployment: outputs need review and controls before they are displayed or acted upon. "If you don't add monitoring and automated actions which are relevant to your use case, you're really doing nothing." — Donato Capitella: He argues that filters must be paired with contextual monitoring and defined responses to repeated suspicious behavior.

Implications: Organizations should secure LLM applications as complete systems: map sensitive data and permissions, validate inputs and outputs with layered controls, constrain agent actions, and feed contextual alerts into security operations. Speech-AI APIs likewise expand what developers can build from audio, while making responsible handling of extracted data important.

🔓 Sign Up for Unlimited Episode Search

About Practical AI

View all episodes from Practical AI