Key Insights
Large language models do not enforce a security boundary between instructions and data inside a prompt, the UK National Cyber Security Centre wrote in its December 2025 post arguing that prompt injection may never be mitigated the way parameterized queries mitigated SQL injection. AI application security is the discipline of protecting software that uses AI models, from the first design review through production runtime.
AI application security covers the application code plus the model, its system prompts, the training and retrieval data it draws on, the tools it can call, and the identity it runs as. It differs from traditional application security because the attack surface includes model behavior rather than code alone, adding adversarial testing and runtime monitoring to static and dynamic scanning.
This guide shows where AI application security controls sit from design through runtime, which runtime controls carry the most weight, and how responsibility splits across application security, platform engineering, data science and security operations.
What Does AI Application Security Protect?
AI application security protects the code and every asset the model touches. Some of those assets sit inside the model's boundary, while others extend into every system the application can reach.

Model, Prompt and Data Layers
Model weights and inference endpoints are assets in their own right. NIST SP 800-218A adds a task to protect model weights and configuration parameters from unauthorized access and modification, recommending least-privilege access, cryptographic hashes and digital signatures.
Other asset classes sit alongside the weights, each with its own failure mode:
System Prompts: Attackers may tamper with prompts as readily as with models or data, and documenting prompts alongside models and datasets keeps every change traceable.
Training and Retrieval Data: Datasets need verification before ingestion and signing at ingest. Retrieval corpora need a harder look, because once anyone beyond a trusted engineering team can add documents through shared drives, tickets, crawls or uploads, the ingestion pipeline is an attack surface.
Third-Party Models: Common serialization formats can execute code when a file loads, which makes imported models and serialized weights untrusted third-party code that needs scanning and sandboxing.
Formats that store weights without executable content, model signing and machine learning bills of materials give teams ways to check what they load.
Agents, Tools and Runtime Identity
Tools and credentials set how far an AI application can reach. Each tool an agent calls, whether an API, a database or a code runner, turns model output into an action in another system. The Model Context Protocol (MCP) standardizes those connections, and its specification forbids token passthrough: an MCP server must not accept tokens that were not explicitly issued for it. Tool poisoning is the matching risk, where instructions hide in the tool descriptions the model reads.
The identity an application runs as defines its blast radius. Each agent works better with its own identity, distinct from humans and from individual systems, and the API keys, OAuth grants and sessions available to that agent count as part of what it could misuse.
NIST AI 100-2 E2025 groups generative AI attacks into poisoning, direct prompting and indirect prompt injection, and states that many adversarial machine learning mitigations are empirical and lack theoretical or provable guarantees. The wider set of common AI security vulnerabilities includes retrieval poisoning and model extraction.
How Is AI Application Security Different From Traditional AppSec?
AI applications behave probabilistically and take instructions from data, which changes both what attackers target and how defenders test. Traditional application security (AppSec) looks for flaws in code that a scanner or tester can locate. AI outputs are typically non-deterministic, meaning the same input can produce different behavior, and a prompt injection weakness lives in how instructions and untrusted content combine at runtime, not in a line of code.
Static application security testing (SAST) and dynamic application security testing (DAST) still matter for the code around the model, and tools for application security posture management aggregate those findings. Teams keep those controls and add new ones at each layer:
Dimension | Traditional AppSec | AI application security |
Attack surface | Code, dependencies, APIs | Adds models, prompts, retrieval data, agent tools, runtime identity |
Testing methods | SAST, DAST, periodic pentests | Adds adversarial prompts, AI red teaming, model scanning |
Runtime controls | Authentication, input validation, logs | Adds output handling, tool scoping, human approval, behavioral baselines |
The additions depend on model behavior instead of fixed code, and most of them run continuously instead of once per release.
Where Does AI Application Security Apply Across the Lifecycle?
AI application security applies at every stage, and NIST SP 800-218A extends the Secure Software Development Framework with AI-specific practices for each one. Those practices map to each stage:
Design and Threat Modeling: Assess the impact on the system, its users and the organization if an AI component is compromised or behaves unexpectedly, and run due diligence on any external model provider's security posture.
Build and Dependency Checks: Protect training and fine-tuning data, analyze it for signs of poisoning before use, track its provenance, and monitor training pipelines and model registries.
Pre-Release Testing: Tie release to security evaluation such as benchmarking and red teaming, spanning model evaluation, implementation testing and runtime behavior analysis.
Runtime Monitoring: Measure outputs for sudden and gradual behavior changes, and log inputs such as prompts and queries for audit and investigation.
Testing cadence is where AI work departs most from an annual penetration test. Changes to data, models or prompts alter system behavior without any code change. A point-in-time pentest captures one version of a moving system, while continuous red teaming re-tests each model, prompt or tool update.
Which Runtime Controls Matter Most for AI Applications?
The controls that carry the most weight limit what enters the model, what leaves it and what the application can do with the result. Content filtering alone will not stop every injection, which is the argument for deterministic safeguards that constrain the system's actions instead of its inputs. Input, output and tool controls set those boundaries, and logging shows whether the application stays inside them.

Input, Output and Tool Access Controls
Input checks reduce the chance that crafted content reaches the model in usable form, and matter most where instructions arrive inside retrieved documents, web pages or tool responses, the main route for indirect prompt injection attacks. Output gets the same scrutiny, and encoding text output before downstream systems use it addresses Improper Output Handling, which the OWASP's 2026 LLM Top 10 lists as LLM10:2026 alongside Prompt Injection (LLM01:2026) and Excessive Agency (LLM03:2026).
Tool access follows least privilege: minimum permissions for every agent tool, the agent's decision separated from execution of irreversible operations, each human approval bound to the exact action, target and parameters, and short-lived, task-scoped credentials per agent. A mailbox-summarizing agent with read-only access and no send or delete function shows what that buys. An injection against it could still leak what it reads, but it could not send mail or remove evidence.
Logging and Behavioral Monitoring
Logs of prompts and tool calls are the record investigators need when an AI application misbehaves. The useful set covers user prompts, system prompts, model outputs, agent decisions and actions, interactions with external functions, agent transcripts and sandbox events. Those logs can hold sensitive data, and they belong in immutable storage with access controls of their own.
Behavioral monitoring compares that record against a baseline covering goal state, tool-use patterns and invariant properties such as schemas and access patterns. Deviations that warrant investigation include an agent calling a tool it has never used or reaching a new data source. Abnormal's AI Agent Security, in private preview as part of the AI Security suite, is designed to map agents' credentials, tools and permissions and flag off-baseline activity, which covers agent behavior and access, not application code.
Who Owns AI Application Security?
Ownership is shared, because the assets belong to different teams. Documented roles, responsibilities and lines of communication keep AI risk work from falling between teams. No standard prescribes a fixed split, but dividing the work by asset gives each team a clear layer:
AppSec Owns the Code Around the Model: It runs threat modeling, reviews how prompts combine instructions with untrusted content, sets output handling rules, and keeps SAST and DAST in the pipeline.
Platform Engineering Controls What the Application Can Reach: It issues agent identities and short-lived credentials, configures MCP servers, vaults secrets and restricts network egress.
Data Science Protects Models and Data: It verifies dataset and model provenance, scans third-party weights, tests for poisoning and runs pre-release evaluations.
Security Operations Watches Runtime Behavior: It ingests prompt and tool-call logs into the security information and event management (SIEM) platform, maintains baselines and handles AI incidents.
Shared frameworks keep those teams aligned, and organizations in scope of the EU AI Act must also keep high-risk systems resilient against attempts to alter their use, outputs or performance.
Carrying AI Application Security Through to Runtime
Threat modeling against AI-specific impacts starts the work, which continues through data and model supply chain checks and adversarial testing, and carries into production as input and output controls, least-privilege tool access, and logs that support behavioral baselines. Model, prompt and tool changes alter behavior between releases, and each change goes back through the same checks.
Code testing ends at release, while agent behavior keeps changing in production. Abnormal's AI Agent Security, in private preview, is designed to inventory agents and their owners, map the credentials, tools and permissions each one holds, and flag activity that departs from its baseline. Explore AI Agent Security to see how that complements code testing.
Frequently Asked Questions
Do existing SAST and DAST tools cover AI applications?
No, they cover the code around the model but not its behavior. SAST and DAST still find hardcoded keys, injection flaws and vulnerable dependencies in the surrounding application. They were not designed to evaluate how a model responds to crafted prompts, poisoned retrieval content or a malicious tool description, which is the gap adversarial testing, AI red teaming and runtime monitoring fill.
Is AI application security the same as AI security posture management?
No, the two serve overlapping but different purposes. Posture management tools inventory AI models, pipelines, data and services across cloud environments and identify misconfigurations and overprivileged identities. AI application security is a build-to-runtime discipline covering how a specific application is designed, tested, deployed and monitored, with posture findings as one input.
Does using a third-party model shift the risk to the provider?
No, responsibility is shared rather than transferred. The provider secures the model and its hosting infrastructure, while the deploying organization keeps control of its prompts, the data it sends and retrieves, the tools and permissions it grants, and how it handles output. Prompt injection prevention generally sits with the customer's application.
Where should a team start with AI application security?
Inventory the AI applications and agents in use, the models they call, and the tools and credentials each one holds, which shows where later controls apply. A threat model for the highest-risk application usually follows, then scoping its tools to least privilege. Logs of prompts, outputs and tool calls give security operations the baseline to monitor against.