Prompt Injection interview question

AI Safety & SecurityPrompt InjectionLLM Securitybasic

What is prompt injection in an LLM application?

  1. AInserting carefully chosen examples into the training set so the model learns a hidden trigger that changes its later behaviour on cue.
  2. BSending so many long prompts to the model endpoint that it runs out of capacity and requests from real users start to time out.
  3. CUntrusted text in the model's input that overrides or subverts the developer's instructions, so the model does something unintended.
  4. DQuerying the model many times to rebuild a copy of it from its answers, so an attacker can use the model without paying for access.
Show the answer and explanation

Correct answer: C, Untrusted text in the model's input that overrides or subverts the developer's instructions, so the model does something unintended.

Explanation Prompt Injection

Prompt injection happens because an LLM receives the developer's instructions and untrusted text (a user message, a web page, a document) in the same input and cannot reliably tell them apart. If the untrusted text contains instructions such as "ignore your previous instructions and…", the model may follow them instead of the developer's.

Why the other descriptions are different attacks:

  • Planting trigger examples in training data is data poisoning (a backdoor), which changes the model itself, not the prompt.
  • Flooding the endpoint with requests is a denial-of-service or resource-exhaustion attack.
  • Rebuilding a model from its answers is model extraction (model theft).

Defences such as input filters, separating trusted and untrusted content, and least-privilege tools reduce the risk, but no known technique fully prevents prompt injection.

Interview tip: compare it to SQL injection (data being treated as instructions), then add that, unlike SQL, there is no reliable "escaping" for natural language.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More AI Safety & Security questions

  1. A retailer's shopping app calls the LLM provider directly from the client with the code below; the key is injected from an environment variable at build time.…
  2. A consultancy's responsible-AI board reviews the five incidents below. Which mapping to harm types (allocation, quality of service, stereotyping, denigration,…
  3. In this enterprise RAG pipeline, users must never receive content from documents they are not permitted to read. Where should that rule primarily be enforced?
  4. Five banks plan to train a shared fraud model with federated learning: each bank trains on its own transactions and sends only model updates to a coordinating…
  5. An e-commerce company has trained a new jailbreak classifier for its shopping assistant. It scored well on an offline labelled set, but the team worries it…