Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Prompt injection attacks pose a significant risk for generative AI apps. Bad actors craft malicious input to make a large language model (LLM) ignore instructions, expose sensitive data, perform unintended actions, or generate harmful content.
AI Gateway, part of Microsoft's Security Service Edge (SSE) solution, safeguards generative AI applications, agents, and language models. The Prompt Shield capability provides real-time protection against malicious prompt injection attacks, a top risk for LLMs. By enforcing guardrails at the network level, Prompt Shield ensures consistent security across all generative AI applications without the need for code changes.
Prompt Shield:
- Blocks adversarial prompts and jailbreak attempts before they reach AI models.
- Prevents unauthorized actions and sensitive data exfiltration.
- Works across any device, browser, or application for uniform enforcement.
High-level architecture
Important
The Prompt Shield feature is currently in PREVIEW.
This information relates to a prerelease product that might be substantially modified before release. Microsoft makes no warranties, expressed or implied, with respect to the information provided here.
Prerequisites
To complete the steps in this process, you must have the following prerequisites in place:
- A valid Microsoft Entra Internet Access license. If needed, you can purchase licenses or get trial licenses.
- One or more devices or virtual machines running Windows that are either Microsoft Entra joined or hybrid joined to your organization's Microsoft Entra ID.
- To configure Global Secure Access settings, you need the Global Secure Access Administrator role.
- To configure Conditional Access policies, you need the Conditional Access Administrator role.
Initial configuration
To configure Prompt Shield for your organization, complete the following steps:
- Enable the Internet Access traffic forwarding profile and configure the appropriate user assignments.
- Configure Transport Layer Security (TLS) inspection settings and TLS Inspection policies.
- Install and configure the Global Secure Access client on user devices. Follow the steps in Install the Global Secure Access client for Microsoft Windows.
Important
Before you continue, test and ensure your client’s internet traffic is routed through the Global Secure Access service.
Create a new prompt policy to scan prompts
To create new prompt policies for Prompt Shield protection:
- Sign in to the Microsoft Entra admin center as a Global Secure Access Administrator.
- Browse to Global Secure Access > Secure > Prompt policies.
- Select Create policy.
- On the Basics tab, enter a Name and Description for the policy.
- Select Next.
- On the Rules tab, select Add rule.
- On the Prompt rule page:
- Select + Conversation scheme to choose the target LLMs for your enterprise generative AI.
- From the Type menu, select the language model that matches your app.
- If the language model isn't on the list:
- Select Custom.
- Enter the URL of the service endpoint where the prompts are sent.
- Enter the JSON path for the prompt location in the request body.
- Select Add to add the Conversation scheme. You can add multiple schemes.
- Select Next.
- To create the prompt policy, select Create.
Link the prompt policy to your security profile
After you create the Prompt Shield prompt policy, link it to a new or existing security profile.
- Browse to Global Secure Access > Secure > Security profiles.
- Select or create the security profile you want to link the prompt policy to.
- Select the Link policies tab.
- Select + Link a policy > Existing prompt policy.
- Select the Prompt Shield prompt policy you created earlier.
- To link the Prompt Shield prompt policy, select Add.
Create a Conditional Access policy
To create a Conditional Access policy:
- Sign in to the Microsoft Entra admin center as at least a Conditional Access Administrator.
- Browse to Entra ID > Conditional Access.
- Select Create new policy.
- Enter a name for your policy.
- Select Users to specify the users or groups that the policy applies to.
- Set the Target resources to All internet resources with Global Secure Access.
- Configure the Network, Conditions, and Grant settings as needed.
- For Session, select Use Global Secure Access Security Profile and choose the security profile you created earlier.
- Select Create to create the Conditional Access policy.
For more information, see Create a Conditional Access policy targeting Global Secure Access internet traffic.
Generative AI models
The following sections list more details about the AI models that work with Prompt Shield.
Top supported generative AI models
Prompt Shield is preconfigured with custom extractors for the following models: Copilot, ChatGPT, Claude, Grok, Llama, Mistral, Cohere, Pi, and Qwen.
Custom model support
You can protect any custom JSON-based LLM or GenAI app by configuring a custom type model with a URL and JSON path.
Rate limits
- The system applies rate limits when scanning requests for specified conversation schemes.
- When the system reaches the rate limit, it blocks subsequent requests.
- To optimize the performance for custom LLMs, specify the exact URL and JSON path for each scheme.
Known limitations
- Prompt Shield currently supports only text prompts. It doesn't support files.
- Prompt Shield supports only JSON-based generative AI apps. It doesn't support apps that use URL-based encoding, like Gemini.
- Prompt Shield supports prompts up to 10,000 characters. Anything longer is truncated.