AI Application Security: Securing the AI Stack at Runtime

AI application security is the practice of securing the whole AI stack, the agents, frameworks, data pipelines, dependencies, and runtimes that make up an AI application, not just the model. Most AI risk does not live in the model in isolation. It lives in the code and systems wired around it. The durable way to tell real risk from theoretical risk is runtime: whether the vulnerable path is reachable and actually executes in production.

September 5, 2025
September 5, 2025

0 min read

Application Security
Security Risks Across the AI Application Stack: A Researcher’s Guide

What is AI application security?

AI application security is application security for systems built on large language models and machine learning. It covers the same concerns as traditional AppSec, vulnerable dependencies, insecure code, exposed secrets, and exploitable runtime behavior, plus a set of risks specific to AI: prompt injection, agent and tool abuse, model and data-pipeline manipulation, and an expanding AI supply chain.

The key shift is to stop treating AI as special. An AI application is application code. The model is one untrusted component inside a larger system of orchestration, tools, retrieval, and execution. Securing it means securing that system, and prioritizing by what actually runs rather than by the volume of theoretical findings a scanner can produce.

Why traditional scanning misses AI risk

Traditional scanning flags issues by presence in code or dependencies, without proving whether they are exploitable in production. In an AI stack that gap is wider than usual, because the stack is new, moves fast, and chains risk across layers. A scanner can report a long list of CVEs in AI libraries while saying nothing about which of them load, execute, or can be reached by an attacker.

What matters is runtime exploitability: whether a vulnerable path is reachable, whether it executes, and whether it can be chained with others. Reachability analysis and runtime intelligence are what turn a noisy inventory of AI-stack CVEs into the short list that genuinely puts the application at risk.

The AI application stack, layer by layer

The AI application stack breaks into five layers, each with distinct security considerations.

1. Agent frameworks

LangChain, LangGraph, and CrewAI connect models to tools, APIs, and workflows. They introduce prompt injection, tool exploitation, and API overreach.

2. Full-stack frameworks

Next.js, React, Vue, and Angular power most AI applications and inherit familiar issues like cross-site scripting and dependency compromise.

3. Data pipelines

TensorFlow.js, Transformers.js, and Hugging Face datasets and tokenizers handle preprocessing and inference, introducing poisoned models, dataset manipulation, and runtime vulnerabilities.

4. Vector databases

Pinecone, Weaviate, and Milvus store embeddings and power retrieval. Risks include data exfiltration through query abuse, metadata injection, and poisoning.

5. Runtimes and deployment

Node.js, Deno, and Bun, plus serverless and edge runtimes like AWS Lambda, Vercel Edge, and Cloudflare Workers, add metadata credential theft, prototype pollution, and build pipeline compromise.

Security issues here are rarely isolated. They chain across layers: a poisoned dataset ingested through Hugging Face can be embedded into a vector database, retrieved by an agent framework, and exfiltrated through an API endpoint on an edge runtime. Each layer amplifies the next, which is why a stack-wide, runtime-aware view matters more than any single scanner.

The main AI threat categories

How to secure AI applications

Securing an AI application means treating the model as untrusted and defending the system around it, with prioritization driven by what actually runs. In practice that combines least-privilege tool access, validated tool arguments, sandboxed execution, gating of irreversible actions, and runtime monitoring of the behavior the system actually performs.

Kodem approaches this through securing the AI application stack: runtime intelligence identifies which AI-stack vulnerabilities are reachable and exploitable, and Kai, Kodem's runtime-aware AI, helps teams prioritize and remediate the findings that genuinely matter instead of triaging every advisory. The goal is not more findings. It is an accurate, runtime-validated view of the AI risk that actually puts the application in danger.

What this research series covers

This series dissects the AI application stack layer by layer, documenting real-world security issues with MITRE ATT&CK mappings and references:

Frequently Asked Questions

What is AI application security?

AI application security is the practice of securing the whole AI stack, the agents, frameworks, data pipelines, dependencies, and runtimes that make up an AI application, not just the model. It prioritizes risk by what actually executes in production rather than by the volume of theoretical findings.

How is AI application security different from traditional application security?

It covers the same concerns as traditional AppSec plus AI-specific risks: prompt injection, agent and tool abuse, model and data-pipeline manipulation, and the AI supply chain. The model is treated as one untrusted component inside a larger system that must be secured.

What is the OWASP Top 10 for LLM applications?

It is the OWASP reference list of the most important risks in LLM applications, from prompt injection (LLM01) to insecure output handling and excessive agency. It is the standard taxonomy for AI application security.

What is prompt injection?

Prompt injection is an attack where crafted input makes a model follow an attacker's instructions instead of the developer's. It is OWASP LLM01 and is best understood as initial access into a larger attack chain rather than the damage itself.

How do you secure AI agents?

Treat the model as untrusted and contain the system around it: least-privilege tool access, validated tool arguments, sandboxed execution, confirmation gates on irreversible actions, and runtime monitoring of the behavior the agent actually performs.

Table of contents

Related blogs

Reachability Predicts. Runtime Proves.

Reachability Predicts. Runtime Proves.

Reachability tells you code can execute. Runtime tells you it did.

July 20, 2026

7

What is an LLM Jailbreak?

What is an LLM Jailbreak?

An LLM jailbreak bypasses a model's safety guardrails to produce restricted output. How jailbreaks work, how they differ from prompt injection, and defenses.

July 15, 2026

4

What is RAG Security?

What is RAG Security?

RAG security covers the risks of retrieval-augmented generation: injection through retrieved content, data poisoning, and leakage. The threats and how to defend.

July 15, 2026

4

Stop the waste.
Protect your environment with Kodem.

A Primer on Runtime Intelligence

See how Kodem's cutting-edge sensor technology revolutionizes application monitoring at the kernel level.

5.1k
Applications covered
1.1m
False positives eliminated
4.8k
Triage hours reduced

Platform Overview Video

Watch our short platform overview video to see how Kodem discovers real security risks in your code at runtime.

5.1k
Applications covered
1.1m
False positives eliminated
4.8k
Triage hours reduced

The State of the Application Security Workflow

This report aims to equip readers with actionable insights that can help future-proof their security programs. Kodem, the publisher of this report, purpose built a platform that bridges these gaps by unifying shift-left strategies with runtime monitoring and protection.

3D book mockup of Kodem's State of the Application Security Workflow 2025 report

Get real-time insights across the full stack…code, containers, OS, and memory

Watch how Kodem’s runtime security platform detects and blocks attacks before they cause damage. No guesswork. Just precise, automated protection.

Kodem issues list with a magnified view of insight icons: runtime, ingress, and exploitability
Combined author
Mahesh Babu
Publish date

0 min read

Application Security