Blog Post

AI - Azure AI services Blog
2 MIN READ

Protected Material Detection for Code now in Preview in Azure AI Content Safety

kenarcher's avatar
kenarcher
Icon for Microsoft rankMicrosoft
Sep 24, 2024

Today Microsoft announced the launch of Protected Materials Detection for Code, a new feature in the Azure AI Content Safety is a generative AI guardrail that can be used with generative AI applications that generate code. Previously available exclusively in Azure OpenAI Service, this advanced model can now be utilized by developers using a wide range of AI tools, enhancing the protection and detection of intellectual property (IP) in code outputs. 

  

How It Works 

  

The Protected Materials Detection for Code feature compares AI-generated code against a comprehensive database of all public GitHub repositories. If a significant portion of code matches public code, the system will flag the corresponding GitHub repository and provide a citation link, including license details. This allows developers to review the source of the matching code and ensure proper attribution or licensing. 

  

This model operates within Azure AI Content Safety and is designed to work without affecting the performance or experience of generating code. Developers can choose to use the content filter to block content, or annotate content, or leave the filter off. This enables developers to customize how and when code citations and licenses appear in their workflow. 

 

Azure OpenAI Service and Beyond 

  

Protected Materials Detection for Code has already been integrated into Azure OpenAI Service, where  the content filter provides citations and licensing information for code generated by OpenAI’s GPT family of models By adding this feature to Azure AI Content Safety. Microsoft is now enabling this functionality to be used by customers with other generative AI models that generate code. 

  

“We’re excited to offer this feature to a broader range of AI applications,” said Jinrui Shao, Product Manager for Azure AI Content Safety. “This is especially important for developers using AI to generate code, whether for internal applications or public release, as it helps ensure that any code created complies with proper licensing standards.” 

  

Developer Experience and Implementation 

  

Azure AI developers can now take advantage of this feature by simply enabling the model within the Azure AI Content Safety service. The feature is designed to integrate smoothly with existing workflows and can be used in real-time or asynchronous code generation scenarios. 

  

For example, when a code snippet is generated by any AI-driven code application, the system checks the code against its database and provides a detailed annotation if protected materials are detected. This annotation includes: 

  • Whether protected content was detected (yes or no). 
  • Citations for the public GitHub repositories where the code appears. 
  • License information for the matched code, ensuring developers know if and how they can use the code. 

 

 

Get started 

  • Explore our protected material detection for code documentation  
Published Sep 24, 2024
Version 1.0
No CommentsBe the first to comment