Does azure-ai-contentsafety client library have functionality to call promptShield and protectedMaterialDetection endpoint? If not when will it come?

Nitish Gautam 0 Reputation points
2024-11-18T06:52:24.8666667+00:00

Does azure-ai-contentsafety client library have functionality to call promptShield and protectedMaterialDetection end? If not when will it come? I want to call Azure AI content safety services' promptShield and protectedMaterial endpoint through Azure content safety client

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,948 questions
Azure AI Content Safety
Azure AI Content Safety
An Azure service that enables users to identify content that is potentially offensive, risky, or otherwise undesirable. Previously known as Azure Content Moderator.
25 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vinodh247 24,811 Reputation points MVP
    2024-11-18T06:56:26.0866667+00:00

    Hi Nitish Gautam,

    Thanks for reaching out to Microsoft Q&A.

    As of now, the Azure AI Content Safety client library does not support direct methods to call the promptShield and protectedMaterialDetection endpoints. To utilize these features, you can make HTTP requests to the respective REST APIs. For promptShield, refer to the Prompt Shields documentation, and for protectedMaterialDetection, consult the Protected Material Detection guide.

    Regarding the integration of these endpoints into the client library, there is no official announcement or timeline available at this moment. For the most current information, please monitor the Azure AI Content Safety documentation and the Azure AI services blog.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.

    0 comments No comments

  2. navba-MSFT 26,115 Reputation points Microsoft Employee
    2024-11-21T06:24:33.1066667+00:00

    @Nitish Gautam Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    .

    Updated:
    Currently we haven't provided SDK for Prompt Shield and Protected Material. However, as a workaround you can use REST APIs to access these APIs. The API documentations can be found in APIs: Details - Microsoft Azure API Management - developer portal

    .

    If the support is released in future, we will update our documentation. Currently we don't have any ETA on this.

    .

    The below sample code should help on below scenarios:

    1. Protecting the LLM against Jailbreak attacks using Prompt Shield
    2. Protecting the LLM against Indirect Attacks (malicious instructions that have been injected in a RAG scenario) using Prompt Shield

    Sample code: https://github.com/Azure/azure-openai-samples/blob/main/use_cases/AI_content_safety/0-rai-policy-management-and-prompt-shield.ipynb

    .

    Hope this helps.
    .
    **

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.