Microsoft Azure Text:shield Prompt API

The text:shieldPrompt API from Microsoft Azure, for text:shieldprompt.

GitHub OpenAPI

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /text:shieldPrompt Detect prompt injection attacks in text · Microsoft Azure Analyze Text Prompt Injection Attacks #
Ask an LLM
“How can I tell if a user prompt is trying to jailbreak my LLM app?”
“Can Prompt Shields also scan grounding documents for indirect injection attacks?”
Tell an agent
Check user prompt {prompt} for injection attacks.
Scan prompt {prompt} and documents {documents} for jailbreak or indirect prompt attacks.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure:microsoft-azure-text-shieldprompt-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-text-shieldprompt-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Microsoft Azure ContentSafety Service Text:shield Prompt API
  version: 2024-02-15-preview
  description: Analyze harmful content
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
security:
- ApiKeyAuth: []
- OAuth2Auth:
  - https://cognitiveservices.azure.com/.default
tags:
- name: text:shieldPrompt
paths:
  /text:shieldPrompt:
    post:
      operationId: microsoftAzureTextoperationsDetecttextpromptinjectionoptions
      summary: Microsoft Azure Analyze Text Prompt Injection Attacks
      description: A synchronous API for the analysis of text prompt injection attacks.
      parameters:
      - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyzeTextPromptInjectionResult'
        default:
          description: An unexpected error response.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
      x-ms-examples:
        Analyze text prompt injection attacks:
          $ref: ./examples/DetectTextPromptInjection.json
      tags:
      - text:shieldPrompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyzeTextPromptInjectionOptions'
        description: The text prompt injection attacks analysis request.
        required: true
components:
  schemas:
    Azure.Core.Foundations.Error:
      type: object
      description: The error object.
      properties:
        code:
          type: string
          description: One of a server-defined set of error codes.
        message:
          type: string
          description: A human-readable representation of the error.
        target:
          type: string
          description: The target of the error.
        details:
          type: array
          description: An array of details about specific errors that led to this reported error.
          items:
            $ref: '#/components/schemas/Azure.Core.Foundations.Error'
          x-ms-identifiers: []
        innererror:
          $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
          description: An object containing more specific information than the current object about the error.
      required:
      - code
      - message
    AnalyzeTextPromptInjectionResult:
      type: object
      description: The text injection attacks analysis response.
      properties:
        userPromptAnalysis:
          $ref: '#/components/schemas/TextPromptInjectionResult'
          description: Direct injection analysis result for user prompt input.
        documentsAnalysis:
          type: array
          description: Direct and indirect injection attacks analysis result for documents input.
          items:
            $ref: '#/components/schemas/TextPromptInjectionResult'
          x-ms-identifiers: []
    Azure.Core.Foundations.InnerError:
      type: object
      description: An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
      properties:
        code:
          type: string
          description: One of a server-defined set of error codes.
        innererror:
          $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
          description: Inner error.
    AnalyzeTextPromptInjectionOptions:
      type: object
      description: The text prompt injection attacks analysis request.
      properties:
        userPrompt:
          type: string
          description: The user prompt needs to be analyzed if it attempts to do direct injection attacks.
        documents:
          type: array
          description: The documents needs to be analyzed if they attempt to do direct or indirect injection attacks.
          items:
            type: string
    Azure.Core.Foundations.ErrorResponse:
      type: object
      description: A response containing error details.
      properties:
        error:
          $ref: '#/components/schemas/Azure.Core.Foundations.Error'
          description: The error object.
      required:
      - error
    TextPromptInjectionResult:
      type: object
      description: The text injection attacks analysis response.
      properties:
        attackDetected:
          type: boolean
          description: Analysis result for whether the prompt is classified as an injection attack.
      required:
      - attackDetected
  parameters:
    Azure.Core.Foundations.ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      x-ms-parameter-location: method
      x-ms-client-name: apiVersion
      schema:
        type: string
        minLength: 1
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Ocp-Apim-Subscription-Key
      in: header
    OAuth2Auth:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            https://cognitiveservices.azure.com/.default: ''
          tokenUrl: https://login.microsoftonline.com/common/oauth2/v2.0/token
x-ms-parameterized-host:
  hostTemplate: '{endpoint}/contentsafety'
  useSchemePrefix: false
  parameters:
  - name: endpoint
    in: path
    description: 'Supported Cognitive Services endpoints (protocol and hostname, for example:

      https://<resource-name>.cognitiveservices.azure.com).'
    required: true
    type: string