April 2026
Intermediate
395 pages
13h 22m
English
When working with LLMs, you must consider safety and security before you can deploy any system to production. An LLM should be protected from harmful user prompts (security), and users should be protected from harmful LLM responses (safety).
Figure 3.14 shows the pipeline from a user prompt that is first passed to an input firewall that checks for prompt security. Then, the prompt is further processed by the LLM before the output firewall checks whether the model response is safe and can thus be provided to the user.
Figure 3.14 LLM Safety and Security
Let’s study both aspects in more detail, starting with the input ...
Read now
Unlock full access