A fill-in-the-blank attack is a prompt-injection technique that asks a language model to reconstruct forbidden content from partial words or omitted segments. It tests whether contextual completion bypasses the model’s restrictions. section 13.2.1
Partial-word completion test
Mark two prohibited words as X and Y, then ask the model to finish them from context. The demonstrated test uses Mistral’s Le Chat and displays only part of the generation. Treat the result as a security signal, not as a production interaction. section 13.2.1
Figure 13.7 Fill-in-the-middle prompt injection attack
Inspect the supplied figure showing a fill-in-the-middle prompt-injection attack. section 13.2.1
Defensive handling requires validating and sanitizing model responses before passing them to backend functions, then encoding returned output to reduce unintended code execution. section 13.2.1
