Skip to content
Docs

Sensitivity Labels (Third-Party Classification)

Many organizations have already classified their data with a dedicated tool before AI arrives: Microsoft Purview (MIP) sensitivity labels on Office documents, PDFs and email, or a classifier such as Titus, Boldon James or Varonis that writes its own document properties and visual markings. AgentWatch reads those labels on AI traffic and enforces a policy per label, so a document labelled Highly Confidential can be blocked, restricted to approved teams, or allowed only to approved (for example self-hosted) models.

This complements AgentWatch’s own DLP: DLP finds sensitive content with its detectors; label enforcement honours the classification decision your organization already made. Both run on every request.

Source Where the label lives Typical tool
Purview label in a file Word, Excel, PowerPoint: docProps/custom.xml (MSIP_Label_<id>_Enabled/_Name) or docMetadata/LabelInfo.xml; PDF: Info dictionary or XMP metadata (compressed or not); email: the msip_labels header (.eml, .msg) Microsoft Purview / MIP
Document property Any custom Office property or PDF metadata key you name, e.g. Classification = Secret Titus, Boldon James, Varonis, in-house tools
Text marking A marking you name, found in the prompt text or a text attachment, e.g. Sensitivity: Highly Confidential Any tool that stamps a header or footer
Declared by the application The request header X-AgentWatch-Classification: <label>[, <label>…] Your own apps, e.g. a RAG app over a file share
Label-encrypted file An Office file a label encrypted. AgentWatch cannot read inside it, so it reports the file as protected Purview labels with encryption

Files are found in every API shape AgentWatch serves: OpenAI file parts and input_file, Anthropic document blocks, Gemini inline_data, Bedrock document bytes, data URLs, and multipart uploads (/v1/files, Assistants, audio). AgentWatch reads only the label metadata. It does not parse or store the document.

  1. Open Settings → Company Settings and scroll to Sensitivity Labels (third-party classification) (below Custom Regex Guardrails).
  2. Tick Enforce sensitivity labels.
  3. Choose what happens to a label no rule names (Log by default), and to a label-encrypted file (Log by default).
  4. Click Add rule for each label you want to control (see below), then Save label policy.

The policy belongs to the workspace you are in. A super admin with no workspace selected edits the platform default, which applies to every workspace without a policy of its own. A workspace policy replaces the default entirely. Use platform default removes a workspace’s own policy.

Newer Office versions store only the label’s ID in the file, not its name, so rules for Purview labels are best written by ID. The quickest way to get it:

  1. In the same panel, under Inspect a file, choose a document that carries the label.
  2. AgentWatch lists each label it finds, with its name (when the file stores one) and ID, and what the saved policy would do.
  3. Click Add rule beside the label to create a rule pre-filled with that ID.

The file is read in memory and not stored. You can also list your tenant’s label IDs with Get-Label | Select DisplayName, ImmutableId in Security & Compliance PowerShell.

Each rule matches one thing: a Purview label (by ID and/or name), a document property (name, and optionally a value), or a text marking. Then:

Setting Effect
Action: Block Every request carrying the label is refused
Action: Log Served; the usage row records the label
Action: Allow Served and not recorded (e.g. Public)
Only these teams Any other team is refused; the listed teams get the rule’s action
Only these models Any other model is refused; prefix* matches a family, e.g. interplay-*
Only these directory groups Anyone not in a listed group is refused. Groups are the ones your identity provider sent at the person’s last SSO or LDAP sign-in (see below)
Require entitlement Served only when a trusted application confirms the user is entitled to the label (see below)

Rules are checked in order and the first rule naming a label decides it. When a request carries several labels, the most restrictive outcome wins, so one Highly Confidential attachment beside a Public one decides the request.

A common policy for self-hosted deployments:

Label Action Only these teams Only these models
Public, General Allow
Confidential Log
Highly Confidential Log Legal, Finance interplay-* (self-hosted)
Restricted Block

Text markings are matched case-sensitively and as whole words, because a case-insensitive CONFIDENTIAL would also refuse ordinary sentences like “keep this confidential”. Prefer the exact marking your tool stamps, such as Sensitivity: Highly Confidential.

How do I restrict a label to directory groups?

Section titled “How do I restrict a label to directory groups?”

Use Only these directory groups on a rule and list the groups as your identity provider sends them. The field suggests the values AgentWatch has already received. Matching is tolerant: an Entra object ID (with or without braces), a display name, a DN such as CN=SG-Finance,OU=Groups,DC=acme,DC=com and ACME\SG-Finance all match the same group, but SG-Finance does not match SG-Finance-Contractors.

These are usually the same groups your file-share permissions are built on, so a rule like Highly Confidential → only SG-Finance mirrors who may open those files.

Membership is the groups claim at the person’s last SSO (OIDC/SAML) or LDAP sign-in. It is recorded on every sign-in and replaced each time, so someone removed from a group loses access at their next sign-in. Two consequences:

  • Someone who has never signed in with SSO (for example, an API-key-only service user) has no recorded groups and is refused by a group-restricted rule. The message says their membership is not known.
  • Your IdP must send a groups claim. Entra sends none until you add one under Token configuration → Add groups claim.

SCIM provisioning maps groups to teams, so for SCIM-provisioned users restrict by team instead.

Can AgentWatch enforce the file share’s own permissions (ACLs)?

Section titled “Can AgentWatch enforce the file share’s own permissions (ACLs)?”

Not by itself. A file’s permissions live on the file server (NTFS, SMB, NFS, ONTAP, SharePoint), not in the file, so a request carries no ACL for AgentWatch to read. The application that retrieved the content can check those permissions, though, and AgentWatch can require it to say so:

  1. Mark the label’s rule Require entitlement from a trusted app.
  2. In your retrieval application (for example a RAG service over a file share), check the end user’s access to each source document as usual, then send the labels the user is cleared for:
Terminal window
curl https://agentwatch.example.com/v1/chat/completions \
-H "Authorization: Bearer ak_SERVICE_KEY..." \
-H "X-AgentWatch-User: pat@acme.com" \
-H "X-AgentWatch-Classification: Highly Confidential" \
-H "X-AgentWatch-Entitlement: Highly Confidential" \
-H "Content-Type: application/json" \
-d '{"model":"interplay-coder","messages":[{"role":"user","content":"Using the retrieved passages: ..."}]}'

X-AgentWatch-Entitlement is honoured only from a service key (a key marked Service under Delegated Identity). From an employee’s personal key it is ignored, so an employee cannot clear themselves, and the row is tagged dlp_entitlement: ignored: not a service key so you can see the attempt. An entitlement adds a requirement; it never overrides a Block action or a team, group or model restriction. Served rows carry the asserted labels in the dlp_entitlement tag.

An application that retrieves already-classified data, such as a RAG app indexing an ONTAP or SharePoint file share, puts the document’s text in the prompt, so no file reaches the gateway. The application knows the label, so it declares it:

Terminal window
curl https://agentwatch.example.com/v1/chat/completions \
-H "Authorization: Bearer ak_..." \
-H "Content-Type: application/json" \
-H "X-AgentWatch-Classification: Highly Confidential" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Summarise the retrieved passages: ..."}]}'

The header takes label names or Purview label IDs, comma-separated. A caller can only make its own request more restricted with it. Leaving the header out never removes a label found in a file. Untick Honour labels declared in the X-AgentWatch-Classification header to ignore it.

The request never reaches the model. The caller receives HTTP 403 in its own API’s error shape:

{
"error": {
"message": "Request blocked: \"board.docx\" (labelled \"Highly Confidential\") may not be sent to model 'gpt-4o'; allowed: interplay-*.",
"type": "permission_error",
"param": null,
"code": "sensitivity_label_blocked"
}
}

On /v1/messages the body is Anthropic-shaped ({"type":"error","error":{...,"code":"sensitivity_label_blocked"}}). SDKs treat 403 as final and do not retry.

  • Usage Insights → Audit Trail: a refused request is a Blocked row with block code sensitivity_label_blocked. Its preview names the label and file, for example [blocked: sensitivity label "Highly Confidential" on "board.docx"]. It never contains the refused content.
  • A served request whose label is set to Log carries the tag dlp_sensitivity_label (filter on it in the audit trail’s Header/Tag filter). Callers cannot set or remove this tag.
  • Settings → Audit Logs: dlp.sensitivity_label_policy_updated / _removed for every policy change (who, what changed), and policy.sensitivity_label_blocked for refusals (throttled per employee).

To verify after saving a policy, attach a labelled file to a request from an employee key. With a Block rule you should get the 403 above and see the Blocked row within a few seconds.

All require a company administrator. A super admin may add ?organizationId=<id>; without it, the platform default is used.

Method Path Purpose
GET /api/admin/dlp/sensitivity-labels The policy in force for this workspace, and its teams
PUT /api/admin/dlp/sensitivity-labels Save { "policy": { "enabled", "unknownLabelAction", "protectedFileAction", "acceptHeader", "rules": [...] } }
DELETE /api/admin/dlp/sensitivity-labels Remove the workspace’s own policy (follow the platform default)
POST /api/admin/dlp/sensitivity-labels/inspect { "fileName", "data": "<base64>" } → labels found and what the policy would do

A rule is { "label", "match": { "labelId" | "labelName" | "propertyName" [+ "propertyValue"] | "marker" }, "action": "allow"|"log"|"block", "allowTeams": [teamId…], "allowGroups": [group…], "allowModels": [model…], "requireEntitlement": false }. Saving refuses a malformed label ID (INVALID_LABEL_ID), a rule that matches nothing (EMPTY_LABEL_RULE), a team outside the workspace (UNKNOWN_TEAM), and team restrictions on the platform default (TEAMS_REQUIRE_WORKSPACE), because each would otherwise save a rule that is never enforced.

  • It does not read file-system permissions. AgentWatch does not read the access-control lists on the share a file came from (NTFS, ONTAP, SharePoint). It enforces your label policy per team, directory group and model, and it can require a trusted application to confirm the user’s entitlement after checking those ACLs itself (see above).
  • Directory groups are as of the last sign-in, not a live directory lookup.
  • Text copied out of a document loses its file label. If someone pastes the text without the marking, there is no label to find. AgentWatch’s own DLP still scans that text. Text-marking rules catch content that kept its marking.
  • A label-encrypted file cannot be read. It is reported as protected and follows the label-encrypted file setting.
  • A file sent by reference (a file_id from an earlier upload) is checked at upload, not again when referenced.
  • Not covered: images (no label metadata), browser chats captured by AgentWatch Connect, and super-admin console sessions (they skip gateway policy checks, as for rate limits).
  • Up to 32 attachments and 64 MB per file are read per request. Beyond that the remainder is not inspected.
Symptom Cause Fix
A labelled document is served Policy not enabled, or the label has no rule and no-rule is Log Tick Enforce sensitivity labels; add a rule by ID via Inspect a file
A rule by name never matches a Purview document The file stores only the label ID (newer Office) Write the rule by label ID
403 sensitivity_label_blocked “…may only be sent by approved teams” The employee is not in a team listed on the rule Add their team, or move them into a listed team
…may only be sent to approved models, and this request's model could not be determined The request names no model and the rule restricts models Send model in the request
Saving fails with TEAMS_REQUIRE_WORKSPACE Team restrictions on the platform default Open the workspace and set them there
A text-marking rule never fires Marking typed in a different case, or part of a longer word Copy the exact marking your tool stamps
“…your group membership is not known (sign in with SSO to refresh it)” No groups recorded for this person: never signed in with SSO, or the IdP sends no groups claim Have them sign in to the console with SSO; add a groups claim in the IdP
“…requires the application to confirm you are entitled to it…” The rule requires an entitlement and none was sent by a service key Send X-AgentWatch-Entitlement from the retrieval app’s service key
Row tagged dlp_entitlement: ignored: not a service key The entitlement header came from a personal key Mark the application’s key as a Service key, or send it from one