Back to Trending
RepositoryPowerShellUSUnited States
microsoft

microsoft/Data-and-Agent-Governance-and-Security-Accelerator

Automate end-to-end AI governance with Microsoft Purview DSPM for AI and Defender for AI. Configure DLP, sensitivity labels, audit logging, and threat detection across M365 Copilot, Microsoft Foundry, Microsoft Fabric, and custom agentic solutions.

79stars
39forks
0issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: governance

#1 Repository of the month

1
TINIX TRENDING·Topic: microsoft-fabric

#1 Repository of the month

1
TINIX TRENDING·Topic: data-security

#1 Repository of the month

Data Agent Governance and Security Accelerator

Enable Microsoft Purview Data Security Posture Management (DSPM) for AI across Microsoft 365 Copilot, Microsoft Foundry, Microsoft Fabric, and custom AI solutions with a spec-driven deployment and governance workflow.

Includes Fabric lakehouse Sensitivity Labels configuration and application through the spec.local.json workflow.


Important Security Notice

This template, the application code and configuration it contains, has been built to showcase Microsoft Azure specific services and tools. We strongly advise our customers not to make this code part of their production environments without implementing or enabling additional security features.

For a more comprehensive list of best practices and security recommendations for Intelligent Applications, visit our official documentation.


Start Here

This accelerator is designed for security, compliance, and data governance teams that need to onboard AI workloads faster, apply consistent controls, and export evidence for audit or regulatory review.

What this accelerator does

  • Configures Microsoft Purview DSPM for AI onboarding and governance automation
  • Governs Microsoft Foundry resources with Defender for Cloud, diagnostics, tagging, and Content Safety integration
  • Supports Fabric workspace and lakehouse sensitivity workflows through spec.local.json
  • Exports audit and compliance evidence for downstream review

What to expect

  • The repo is optimized for governance automation rather than application-only samples
  • The fastest path still includes validation and a few manual follow-up steps in Microsoft Purview and Defender for Cloud
  • Some scenarios require Azure, Purview, and Microsoft 365 permissions that may involve more than one operator

For a first run, use the default azd up experience from a local VS Code environment, devcontainer, or Codespaces session.

Use a different path only when you have a clear reason:

SituationBetter path
You only want to rerun specific modulespwsh ./run.ps1 -Tags ... -SpecPath ./spec.local.json
You need Microsoft 365 compliance steps with MFARun the m365 tag from a desktop PowerShell 7 session
You are productionizing after a successful manual runUse CI/CD or GitHub Actions

Solution Overview Solution overview

This accelerator orchestrates Azure and Microsoft 365 governance artifacts through PowerShell and Azure Developer CLI hooks:

  • Automates Purview DSPM for AI onboarding, policy configuration, scans, and exports
  • Applies Fabric lakehouse sensitivity labels from spec.local.json after validating label resolution
  • Governs Microsoft Foundry projects with Azure Policy, Defender for Cloud, diagnostics, tagging, and Content Safety controls
  • Ships telemetry to Log Analytics and exports auditable evidence for downstream teams

Features

  • Spec-driven DSPM for AI enablement — Use spec.local.json to drive Purview onboarding, scans, policies, tagging, and evidence export
  • Cross-cloud posture telemetry — Stream diagnostics to Log Analytics and connect Defender for AI telemetry with governance workflows
  • Microsoft Foundry governance — Apply Azure Policy, Defender for Cloud, diagnostics, tagging, and Content Safety controls to Foundry resources
  • Fabric sensitivity labels — Configure and apply sensitivity labels to Fabric lakehouse and workspace assets
  • CI and desktop friendly automation — Run azd up for the standard path or run.ps1 for narrower or replayable execution
  • Extensible evidence exports — Reuse audit export, compliance inventory, and tagging flows for downstream regulator or SIEM scenarios

Getting Started

Quick Deploy Quick deploy

Deploy this solution to your Azure subscription using the Azure Developer CLI.

Note: This solution accelerator requires Azure Developer CLI (azd) version 1.9.0 or higher. Please ensure you have the latest version installed before proceeding with deployment. Download azd here.

Note: This solution accelerator also requires Bicep CLI version 0.33.0 or higher for compiling infrastructure templates. Install Bicep.

Click here to launch the deployment guide

Open in GitHub CodespacesOpen in Dev Containers

Before you deploy

Make sure you have:

  • Azure CLI 2.58.0+
  • Azure Developer CLI (azd) 1.9.0+
  • PowerShell 7.x with Az modules
  • Bicep CLI 0.33.0+
  • Access to the target Azure subscription and Purview account
  • Microsoft 365 compliance permissions if you plan to run m365

Review Cost Guidance before deployment if you need to estimate Defender, Log Analytics, Purview, or Foundry-related spend.

How to install or deploy

1. Sign in to Azure

az login
azd auth login
Connect-AzAccount -Tenant <tenantId> -Subscription <subscriptionId>
Set-AzContext -Subscription <subscriptionId>

2. Prepare the spec file

azd up runs a preprovision hook that creates spec.local.json if it does not exist. The scaffold includes the minimum run parameters from your current azd and Azure CLI context and leaves optional sections empty so they can be filled in only when needed.

For a complete reference example, see docs/spec-example.json.

If you prefer to scaffold manually:

Copy-Item ./spec.dspm.template.json ./spec.local.json
# Bash command
cp ./spec.dspm.template.json ./spec.local.json

Then update spec.local.json with the values required for your scenario:

  • tenant ID
  • subscription ID
  • resource group and location
  • Purview account details
  • Microsoft Foundry resource IDs if governing Foundry resources
  • Fabric workspace or lakehouse label settings if using Fabric workflows

Use docs/spec-local-reference.md for field-by-field guidance.

3. Deploy

azd up

4. Complete manual steps

After automation completes, you must still enable several settings that are not fully automatable today.

PortalToggleNavigationPurpose
Defender for CloudEnable user prompt evidenceAzure portal → Defender for Cloud → Environment settings → [subscription] → AI services → SettingsIncludes suspicious prompt segments in Defender alerts
Defender for CloudEnable data security for AI interactionsAzure portal → Defender for Cloud → Environment settings → [subscription] → AI services → SettingsConnects Azure AI telemetry to Purview DSPM for AI
Microsoft PurviewActivate Microsoft Purview AuditPurview portal → DSPM for AI → Overview → Get StartedRequired for audit log ingestion
Microsoft PurviewSecure interactions from enterprise appsPurview portal → DSPM for AI → RecommendationsKYD collection policy for enterprise AI apps

Validate success

After the first run, confirm that:

  • spec.local.json reflects your intended environment
  • Purview and Defender settings were applied for the selected path
  • diagnostics are flowing to the intended Log Analytics workspace
  • expected audit or compliance export artifacts were generated

Use docs/TroubleshootingGuide.md for portal checks and troubleshooting steps.

Need alternative deployment options? See Alternative Deployment Paths for run.ps1 tags, M365 desktop deployment, CI/CD integration, and GitHub Actions workflows.

Something go wrong? See Undo and Rollback for cleanup steps, partial deployment recovery, and azd down guidance.


Guidance

Business Scenario Why this accelerator exists

Organizations deploying AI across Microsoft 365 Copilot, Microsoft Foundry, Fabric, and custom agents need a repeatable way to discover sensitive data exposure, apply governance controls, monitor interactions, and export evidence.

Without automation, this work is spread across multiple portals and repeated for each project. This accelerator captures those requirements in a single spec file and runs a repeatable governance flow across the supported services.

What you get

Click to view the core capabilities provided by this accelerator
CapabilityDescription
Spec-driven DSPM for AI enablementUse spec.local.json to drive Purview onboarding, scans, policies, tagging, and evidence export.
Cross-cloud posture telemetryStream diagnostics to Log Analytics and connect Defender for AI telemetry with governance workflows.
CI + desktop friendly automationRun azd up for the standard path or run.ps1 for narrower or replayable execution.
Extensible evidence exportsReuse audit export, compliance inventory, and tagging flows for downstream regulator or SIEM scenarios.

Solution architecture

Data Agent governance architecture

DSPM for AI and Defender for AI - Features mapping

Environment ComponentSecured AssetProductKey Features
Microsoft FoundryAI interactions (prompts & responses), workspaces, connectionsMicrosoft Purview DSPM for AIDiscovery of AI interactions; sensitivity classification and labeling; DLP on prompts and responses; audit and eDiscovery
Azure OpenAI / Azure MLModel endpoints, prompt flow apps, deploymentsDefender for AIAI-specific threat detection and posture hardening; misconfiguration findings; attack-path analysis
Microsoft Fabric OneLakeTables/files, Lakehouse and Warehouse dataMicrosoft Purview + DSPM for AISensitivity labels; DLP for structured data; label coverage reports; activity monitoring
Cross-estate AIPrompt and response interaction data across Copilot, agents, and AI appsMicrosoft Purview DSPM for AIUnified view of AI interactions; policy enforcement; natural-language risk exploration

How to customize


Resources

Supporting Documentation Supporting documentation

DocumentDescription
Deployment GuideComprehensive step-by-step deployment instructions
Post-Provisioning ValidationPortal-based checklist to verify Purview, Defender, Fabric, Foundry, and M365 settings after provisioning
Alternative Deployment PathsCI/CD integration, run.ps1 tags, M365 desktop deployment, GitHub Actions
Spec File ReferenceField-by-field documentation for spec.local.json
Troubleshooting GuideCommon issues and validation steps
Architecture OverviewTechnical architecture and class diagram
Why DSPM for AI?Value proposition and stakeholder communication
Cost GuidanceBilling models and optimization tips
Script ReferenceRepository script structure and governance module descriptions

Security guidelines

  • Store secrets in Azure Key Vault and pass references through the spec file instead of embedding secrets directly
  • Use managed identities or service principals for automation runs; rotate credentials regularly
  • Enable Microsoft Defender for Cloud across Cognitive Services, Storage, and Container workloads
  • Ensure GitHub secret scanning is enabled if you fork this repo; avoid committing spec.local.json

Provide feedback

Have questions, find a bug, or want to request a feature? Submit a new issue on this repo and we'll connect.


Responsible AI Transparency FAQ

Please refer to TRANSPARENCY.md for responsible AI transparency details of this solution accelerator.


Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications.

To opt out of telemetry:

  1. Set the environment variable AZURE_DEV_COLLECT_TELEMETRY to no before deploying
  2. Set the enableTelemetry parameter in main.bicepparam to false before deploying

Disclaimers

To the extent that the Software includes components or code used in or derived from Microsoft products or services, including without limitation Microsoft Azure Services (collectively, "Microsoft Products and Services"), you must also comply with the Product Terms applicable to such Microsoft Products and Services. You acknowledge and agree that the license governing the Software does not grant you a license or other right to use Microsoft Products and Services. Nothing in the license or this ReadMe file will serve to supersede, amend, terminate or modify any terms in the Product Terms for any Microsoft Products and Services.

You must also comply with all domestic and international export laws and regulations that apply to the Software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit https://aka.ms/exporting.

You acknowledge that the Software and Microsoft Products and Services (1) are not designed, intended or made available as a medical device(s), and (2) are not designed or intended to be a substitute for professional medical advice, diagnosis, treatment, or judgment and should not be used to replace or as a substitute for professional medical advice, diagnosis, treatment, or judgment.

You acknowledge the Software is not subject to SOC 1 and SOC 2 compliance audits. No Microsoft technology, nor any of its component technologies, including the Software, is intended or made available as a substitute for the professional advice, opinion, or judgement of a certified financial services professional. Do not use the Software to replace, substitute, or provide professional financial advice or judgment.

BY ACCESSING OR USING THE SOFTWARE, YOU ACKNOWLEDGE THAT THE SOFTWARE IS NOT DESIGNED OR INTENDED TO SUPPORT ANY USE IN WHICH A SERVICE INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE COULD RESULT IN THE DEATH OR SERIOUS BODILY INJURY OF ANY PERSON OR IN PHYSICAL OR ENVIRONMENTAL DAMAGE (COLLECTIVELY, "HIGH-RISK USE"), AND THAT YOU WILL ENSURE THAT, IN THE EVENT OF ANY INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE, THE SAFETY OF PEOPLE, PROPERTY, AND THE ENVIRONMENT ARE NOT REDUCED BELOW A LEVEL THAT IS REASONABLY, APPROPRIATE, AND LEGAL, WHETHER IN GENERAL OR IN A SPECIFIC INDUSTRY. BY ACCESSING THE SOFTWARE, YOU FURTHER ACKNOWLEDGE THAT YOUR HIGH-RISK USE OF THE SOFTWARE IS AT YOUR OWN RISK.


Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Similar Projects

Discover other similar projects and AI models.

RepositoryPowerShell
microsoft/Deploy-Your-AI-Application-In-Production

A deployment of a secure, extensible and integrated environment for running AI Foundry workloads in Production. It simplifies the process of including essential Azure services necessary to run mission-critical AI applications and adhere to Microsoft Well Architected Framework recommendations.

236
Sep 16, 2026
RepositoryHTML
animetanver-commits/fabric-unified-data-blueprint

Microsoft Fabric Unified Data Foundation with Databricks & Purview 2026

114
Nov 18, 2026
RepositoryMarkdown
DigitalPlatDev/FreeDomain

Free domain registration and practical DNS learning resources for everyone.

209.9k
Aug 12, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryPython
Azure-Samples/azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.

7.8k
Nov 26, 2026
RepositoryPython
microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator

The Multi-Agent Custom Automation Engine Solution Accelerator is an AI-driven system that manages a group of AI agents to accomplish tasks based on user input. Powered by Microsoft Agent Framework, Azure Foundry, Azure Cosmos DB, and infrastructure services, it provides a reference application, allowing you to hit the ground running.

900
Nov 25, 2026
RepositoryC#
Azure-Samples/azure-search-openai-demo-csharp

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.

846
Oct 28, 2026
RepositoryBicep
Azure-Samples/contoso-chat

This sample has the full End2End process of creating RAG application with Prompty and Azure AI Foundry. It includes GPT-4 LLM application code, evaluations, deployment automation with AZD CLI, GitHub actions for evaluation and deployment and intent mapping for multiple LLM task mapping.

768
Oct 3, 2025
RepositoryPython
Azure-Samples/rag-postgres-openai-python

A RAG app to ask questions about rows in a database table. Deployable on Azure Container Apps with PostgreSQL Flexible Server.

512
Nov 24, 2026