---
title: "Shield Prompt"
method: POST
path: "/text:shieldPrompt"
---

# Shield Prompt

`POST /text:shieldPrompt`

A synchronous API for shielding prompt from direct and indirect injection attacks.

## Query parameters

- `api-version` string, required

## Request body

- ShieldPromptOptions — The request of analyzing potential direct or indirect injection attacks.
  - `userPrompt` string — The user prompt to be analyzed, which may contain direct injection attacks.
  - `documents` string[] — The documents to be analyzed, which may contain direct or indirect injection attacks.

## Response `200`

The request has succeeded.

- ShieldPromptResult — The combined analysis results of potential direct or indirect injection attacks.
  - `userPromptAnalysis` UserPromptInjectionAnalysisResult — The individual analysis result of potential injection attacks in the given user prompt.
    - `attackDetected` boolean, required — Whether a potential injection attack is detected or not.
  - `documentsAnalysis` DocumentInjectionAnalysisResult[] — Direct and indirect injection attacks analysis result for the given documents.
    - `attackDetected` boolean, required — Whether a potential injection attack is detected or not.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/cognitiveservices-contentsafety.md) · [All operations](https://skmtc.net/azure/apis/cognitiveservices-contentsafety/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/cognitiveservices-contentsafety/versions/d4969093cba0/schema)
