Cookies on this site

We would like to use cookies to understand how the site is used and to measure our campaigns. Nothing is set until you choose, and you can change your mind at any time from “Cookie settings” at the foot of every page. Privacy policy

Contact UsContact Us

Resources / Blogs

AI & agents

Making a Custom AI Agent Compliance-Ready with Microsoft Entra and Microsoft Purview

Learn how Microsoft Entra ID and Microsoft Purview help secure custom AI agents with audit logging, governance, compliance, and DLP controls.

· · 4 min read


Custom AI agents are now common across organizations. Teams build them with tools such as Streamlit, Azure Functions, Copilot Studio, OpenAI, Claude, and other LLM APIs. These agents can answer questions, process documents, summarize information, and help users complete tasks more efficiently.

As organizations expand their use of AI, AI governance, AI compliance, and enterprise AI security have become critical priorities for protecting sensitive data and maintaining regulatory requirements.

But every organization should ask one key question:

How do we track and govern what users ask an AI agent?

If a custom agent runs only locally or relies only on an API key, it may function technically but still fall short of compliance requirements. The organization may have no visibility into who used it, what prompt was submitted, what response was generated, or whether sensitive data was shared.

This is where Microsoft Entra ID and Microsoft Purview matter.

The Problem with a Basic Custom Agent

A basic custom agent typically follows this flow:

image (72)

That may be fine for testing, but it is not sufficient for enterprise use.

The issue is that the agent may lack identity, AI audit logging, policy enforcement, and retention. If a user enters confidential client data, employee information, financial details, or legal content, the organization needs a way to monitor and protect that interaction. Without AI compliance monitoring and governance controls, the agent becomes a blind spot.

What Entra Registration Does

Registering the custom agent in Microsoft Entra ID gives it an official identity within the organization.

Instead of existing only as a local app or script, the agent becomes an enterprise application.

This helps the organization understand:

  • Which application was used
  • Who signed in
  • When it was accessed
  • What permissions it has
  • Which tenant it belongs to

This is the first step toward making the agent secure and manageable. Microsoft Entra authentication helps ensure that only authorized users can access the application, strengthening overall enterprise AI security.

For example, if you build a custom Claude agent with Streamlit, you can register it in Entra so users sign in with their company Microsoft account instead of accessing the app anonymously.

What the Purview SDK Does

Entra gives the agent an identity, but identity alone is not enough.

To make the agent compliance-ready, it must also send AI interaction details to Microsoft Purview.

That is where the Purview SDK or Purview APIs come in.

The SDK can capture and evaluate:

  • User prompt
  • AI response
  • User identity
  • Agent name
  • Timestamp
  • Sensitive data
  • Policy result

This enables Microsoft Purview Compliance capabilities to apply controls such as audit logging, Data Loss Prevention (DLP), eDiscovery, retention, and AI risk management.

Simple Architecture:

blog

In this architecture, the user signs in through Entra, allowing the custom agent to identify them. Before or after the prompt reaches the AI model, the Purview SDK checks and records the interaction. The response is then returned to the user, while the compliance record is stored for review.

Why This Matters

Making a custom agent compliance-ready matters because AI conversations may contain sensitive business data.

For example, users may ask the agent to summarize:

  • Client contracts
  • Employee records
  • Financial reports
  • Legal documents
  • Project documents
  • Internal emails

If this information is not monitored, it can create compliance and security risks.

With Microsoft Purview integration and a strong AI governance framework, the organization can answer key questions such as:

  • Who used the agent?
  • What did the user ask?
  • What did the AI respond?
  • Was sensitive data shared?
  • Was any policy violated?
  • Should the interaction be retained?
  • Can the interaction be searched later for investigation?

These are the questions auditors, security teams, and compliance teams care about.

Entra Registration Alone Is Not Enough

A common mistake is assuming that registering the app in Entra automatically makes the agent fully compliant. It does not.

Entra registration gives the app an identity, but the agent still must integrate with the Purview SDK or Purview APIs to send prompt and response activity to Microsoft Purview.

The complete process is:

  • Register the custom agent in Microsoft Entra
  • Enable user sign-in with Entra authentication
  • Add Purview SDK or Purview API integration
  • Capture prompts and responses
  • Send activity to Microsoft Purview
  • Apply audit, DLP, retention, and compliance policies
  • Review logs in Purview

This approach supports AI data governance, improves visibility, and helps organizations meet regulatory and internal compliance requirements.

Conclusion

A custom AI agent becomes enterprise-ready only when it is secure, traceable, and governed.

Registering the agent in Microsoft Entra ID gives it a trusted identity. Integrating it with the Microsoft Purview SDK enables the organization to capture AI interactions, apply AI compliance policies, perform AI audit logging, monitor user activity, and retain important records.

This turns the custom agent from a simple chatbot into a governed enterprise AI application that supports responsible AI governance and stronger security controls.

For any organization building custom agents with Claude, OpenAI, Azure OpenAI, or other LLMs, this setup is an important step toward responsible AI adoption, AI governance, AI compliance monitoring, and secure enterprise deployment.

← All articles

Case studies

AI Consulting in practice

Client names are withheld. We are happy to share details on a call.

All case studies
  • In production

    Hours → minutes

    Food manufacturing

    AI Consulting

    Document intake agent for a national food cooperative

    A Copilot Studio agent reads certificates of analysis as they arrive in the quality team's inbox, extracts 14 fields with AI Builder, checks them, files the PDF in SharePoint and posts a summary in Teams. Fields it is unsure about go to a person instead of being guessed.

    • Hours of daily filing down to minutes
    • 14 fields per document, validated
  • Internal project

    2,000 → 50 a day

    Public-sector sales

    AI Consulting

    Procurement triage on a local 30B model

    Logs in to five government procurement portals each morning, reads about 2,000 listings, parses the bid documents and emails a short list of the 20 to 50 worth quoting. Every model call runs on one desktop AI system in our office.

    • 2,000 listings down to about 50 a day
    • 11× faster than a 120B model, same verdicts
  • Internal project

    Cited answers

    Food & beverage compliance

    AI Consulting

    FDA regulatory research agent built on Claude

    Food and beverage teams spend hours each week checking FDA sites for regulatory changes. This agent ingests FDA guidance, approval letters and labeling requirements, answers questions with citations to the source passage, compares documents and drafts summaries for review. Built on Claude Sonnet.

    • Every answer cites its source
    • Submission summaries drafted for review

Keep reading

All AI & agents articles

Want an agent like this working on your own data?

Book a 30-minute AI readiness call. We will look at one workflow and tell you what is automatable, what is not, and what the data needs first.