GRC Careers

HomeResourcesPrompt Injection

CS-111 · AI Security

Prompt Injection

How attacker-controlled text hijacks the instructions of an AI system, and how to defend against it.

Executive Summary

Prompt injection is an attack in which text supplied by an attacker overrides or subverts the instructions a language model was meant to follow. Because these systems treat instructions and data as the same stream of words, a well-placed message inside user input or a fetched web page can redirect the model to leak data, misuse connected tools, or produce harmful output. It is widely regarded as the top security risk for applications built on large language models.

What It Is

Prompt injection is the manipulation of an AI system through crafted input so that it ignores its original guidance and follows the attacker instead. A language model does not have a hard boundary between the developer's instructions, the user's request, and any outside content it reads. All of it arrives as text, and the model tries to satisfy the most compelling instruction it sees. Direct prompt injection happens when a user types adversarial text straight into the system. Indirect prompt injection is more subtle and often more dangerous: the malicious instructions are hidden in content the model retrieves on its own, such as a web page, a document, an email, or a code comment, so the user never sees them and never consented to them.

Why It Matters

Organizations are wiring language models into email, customer support, code, databases, and internal knowledge, and they are giving those models tools that can send messages, run queries, and take real actions. A successful injection can turn a helpful assistant into a channel for data theft, fraud, or sabotage without touching the underlying code. Because the attack rides on natural language rather than a software flaw, traditional defenses like input validation for known bad characters do not fully apply. For governance, risk, and compliance professionals, prompt injection is a fresh category of risk that maps to data protection, access control, and vendor oversight obligations, and it needs to be documented and managed like any other material threat.

How It Works

The core weakness is that the model blends trusted and untrusted text and then acts on the combined result. In a direct attack, the adversary crafts a message that persuades the model to disregard its rules, reveal its hidden instructions, or perform an off-limits action. In an indirect attack, the adversary plants instructions in content the model will later read, so the payload activates when an ordinary user asks the assistant to summarize a page, read an inbox, or process a file. The impact grows sharply when the model can use tools or plugins, because a hijacked model may be steered into calling those tools with attacker-chosen inputs. Defense therefore focuses on limiting what the model can reach, separating and labeling untrusted content, checking outputs before they are trusted, and keeping a human in the loop for consequential actions. This reference explains the risk and its mitigations only and does not provide working attack text.

Architecture Diagram

Untrusted input or fetched contentSeparate and label as data, not instructionsConstrain the model with least privilege for toolsReview output and require human approval for high-impact actionsLog and monitor for abuse
Untrusted content can carry hidden instructions; layered controls separate, constrain, and review it before any action is taken.

Visual Workflow

Map every place untrusted text can enter the system, including user input and any content the model retrieves.Keep developer instructions, user input, and outside content in clearly separated and labeled channels.Grant the model the least privilege it needs, and gate any tool that can act with explicit checks.Validate and sanitize model output before it is displayed, executed, or passed to another system.Require human approval for consequential actions such as sending money, deleting data, or emailing outside parties.Log prompts, retrieved content, tool calls, and outputs, and monitor for signs of manipulation.

Common Attacks

Common Mistakes

Best Practices

Quick Checklist

Recommended Tools

LLM guardrail and filtering layer
Screens inputs and outputs for policy violations and manipulation attempts
Output validation and schema enforcement
Forces model responses into expected formats before they are trusted
AI gateway or proxy
Centralizes access control, rate limits, and logging for model traffic
Retrieval controls with content labeling
Marks fetched content as untrusted data rather than instructions

Industry Standards

OWASP Top 10 for LLM Applications
Names prompt injection as a leading risk for language model applications
NIST AI Risk Management Framework (AI RMF, AI 100-1)
Provides the Govern, Map, Measure, and Manage functions for handling AI risk
MITRE ATLAS
Catalogs adversarial techniques against AI systems for threat modeling

Career Relevance

Prompt injection is core knowledge for AI security engineers who harden model-powered applications, and for AI governance analysts and AI risk managers who must document and treat it as a named risk. GRC analysts increasingly assess it during vendor reviews, data protection assessments, and control testing for any product that embeds a language model. Fluency here signals that a candidate understands the security implications of generative AI, a fast-growing expectation for the roles AI-Governance-Jobs.com serves.

Interview Questions

Related Certifications

OWASP resources for LLM application security ISC2 or ISACA AI security offerings (as available) CompTIA Security+ (for the security foundations)

Further Reading

Key Takeaways

Download PDFDownload PNG

FAQ

Is prompt injection the same as jailbreaking?

They overlap but are not identical. Jailbreaking usually means coaxing a model past its safety rules, while prompt injection is the broader problem of attacker-controlled text overriding intended instructions, including instructions hidden in content the model reads. This sheet focuses on defense and does not provide attack text.

Can I fully prevent prompt injection?

There is no single fix today. The practical goal is to reduce likelihood and impact by treating all input and retrieved content as untrusted, limiting the model's privileges and tools, validating output, and requiring human approval for consequential actions.

Why is indirect prompt injection considered so dangerous?

Because the malicious instructions live in outside content the model fetches on its own, the user never sees them and never consents. An ordinary request like summarizing a page can trigger a payload the user did not know was there.

Get all 116 reference sheets
The complete AGJ Cybersecurity Professional Reference Library, print-ready PDFs and PNGs.
Browse the library

Related Careers

Related certifications

OWASP resources for LLM application securityISC2 or ISACA AI security offerings (as available)CompTIA Security+ (for the security foundations)

Current openings

Live openings appear on the web version. Browse the job board for current GRC and security roles.
Browse all jobs

Suggested learning path

  1. Ground the basics with CS-001 Cybersecurity
  2. Study this sheet: Prompt Injection
  3. Go deeper: Model Poisoning
  4. Go deeper: OWASP Top 10 for LLM Applications
  5. Validate it: work toward OWASP resources for LLM application security
  6. Find the role: browse current openings

Related sheets

More in AI Security

Share this LinkedIn Facebook X Email