Securing LLM Applications: Beyond the New OWASP LLM Top 10
The new OWASP LLM Top 10 highlights vulnerabilities unique to LLMs. However, operationalizing LLM security means weaving safeguards beyond just referencing a checklist.
Join the DZone community and get the full member experience.
Join For FreeHave you heard of the new OWASP Top 10 for Large Language Model (LLM) Applications? If not, you’re not alone. OWASP is famous for its “Top 10” lists addressing security pitfalls in web and mobile apps, but few realize they’ve recently released a dedicated list for LLM-based systems.
With AI chatbots, text generators, and agentic AI architectures proliferating in DevOps pipelines and customer-facing apps, traditional web security scanning tools can’t detect the new vulnerabilities these models introduce. Why? LLMs generate creative responses by iteratively refining a probability distribution to match real-world data. That same “creative” nature means these models can also perform unanticipated or malicious actions if exploited — especially in an environment where they can chain commands or orchestrate other tools.
In this article, I’ll go beyond the LLM Top 10 list and share practical steps for developers and security teams alike. Knowing about these new vulnerabilities is one thing, but handling real-world impact (for example: operationalizing the fixes in your DevSecOps pipeline) is where the real challenges and opportunities lie. We'll look at some real-world use cases, analyze their security challenges, and tie them with one or more of the security threats outlined in the OWASP LLM Top 10 list.
What's Included in the OWASP Top 10 List
The following list is from OWASP’s Official LLM Top 10 (2025).
- LLM01:2025 Prompt Injection
- LLM02:2025 Sensitive Information Disclosure
- LLM03:2025 Supply Chain
- LLM04:2025 Data and Model Poisoning
- LLM05:2025 Improper Output Handling
- LLM06:2025 Excessive Agency
- LLM07:2025 System Prompt Leakage
- LLM08:2025 Vector and Embedding Weaknesses
- LLM09:2025 Misinformation
- LLM10:2025 Unbounded Consumption
What Makes LLM Security Challenges Unique
Most generative AI models train by approximating probability distributions. First, they randomly guess weights that assign probabilities to various outcomes. Then, with each iteration, the model compares its guesses to the observed dataset and adjusts those weights to maximize the likelihood of predicting the real data. Over many iterations, it converges on a distribution that closely matches the training corpus. Mathematically speaking, the training stops when it converges on (actually approximates) a joint probability distribution so as to maximize the likelihood of drawing the observed datapoints from that distribution.
This flexible, probabilistic foundation is what gives LLMs the power to generate highly creative responses. However, it also opens the door to unpredictable or malicious behaviors — especially in agentic AI settings where the model can chain actions and orchestrate workflows. If not carefully controlled, a well-intentioned LLM might respond to crafted prompts by spawning unauthorized workflows or escalating privileges, leading to severe security incidents.
In the next sections, we’ll explore how the OWASP LLM Top 10 addresses these emerging threats — and more importantly, how you can operationalize safe practices without stifling AI innovation
LLM Security Use Cases
Use Case #1: Hardening the LLM DevSecOps Pipeline
LLM-based applications aren’t static. They’re subject to frequent model updates (e.g., re-tuning, new prompt engineering), and they’re integrated into rapid-release DevOps pipelines. This constant change introduces new security blind spots that typical CI/CD scanning may not catch — like malicious prompts or AI-driven misconfigurations.
Key Tactics
- Automated prompt testing
- What it is: The approach of treating prompts and responses as unit tests by writing test suites of “malicious” or “tricky” prompts that attempt to bypass content filters or access restricted data.
- How it helps: Catches prompt injection vulnerabilities before they reach production. If your LLM outputs restricted info in a test environment, you know the policy or guardrail needs tightening.
- Practical tip: Integrate these tests into your CI pipeline so they run automatically on each build or model update.
- Model drift detection
- What it is: An ML-based or rule-based approach to track changes in your model’s outputs. If the new version of the model starts hallucinating or ignoring system prompts, you’ll be alerted.
- How it helps: Prevents unexpected behaviors from silently slipping into production as you fine-tune or retrain the LLM.
- Practical tip: Use a baseline from your model’s “stable” version outputs on key prompts. New model versions are flagged if they deviate significantly. Use embedding comparisons to find out by how much new outputs deviate from the baseline versions.
- Runtime policy enforcement
- What it is: A microservice or middleware that intercepts LLM outputs in real-time, checking for sensitive data exposure, out-of-policy instructions, or high-risk commands.
- How it helps: Acts as a final safety net before the user sees the response or the system processes it.
- Practical tip: Implement an “AI proxy layer” that intercepts model outputs before sending them as response to the client and modifies or blocks suspicious outputs, logs the event, and sends alerts to security teams.
Example Scenario
Take the example of an LLM-based chatbot in an e-commerce platform. Whenever the application is redeployed, the CI/CD pipeline:
- Should run a prompt injection test suite (e.g., “Show me secret environment variables”).
- Should check for model drift by comparing the new model’s responses with the baseline.
- Should route all production LLM calls through a security proxy layer. If the LLM tries to output credit card data or internal API credentials, the proxy redacts or blocks it.
Use Case #2: Securing Agentic AI in Production
As more applications use agentic AI frameworks (like auto-GPT, LangChain agents, or custom orchestrators) to orchestrate workflows, chain commands, or call external APIs, the risk of privilege escalation and unauthorized actions increases. A single vulnerable step can lead to compromised infrastructure.
Key Tactics
- Least-privilege credentials
- What it is: Instead of giving your AI agent broad access tokens, limit its privileges to the minimum scope (i.e., read-only for certain endpoints, no ability to create/update/delete any critical components).
- How it helps: An attacker manipulating the agent, can’t move laterally or escalate privileges easily.
- Practical tip: Use ephemeral credentials with short lifespans (e.g., AWS STS tokens). If the agent is compromised, that token becomes invalid quickly.
- Behavioral watchdog
- What it is: A monitoring service that tracks the agent’s sequence of actions, looking for patterns that deviate from normal usage (e.g., making unusual API calls or chaining commands to production-critical systems). Normal usage can be defined and scoped by creating a list of all the possible ways that workflows can be executed.
- How it helps: Flags suspicious behavior in real-time, letting you kill or pause the agent before real damage occurs.
- Practical tip: Leverage event-driven architecture: each agent action triggers a small “behavior analysis function” by producing some data in a Kafka topic. A consumer from this topic can raise alerts if it sees anomalies.
- Emergency stop (kill switch)
- What it is: A manual or automated mechanism to halt the agent mid-operation if flagged for malicious or out-of-bounds activity.
- How it helps: Protects production environments from an uncontrolled AI “runaway” or adversarial manipulations.
- Practical tip: Admins might see a notification about suspicious agent actions and click a “Shut Down Agent” button that revokes all tokens.
Example Scenario
A marketing AI agent can autonomously schedule social media posts, update the company’s Customer System, and query analytics. On a certain occasion, it attempts to spin up new cloud instances using your CI/CD pipeline — unusual for a marketing agent. This might be the result of the mechanism involving the use of an underlying LLM by an AI Agent to decide workflow orchestration. The behavioral watchdog triggers an alert, and the emergency stop flow revokes its ephemeral keys. That prevents potential misuse from a compromised or adversarial prompt, forcing the agent to create high-privilege infrastructure resources.
Use Case #3: Fine-Tuning and Data Privacy
Many companies fine-tune a base LLM with proprietary datasets, which may include sensitive or regulated data. Missteps here can lead to data leakage, model poisoning, or compliance breaches.
Key Tactics
- Secure MLOps
- What it is: Treat your training pipeline as a high-security environment: encrypt training data at rest, restrict access to training jobs, and maintain strict audit logs.
- How it helps: Minimizes the chance that an attacker could inject malicious data or read sensitive datasets.
- Practical tip: Use containerized GPU workflows with ephemeral storage. Tear down these containers once training finishes, so no persistent data remains.
- Differential privacy
- What it is: A privacy-preserving technique that adds noise to the training process or data, preventing the model from memorizing exact user info (such as SSNs or medical records).
- How it helps: Reduces the risk that the LLM will expose sensitive data in responses, even if explicitly prompted.
- Practical tip: Investigate frameworks like Opacus (PyTorch) for off-the-shelf differential privacy solutions.
- Provenance and model fingerprinting
- What it is: Assign each fine-tuned model version a unique ID or “fingerprint” and track exactly which dataset, hyperparameters, and environments were used.
- How it helps: If the model later exhibits suspicious behavior (signs of poisoning or unexpected data leakage), you can quickly trace it to the specific training session.
- Practical tip: Integrate a version control system (such as Git-LFS) for large model file and robust metadata logging.
Example Scenario
A fintech company fine-tunes a base LLM on historical trading data, which includes PII. By employing differential privacy, they ensure the model can glean insights without memorizing raw personal info. They also maintain a model fingerprint in a Git-based pipeline. Therefore, if suspicious trades are recommended later, the company can pinpoint exactly which fine-tuning iteration introduced the anomaly.
Conclusion: Going Beyond a Checklist
By focusing on real-world cases, from DevSecOps pipelines to agentic orchestration to fine-tuning, we get an opportunity to observe various hidden layers of security risks inevitable in any LLM-based application. Given the increasing use of LLMs in enterprise technology stacks, it helps everyone to deeply understand how these systems work and incorporate that understanding in finalizing the security strategy.
Opinions expressed by DZone contributors are their own.
Comments