liveBook · Manning

Prompt security

As explained in Prompt Engineering in Practice

Prompt security is the practice of protecting model behavior and sensitive information from attacks delivered through prompts or other model inputs.

Prompt security treats prompt design as a security control: attacks can target model behavior through inputs, and defenses begin with how prompts are written. It does not require changing application infrastructure, but prompt-level defenses have limits. section 10.0 section 10.5

A key distinction is trusted versus untrusted input. Prompt security addresses prompt injection, jailbreaking, and instruction conflict, and draws on structured prompts, precise behavioral constraints, and separation of stable instructions from variable inputs. section 10.0

A data-extraction prompt

A user tells a chatbot to ignore prior instructions and reveal recent orders with customer names, email addresses, and shipping details. The chatbot complies, exposing customer information without database access or an authentication bypass. section 10.0

Prompt hardening cannot reliably prevent disclosure of sensitive information already included in the model’s context. Excluding that information is the fully reliable way to prevent its reproduction. Defensive prompts also require validation when the model or its version changes. section 10.5 section 10.5

How Prompt Engineering in Practice covers it

How deep it goes
Explains trusted versus untrusted input, three attack patterns, and prompt hardening, then identifies limits of prompt-only defenses.
Examples
Demonstrates a user instruction that coaxes a chatbot to reveal customer names, addresses, and contact details.
What it assumes
Builds on system prompts, delimiters, structural boundaries, precise behavioral constraints, and separating stable instructions from variable inputs.
What you can do after
Apply it via prompt design to reduce prompt-level risks, and withhold sensitive data from context when disclosure must be prevented.
How it connects
Connects prompt injection, jailbreaking, instruction conflict, system prompts, delimiters, and prompt templates.

Also explained in

Compare how 2 books explain prompt security →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Prompt Engineering in Practice. The section links point to the parts of the book it draws on.