liveBook · Manning

Prompt security

Prompt security is the practice of structuring and constraining model inputs to reduce unsafe behavior and protect against attacks delivered through prompts or other inputs.

How 2 Manning books explain it

AI Agents and Applications

A safe prompt is an instruction that restricts a language model to supplied information and directs it to acknowledge when an answer is unavailable.

How it is used
Reduces the chance of hallucinations in Q&A chatbots answering from supplied text.
How deep it goes
Defines a brief instruction and demonstrates it with a factual question about information missing from the supplied text.
Examples
Uses a question about the total columns in three temples, where the text does not give the answer.
What you can do after
Apply it via an instruction to rely only on supplied information and acknowledge when the answer is unavailable.

Read how AI Agents and Applications explains prompt security →

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.

How it is used
Protects model behavior and sensitive information by treating prompt design as a security control.
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 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.

Read how Prompt Engineering in Practice explains prompt security →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.