This article outlines a comprehensive threat model for Large Language Model (LLM) applications, emphasizing the unique security challenges arising from LLMs' unified processing of instructions and data. It maps common vulnerabilities across the LLM pipeline, from input to output and supply chain, and distinguishes between model-centric and agent-centric attacks to guide effective defense strategies.
Read original on ByteByteGoThe core security challenge in LLM applications stems from the model's inability to distinguish between instructions and data, processing both as a single sequence of tokens. This contrasts sharply with traditional software like parameterized database queries, where code and data are structurally separated. This fundamental property leads directly to prompt injection vulnerabilities, where malicious instructions can be embedded in user input or retrieved content, altering the model's intended behavior.
The article presents an attack surface map aligned with the OWASP Top 10 for LLM Applications, illustrating how threats manifest across the LLM pipeline:
Prompt Injection Explained
Prompt injection occurs when instruction-like text is supplied to an LLM, causing the model to prioritize these instructions over the operator's intent. This can happen directly through chat input or indirectly via retrieved content (e.g., malicious email in an inbox being summarized by Copilot).
The most significant risk for LLM applications lies in
An agent with all three capabilities can be directed by injected instructions to exfiltrate private data to an attacker. Mitigating this risk usually involves removing one of these capabilities, with restricting outbound channels or narrowing data access often being the most cost-effective strategies.
While model-level attacks (e.g., model theft, training-data extraction, poisoning) are real, they are often expensive and may be mitigated by model providers for most users. For teams hosting open models or fine-tuning sensitive data, these become critical. However, for many, the greater immediate risk lies in attacks exploiting an agent's excessive agency, which are more common and can lead to direct material damage.