Skip to content

Interview question · Prompt Injection & Jailbreaks

What is prompt injection, and how is it like and unlike SQL injection?

Compare the control each interpreter enforces. Then review a fictional document-ranking feature without mistaking valid syntax, visible text or human review for permission.

easyEssentialNewUpdated Nov 2026

TL;DR: Both involve untrusted input being treated as instructions. Parameter binding keeps values from changing a fixed SQL statement's syntax; prompt labels guide model behavior, while application services must independently enforce access, audience and action rules.

How to approach it

Identify the source author, intended task and consequence before comparing mechanisms. Ask whether the model only drafts an answer or can also read private records and act. Explain what parameter binding guarantees, where that guarantee ends and what the model-facing design must enforce elsewhere. Treat the rubric below as site-authored practice guidance, not an employer's scoring system.

A strong answer

Consider a fictional document-review service. An authorized reviewer asks it to compare submissions against fixed criteria. A submission's author can edit the source document but cannot change the criteria, access other submissions or choose an external delivery audience. A source passage attempts to redirect that comparison. That is a prompt-injection attempt; whether it changes the result or causes disclosure needs observation.

The shared pattern is input being treated as something with greater authority than intended. The mechanisms differ. OWASP's SQL guidance, checked November 2026, recommends separating statement structure from bound values. A correct binding prevents that value from changing SQL syntax. It does not make concatenated structural fragments safe or decide whether a matching record belongs in the caller's permitted result.

Model APIs can preserve message roles and applications should prevent source text from becoming trusted configuration. The model still interprets the content. Delimiters and learned instruction priority can help, but a well-formed model output is not proof of permission. Avoid claiming every model architecture is identical or that useful architectural controls are impossible.

WORKED REVIEW · INTERPRETATION AND AUTHORITY
Keep interpretation separate from the permission decision

Source document

Author supplies evidence

Model result

Score or action proposal

Application check

Criteria, grant and audience

Reviewed result

Evidence and observed effect

1/3

Identify source authority

The document author may submit evidence but cannot redefine the task or grant access to other records.

Proposed controlProperty to testRemaining boundary
Bind a search value in a fixed SQL statementThe value cannot change the statement syntaxCaller and object authorization
Mark a submission as source dataThe model more reliably keeps it in the intended roleIndependently enforced task and resource policy
Require a typed comparison resultOutput has the required structureEvidence, criterion integrity and permitted audience
Check the current task at the resource serviceThe requested read is within the grantDownstream disclosure and other reachable services

For the review service, preserve the criteria in controlled configuration. The author may supply evidence but cannot publish a new criterion merely by claiming authority in the document. Show reviewers source locations and uncertainties; check whether quoted evidence supports the score. Citations make a decision inspectable, not automatically correct. Human review needs an actual opportunity and basis to challenge the result.

If delivery is added, bind the material and recipients to current authorization. A verified address identifies a destination; it does not permit receiving every record. Existing scoped authority can support an automatic status message. A new or materially changed action may require approval. Review generated links, previews, exports and saved drafts as output paths too.

Measure source ingestion, forbidden proposals, service decisions and effects separately. A blocked read demonstrates one tested control; an accepted operation with a missing final receipt remains unresolved. Include legitimate comparisons and allowed changes of presentation so that the defense does not win by refusing all work. Run tests only in an authorized isolated setting with synthetic data and effect sinks.

What interviewers probe next

  • “Would escaping or adding data tags fix it?” Describe the interpreter property being claimed. Tags can help a model identify source roles; they do not authorize resources or prove that source instructions cannot influence an answer.
  • “What if the source contains hidden text?” Inspect the actual extraction, rendering or vision input. Hidden text does not reach every parser, and visible text can also redirect a task.
  • “What if a person makes the final decision?” Assess evidence quality, reviewer authority and where the draft was already exposed. Review can reduce errors without certifying every result.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

The fictional review service compares submitted documents against controlled criteria. A document author can edit only their own submission.

  1. Start here

    The model returns the required fields but gives unsupported scores. Did the output schema work?

How it's scored

Weak: Calls either problem universally solved or impossible, and relies on formatting, filtering or a stronger prompt as the permission rule.

Hire: Explains scoped parameter binding, source authority and model behavior, then puts the relevant read or effect check in an independently enforced service.

Strong Hire: Separates permitted processing from disclosure, tests valid work and observation gaps, and explains the trusted inputs and coverage of the proposed control.

Common mistakes

  • Treating valid SQL syntax or valid JSON as evidence of authorized access.
  • Assuming every imperative sentence is an attack, including legitimate user requests.
  • Declaring text-only ranking errors harmless because no tool ran.
  • Giving a document author control over the policy used to judge that document.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.