Zulia Shavaeva← Back to Zulia
Free AI and security guide/Learn

Learn / Application security for LLM-backed software

Application security for LLM-backed software

Applying secure design, review and testing practices to applications that embed LLMs, agents or RAG pipelines.

Researched on 2026-09-26 with AI assistance. Links and summaries can change; verify details with the original source. Not yet reviewed by a person.

What it is

Application security for LLM-backed software means treating the model, its prompts, its retrieved context and its tools as part of the application's attack surface. PortSwigger's working method is to enumerate direct and indirect inputs, work out what data and APIs the model can reach, then probe that surface.2

The risks are catalogued: the OWASP Top 10 for LLM Applications 2025 lists prompt injection, sensitive information disclosure, supply chain, data and model poisoning, improper output handling, excessive agency, system prompt leakage, vector and embedding weaknesses, misinformation and unbounded consumption.1

It is ordinary secure design plus one new property: LLM-integrated applications blur the line between data and instructions, so content the application merely retrieves can act like code that redirects the application's functionality and API calls.4

Standards bodies frame it as a lifecycle problem rather than a model problem. NCSC and CISA guidance says security must be a core requirement across design, development, deployment and operation of AI systems, alongside existing cyber security practice.3

Why postings ask for it

14 of 48 postings (29 percent) ask for it, and it is concentrated where software gets designed: 57 percent of AI Security Architect postings and 31 percent of AI/Agent Security Engineer postings.P

Architect and engineer roles have to decide what tools an agent may call and what happens to model output, because excessive agency and improper output handling are design decisions, not model settings.P12

GRC postings ask at 29 percent because assurance work now means checking secure-by-design claims across the AI lifecycle, not just reviewing a model card.P3

Concepts you should be able to explain

If you can say each of these out loud in two minutes, with an example, you are ready for the technical part of an interview on this skill.

Instruction and data confusion

LLMs do not reliably separate operator instructions from content they are given to process; everything is concatenated into one token sequence. Greshake and co-authors showed that processing retrieved prompts can act like arbitrary code execution, changing application behaviour and controlling whether other APIs are called. Assume any text or image reaching the model can carry instructions.46

Indirect prompt injection

The attacker never touches the chat box; they plant instructions in data the application is likely to retrieve, such as a web page, email, ticket or document. The original paper demonstrated this against real systems including Bing's GPT-4 powered chat and code-completion engines, with impacts including data theft and worming. This is the attack class that breaks RAG pipelines and agents.4

The lethal trifecta

A design becomes exploitable when one system combines access to private data, exposure to untrusted content, and the ability to communicate externally. Any outbound HTTP request, image load or clickable link can be the exfiltration path. Vendors usually fixed reported cases by closing the exfiltration vector, so removing one leg of the trifecta is a real mitigation.6

Excessive agency and tool scope

Excessive agency is when the model can reach APIs that touch sensitive data or take actions, and can be talked into using them outside intended scope. Mapping starts by asking the model which tools it has, then testing each one. A confirmation step before the model calls an external API is a basic control, since users often do not know a call happened.21

Improper output handling

Model output is untrusted input to whatever consumes it: a browser, a shell, a database, another service. PortSwigger notes that attacking an LLM integration resembles SSRF, since you abuse a server-side component to reach systems you cannot touch directly, so classic web exploits such as path traversal and SQL injection should be sent through the model to every API it can call.21

RAG and embedding weaknesses

Retrieval adds its own risk classes: vector and embedding weaknesses, plus poisoning of embedding or fine-tuning data. In review terms that means asking who can write to the corpus, whether tenant documents are isolated in the index, and whether retrieved chunks are labelled as untrusted data before they reach the prompt.1

Design patterns instead of prompt pleading

Because filtering is probabilistic, Beurer-Kellner, Tramer and colleagues argue for design patterns that constrain what an agent can do after it has seen untrusted content, and analyse the utility cost of each pattern. In a design review this shifts the question from how good is the guardrail to what damage remains possible if the injection succeeds.76

Testing and regression harnesses

AgentDojo provides an extensible environment with 97 realistic tasks and 629 security test cases, and its authors found that existing injection attacks break some security properties but not all. Open scanners such as garak and promptfoo generate adversarial test suites you can rerun in CI, so injection testing becomes a regression suite rather than a one-off assessment.589

Use fictional data and authorised sandboxes. Remove employer details and secrets from any portfolio write-up. Time estimates exclude setup. Check model and cloud costs before running tests, set spending limits, and delete lab resources afterwards.

Three exercises

In order of difficulty. Free tools. Keep what you build; it is evidence.

1Map the attack surface of an LLM feature and finish the free web LLM labsabout 6 h

You can walk an interviewer through inputs, reachable data, reachable APIs and the exploit path, using vocabulary from a recognised methodology.21

  1. Read the Web LLM attacks topic and write down the three-step method: identify direct and indirect inputs, list data and APIs the model can reach, probe that surface.
  2. Work the Web Security Academy LLM labs, including the indirect injection lab against an AI-powered scanner.
  3. For each lab, record which OWASP LLM Top 10 entry it maps to.
  4. Write a one-page surface map for one LLM feature at your own employer or an open source app, working from design documents and code you already have access to; live probing of an employer's system needs written authorisation.

Tools: PortSwigger Web Security Academy (free labs), Burp Suite Community

2Build a repeatable injection and jailbreak scanabout 10 h

You can produce a scan report against a local model or an endpoint you own, triage false positives, and rerun it as a regression check.8916

  1. Install garak and run its probes against a locally hosted model to get a baseline report.
  2. Run promptfoo's red team quickstart against the same target so you have two independent test sets.
  3. Triage 10 findings by hand: mark real, unclear or false, and note why.
  4. Map surviving findings to OWASP LLM Top 10 entries and to the exfiltration path they would need to cause harm.
  5. Save the config so a code change can be rescanned.

Tools: garak, promptfoo (open source), a locally hosted open-weights model

3Threat model and redesign an agent that holds the lethal trifectaabout 16 h

You can present a before-and-after architecture that limits blast radius after a successful injection, with the utility cost stated honestly.756103

  1. Pick an agent design with private data access, untrusted content exposure and an outbound channel, and document the trifecta explicitly.
  2. Read the design patterns paper and choose two patterns that constrain the agent after it reads untrusted data.
  3. Redraw the design with those patterns and state what the agent can no longer do for the user.
  4. Stand up AgentDojo locally and run its security test cases against your original and revised tool policies.
  5. Write the result as a short review memo referencing the relevant OWASP agentic risks and NCSC secure-by-design expectations.

Tools: AgentDojo (code released with the paper), promptfoo, a locally hosted open-weights model

Practice questions

Written from the concepts above, not collected from a named employer. Open one, answer it out loud, then tick the points you covered; the score stays in this browser.

Why can't you fix prompt injection by telling the model to ignore instructions found in retrieved content?Instruction and data confusion

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

How would you scope an assessment of a customer support assistant that has order and stock APIs?Web LLM attacks

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Explain the lethal trifecta and use it to triage two agent designs.The lethal trifecta

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

A developer renders model output directly in the browser and passes part of it to a shell command. What do you tell them?Improper output handling

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

What extra review questions does a RAG pipeline add over a plain chat feature?RAG and embedding weaknesses

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

How would you prove to an auditor that injection testing is part of the delivery pipeline, not a one-off?Testing and regression harnesses

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Where do you draw the trust boundaries in an agent that reads email and can send HTTP requests?Design patterns instead of prompt pleading

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Which risk catalogue would you use to structure a report on an agentic application, and why?OWASP Top 10 for LLM Applications 2025

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Sources

Every numbered claim above links here. P = the platform's own coding of 48 job postings.

  1. OWASP Top 10 for LLM Applications 2025 OWASP GenAI Security Project
  2. Web LLM attacks PortSwigger Web Security Academy
  3. Guidelines for secure AI system development: Introduction UK National Cyber Security Centre
  4. Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection arXiv (Greshake et al.)
  5. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents arXiv (Debenedetti et al.)
  6. The lethal trifecta for AI agents: private data, untrusted content, and external communication Simon Willison
  7. Design Patterns for Securing LLM Agents against Prompt Injections arXiv (Beurer-Kellner, Tramer et al.)
  8. garak, the LLM vulnerability scanner NVIDIA
  9. Red team: getting started Promptfoo
  10. OWASP Top 10 for Agentic Applications for 2026 OWASP GenAI Security Project
  11. MITRE ATLAS MITRE

Resources

Free first. Levels: intro means no prior knowledge of this skill; working means you can apply it on a project; advanced means research depth or specialist tooling.

Level Format

Gaps the research could not fill with a good free source: No free instructor-led or long-form course equivalent to SANS SEC545 for secure design review of LLM applications; free options are short notebook courses.; No confirmed price or duration for SANS SEC545 on the provider page.; No free, vendor-neutral threat modelling worksheet or STRIDE-style template specifically for RAG and agent architectures from a standards body.; No free mapping from LLM AppSec controls to ISO/IEC 42001 or SOC 2 evidence that GRC leads could reuse.; Free RAG-specific hands-on ranges are all small community repos with few stars; no well-maintained RAG lab from a major provider.; No free book-length treatment of LLM application security found in today's searches.