Innomerc Learn
English is the default.
AI Security

Prompt Injection Explained

See why source content must not become authority over an AI system’s instructions or tools.

Intermediate6 min explorationReviewed
My learningNot started

Choose your depth. Learn at your own pace.

Simple explanation

Understand it

Prompt injection tries to make an AI system follow instructions supplied through a source that should not control it. A webpage, document or tool result may include text aimed at changing the assistant’s behavior rather than answering the user’s question.

Imagine asking Cedar’s assistant to summarize a guide. The guide contains an unrelated instruction to disclose private information. The user authorized a summary, not that new action. The distinction is about trust and authority, not merely unusual wording.

Technical explanation

Under the hood

Direct injection enters through a user-facing input; indirect injection arrives through retrieved or externally supplied content. Text boundaries and instruction hierarchy help, but a language model does not provide the same separation as a conventional parameterized interpreter.

Defenses must also constrain outputs and effects. Keep secrets out of unnecessary context, validate tool arguments, restrict destinations and enforce permissions independently. A retrieval pipeline or a content filter alone does not eliminate the risk.

Practitioner explanation

Practitioner perspective

Evaluate the actual system: what untrusted content it consumes, which secrets it can see and which actions its tools permit. Test attempts to cross those boundaries using synthetic data and authorized environments. Measure unauthorized outcomes, not just whether the model repeats a suspicious phrase.

Maintain provenance through retrieval, memory and tool results. Human approval is useful only when the person sees a concrete action and enough context to evaluate it. Do not claim a universal prevention guarantee from a prompt, classifier or guardrail.

See the decision happen

Watch it work

A fictional, simplified model. Select a component to inspect it, or follow the steps in order.

Interactive Lab

AI demo production system

Reveal the supporting controls around a model call. This is one illustrative architecture, not a universal stack.

Steps1. Prompt 2. Response
Click a box or choose its name to learn what it means.
User interfaceReadyPolicy gatewayReadyModelReadyRetrievalReadyTool executorReadyAudit +evaluationReadyUser interfaceReadyPolicy gatewayReadyModelReadyRetrievalReadyTool executorReadyAudit +evaluationReady
Ready to traceSmall demo
Before you start · 2 stepsSmall demo

A prompt and model response demonstrate capability but not operational readiness.

How to use this example

Select Next step to read at your own pace, or Animate step to watch one exchange. Nothing advances until you choose.

Inspect components & read every step
  • User interface

    The part of an application that people interact with.

    Example: A text box receives a question before the application processes it.

  • Policy gateway

    A control point that checks requests against application rules.

    Example: It may enforce access or usage limits before a model request proceeds.

  • Model

    An AI system that generates output from its input. Its answer can be wrong.

    Example: It drafts an answer using the question and supplied context.

  • Retrieval

    The process of finding relevant information to supply as context.

    Example: A system searches approved documents before asking a model to draft an answer.

  • Tool executor

    Application code that performs an allowed action requested through a tool interface.

    Example: It checks permissions before making an approved calendar lookup.

  • Audit + evaluation

    Records and checks used to examine how a system behaved and how well it performed.

    Example: A team reviews a failed tool call and evaluates whether answers meet its criteria.

Small demo

A prompt and model response demonstrate capability but not operational readiness.

  1. User interface Model: Prompt. The demo passes a prompt directly to a model.
  2. Model User interface: Response. A plausible response returns; production controls are not represented.

Controlled production flow

Independent policy checks protect data and tool actions; monitoring and evaluation support review.

  1. User interface Policy gateway: User request. Authenticate the caller and apply request limits.
  2. Policy gateway Retrieval: Authorized retrieval. Filter documents under the user’s access policy.
  3. Retrieval Model: Context + task. Retrieved text is evidence, not authority to change tool permissions.
  4. Model Policy gateway: Proposed action. The model proposes an action; policy decides whether it can execute.
  5. Policy gateway Tool executor: Approved action. A scoped executor performs only the approved action.
  6. Tool executor Audit + evaluation: Outcome + trace. Record outcomes with appropriate privacy and retention.
  7. Model User interface: Answer. Return the response; evaluation and monitoring remain ongoing.

Fictional teaching trace. One moving dot represents an exchange, not a measured network capture.

Open the detailed lesson walkthrough

Explore the system

User request

Summarize the fictional product guide.

1 / 4
Read every step without animation

Authority confusion

  1. User request. Summarize the fictional product guide.
  2. Untrusted document. The guide includes an unrelated instruction.
  3. Boundary lost. The application lets source content redirect the task.
  4. Unsafe proposal. An action outside the user’s intent is proposed.

The external document was given authority it did not have.

Constrained system

  1. User request. The same summary is requested.
  2. Source boundary. Retrieved content remains evidence for the summary.
  3. Tool policy. Any unrelated action fails independent authorization.
  4. Task preserved. The assistant can answer within the permitted scope.

Reduce influence and independently limit consequences.

Attack view

The fictional document asks for an action outside the user’s request. This simulation uses a symbolic instruction and no exfiltration destination or real secret.

Defender view

  • Treat external content as data with limited authority.
  • Constrain tool permissions and validate effects outside the model.
  • Use synthetic adversarial tests and review failures as the application evolves.

Common mistakes

  • RAG does not automatically prevent prompt injection.
  • A filter detecting suspicious wording does not prove all unauthorized actions are blocked.

Check your understanding

Can an external document grant new permission to an agent?
Active recall: explain this idea in 30 seconds

Prompt injection tries to make an AI system follow instructions supplied through a source that should not control it. A webpage, document or tool result may include text aimed at changing the assistant’s behavior rather than answering the user’s question.

Now give an example and name one limitation. Revisit the explanation if you get stuck.

Primary sources

Original explanations informed by these specifications and official resources. Source versions and lesson review are separate from product updates.

Content reviewed 2026-09-10. Read the editorial policy.

What comes next?

Understand AI systems

Back to topic