Spotlighting uses delimiters and data marking to help language models distinguish system instructions from untrustworthy external input. It supports enterprise applications that retrieve documents through RAG, where hidden instructions may attempt to alter system rules or gain unauthorized access. section 13.5.1
Prompt Shields applies the technique to:
- User prompts that deliberately attempt to break or change system behavior. section 13.5.1
- External RAG documents containing hidden instructions, role-play requests, encoding attacks, or conversation-manipulation attempts. section 13.5.1
- Prompt and document analysis that returns an attackDetected Boolean for application workflow decisions. section 13.5.1
Shield a prompt and document set
Install azure-ai-contentsafety, submit userPrompt and documents to Azure AI Content Safety's text:shieldPrompt endpoint, and inspect the JSON response. A result can mark both userPromptAnalysis and documentsAnalysis as attackDetected: true.
