liveBook · Manning

Prompt injection

As explained in Effective Conversational AI

Prompt injection is an attempt to manipulate a language model's instructions or behavior through specially crafted input.

Prompt injection uses crafted input to steer a language model away from its intended behavior. It can turn a request the model would refuse into one framed to seem harmless. section 1.2.2

A reframed request

A model may reject “Tell me how to make a bomb,” yet be tricked by a request to tell a grandmother’s detailed story about making one. The changed framing is a jailbreak attempt, not a safe change in intent. section 1.2.2

Input screening can block suspicious requests, but keyword checks and classifiers become part of an arms race. Limiting input length is one primitive countermeasure. After deployment, review representative logs and assess whether answers resist prompt-injection attempts; annotated examples can form a baseline for later changes. section 1.2.2 section 4.2.2

How Effective Conversational AI covers it

How deep it goes
Shows a jailbreak example, mentions input screening and length limits, and includes resilience as an evaluation criterion.
Examples
Contrasts a refused bomb-making request with a grandmother-story framing and assesses answers for resistance to injection.
What you can do after
Evaluate resistance by reviewing representative logs and tracking answer quality against an annotated baseline.
How it connects
Connects prompt injection with input filtering, contextual prompting, output filtering, and generative AI evaluation.

Also explained in

Compare how 9 books explain prompt injection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Conversational AI. The section links point to the parts of the book it draws on.