Configure access_policies
Build the access_policies value — the granular, IAM-shaped way to allow or deny add-in features
Works with
claude-code (native)
Content
Configure access_policies
access_policies is the add-in's access-control mechanism going forward: a JSON list of allow/deny statements — IAM-shaped — that decide which features are available and under what conditions. Where disabled_features is a single flat list — a feature is on or off for everyone — access_policies gives you the same off switch *plus* conditions and effects:
| Want | disabled_features | access_policies | |---|---|---| | Turn a feature off for everyone | ✔ disabled_features='skills.authoring' | ✔ a resource-less deny statement (same effect) | | Turn a feature off only on certain documents | ✗ | ✔ add a resource (e.g. a sensitivity label) | | Turn a feature off *except* for approved documents (allowlist) | ✗ | ✔ "effect": "allow" | | Attribute the block in UI copy / telemetry | limited | ✔ per-statement description and source |
A statement with no resource is exactly disabled_features — so anything you'd put there, you can put here. The resource is what adds granularity, and its type is the extension point: today the resource is a document (open_file, uploaded_file) identified by its Microsoft Purview sensitivity label or, for the open document, by its file path; further resource types plug into the same shape without a new config key. New deployments should start here; disabled_features remains supported for the simple flat case.
Two document-conditioned controls have worked examples in step 2:
- Whether the add-in runs at all on an open document (the
addin.accesskill switch), keyed off the open document's label or its path. - Whether a file may be attached as an upload (
file.upload), keyed off the *attached* file's own label — Office files and PDFs.
Every other feature can also be scoped to the open document: a deny turns it off while a matching document is open.
Walk the admin through the four steps below, then hand the finished JSON to [manifest](manifest.md#access_policies) as one more key.
1. Get the label GUIDs
Skip this step if every rule matches on a file path (step 2) rather than a label.
Statements match on the label's GUID (mip_label_guid) — stable across renames and locales. Have the admin pull their taxonomy once with the Purview compliance PowerShell module (no app registration needed; it uses Microsoft's first-party sign-in):
# One-time: Install-Module ExchangeOnlineManagement
Connect-IPPSSession -UserPrincipalName admin@theirtenant.com
Get-Label | Sort-Object Priority | Format-Table Priority, DisplayName, Name, Guid, ParentId
Ask them to paste the table. From it, note for each label they care about: Guid (what you'll match), DisplayName, and ParentId (non-empty means it's a *sublabel* — see the parent-label rule below).
If they can't run PowerShell, GUIDs are also visible in the Purview compliance portal URL when a label is opened for editing, or via Microsoft Graph Explorer (GET /security/informationProtection/sensitivityLabels).
2. Choose the statements
Ask which of these shapes they need — most tenants want the first, second, or both. Then substitute their GUIDs.
Block the add-in on documents with a given label (the common ask — "Claude must not run on our top-secret files"):
{
"effect": "deny",
"action": "addin.access",
"resource": {
"type": "open_file",
"identifiers": [{ "type": "mip_label_guid", "equals": "<guid>" }],
"description": "Highly Confidential"
}
}
Block the add-in on documents in a given location (for files that can't carry a label, such as those on a network share — see the path rule below):
{
"effect": "deny",
"action": "addin.access",
"resource": {
"type": "open_file",
"identifiers": [{ "type": "file_path", "startsWith": "//fileserver/restricted/" }],
"description": "Restricted share"
}
}
Refuse uploading files that carry a given label ("users may not attach restricted files"):
{
"effect": "deny",
"action": "file.upload",
"resource": {
"type": "uploaded_file",
"identifiers": [{ "type": "mip_label_guid", "equals": "<guid>" }],
"description": "Confidential - Restricted"
}
}
Turn a feature off for everyone (the disabled_features equivalent — no resource, so it applies everywhere; here, no user may author skills):
{ "effect": "deny", "action": "skills.authoring" }
Allowlist — the add-in runs only on approved labels. The first allow written for an (action, resource type) flips that scope to default-deny: only files matching an allow's identifiers pass, and unlabeled files no longer pass either. A matching deny still wins over a matching allow.
{
"effect": "allow",
"action": "addin.access",
"resource": {
"type": "open_file",
"identifiers": [
{ "type": "mip_label_guid", "equals": "<general-guid>" },
{ "type": "mip_label_guid", "equals": "<public-guid>" }
]
}
}
Combine as needed — the value is one JSON array of statements. action also accepts an array to apply one statement to several actions:
[
{ "effect": "deny", "action": "addin.access", "resource": { ... } },
{ "effect": "deny", "action": ["file.upload", "skills.authoring"] }
]
Statement grammar (reference)
statement := { effect, action, resource? }
effect := "allow" | "deny"
action := <slug> | [ <slug>, ... ] # feature slugs; unknown -> skipped + reported
resource := { type, identifiers: [identifier, ...], description? }
type := "open_file" | "uploaded_file" # the extension point
identifier := { type: "mip_label_guid" | "mip_label_name" | "file_path", <one operator> }
| action slug | Gates | Takes a resource? | |---|---|---| | addin.access | Whether the add-in runs at all on the open document — the kill switch | open_file | | file.upload | Whether a file may be attached to the conversation | uploaded_file, open_file | | skills.authoring | Creating, editing, and uploading skills; running admin-provisioned skills is unaffected | open_file | | thumbs | Response feedback (thumbs up / down and the follow-up prompt) | open_file | | web_search | The built-in web search and web fetch tools and the user-facing web-search toggle; code execution is unaffected | open_file | | permission_mode.accept_all_edits | The "Accept all edits" and "Skip all permissions" modes; users in either go back to "Ask before edits". Connector (MCP) "Always allow" choices are unaffected | open_file | | permission_mode.dangerously_always_allow | The "Dangerously always allow" button and the "Skip all permissions" mode it switches to; users in that mode move to "Accept all edits", or "Ask before edits" if permission_mode.accept_all_edits is denied too | open_file |
Unknown slugs are skipped and reported — forward-compatible. A resource-less statement works with any slug. Every slug can scope to open_file; uploaded_file is evaluated only for file.upload. A feature named in an open_file statement stays off, whether or not the document matches, until the add-in has read the open document's label, and stays off if the label can't be read.
| Operator | Value | Semantics | |---|---|---| | equals | string | GUID: case-insensitive. Name: exact, case-sensitive. Path: see the path rule | | startsWith | string | prefix match — mip_label_name (see the parent-label rule) and file_path | | endsWith | string | suffix match — mip_label_name only | | exists | boolean | presence check — false = unlabeled, true = any label |
Exactly one operator per identifier; mip_label_guid supports only equals and exists, file_path only equals and startsWith. A resource needs at least one identifier — an empty identifiers array never matches. Statements OR together; identifiers within a resource OR together; a matching deny beats a matching allow; the first allow for an (action, resource type) flips that scope to default-deny. description is inert prose (surfaced in UI copy / telemetry, never matched).
3. Rules to explain before they ship it
Tell the admin these six things before they ship; each is a common surprise.
A statement does exactly what it says — nothing is implied. Blocking the add-in on a label (addin.access on open_file) does *not* also stop that document from being uploaded into a *different* document, and vice versa. A label blocked "in all its forms" is two statements — one on open_file, one on uploaded_file. Statements, and the identifiers within each, OR together.
Parent labels have no GUID inside a file — only sublabels do. A document carries its sublabel's GUID (the row with a ParentId). To block a whole parent group ("everything under *Confidential*"), list each sublabel's GUID. To also catch sublabels added later, where the file carries the label's name, add a match on the composed display name, which Office writes as "Parent - Sublabel" (include the - separator in the prefix so a sibling label like *Confidentiality Waiver* doesn't also match):
{ "type": "mip_label_name", "startsWith": "Confidential - " }
Name matching is exact and rename-hazardous. mip_label_name compares the label's display name character-for-character — case-sensitive, whitespace included — as the labeling client wrote it, in that user's locale. equals, startsWith, and endsWith are available. Prefer GUIDs; use names only for the parent-group case above, and tell the admin a rename breaks the match.
A rule that compares names also can't match a label stored only in docMetadata/LabelInfo.xml, which holds the label's GUID but not its name. Office can store labels there rather than in the document's custom properties once the tenant turns on co-authoring for files with sensitivity labels. A deny by name alone then lets the file through, and an allow by name alone doesn't admit it. Pair every name rule with the label's mip_label_guid in the same resource (for a parent group, each sublabel's GUID); the build script warns on a statement that has a name rule and no GUID rule.
A label the add-in can't read fails closed. When any statement targets uploaded_file, an attachment whose label is unreadable — a Purview-*encrypted* package, or legacy .xls / .ppt / .doc — is refused rather than let through. If their sensitive labels apply encryption, that's the behavior they want; if they must upload legacy formats, they'll need to convert them.
"Only classified documents" — to make the add-in refuse *unlabeled* files, match on presence rather than a GUID:
{ "type": "mip_label_guid", "exists": false }
On uploaded_file this also matches formats that can't carry a label at all (images, CSV, plain text) — say so, so they aren't surprised when a screenshot is refused.
A path rule matches the path exactly as Office reports it. file_path compares against the open document's path or URL as the Office host spells it, with three normalizations only: ASCII letters are case-folded, \ and / are the same separator in Windows paths ("//fileserver/restricted/" and "\\\\fileserver\\restricted\\" are the same prefix — the forward-slash form avoids JSON escaping), and a file: URL is read as the path it names. Beyond that:
- End every prefix with a separator —
//fileserver/restrictedalso matches//fileserver/restricted-archive/. - Nothing resolves aliases. The same share reached through a mapped drive letter, a DFS namespace, or another server name is a different path — add each spelling as another identifier.
- SharePoint and OneDrive documents report a percent-encoded URL (
%20for a space); write the prefix encoded the same way. Non-ASCII characters must match exactly. - A document with no path — unsaved, or one Office can't report a path for — never matches a
deny, and is refused under anallowlist, like an unlabeled document. - Only the open document is gated. Uploads have no path, so
file_pathnever matchesuploaded_file. A document saved to a new location is judged by the new path once the pane regains focus. - Add-in versions released before
file_pathdrop any statement that contains it, so the path rule does not apply on those versions. Keepfile_pathidentifiers in their own statements so an older version still applies the label rules.
4. Validate and hand off
Read the finished array back to the admin as a table (effect / action / resource / identifiers) before generating anything. Then pass it to [manifest](manifest.md#access_policies) as the access_policies key. The build script rejects a value that isn't valid JSON and warns on each statement that doesn't fit the grammar above (bad effect, unknown resource / identifier type, missing or duplicate operator, a file_path on uploaded_file), or that has a name rule and no GUID rule beside it. Fix every warning now: the add-in reports unknown action slugs and an unparseable value, but a statement that fails the grammar is dropped silently — this build-time check is the only catch, and the admin would otherwise ship a rule that quietly never applies.
access_policies belongs in the manifest or bootstrap — it is not one of the eight keys Anthropic's Entra app carries as extension attrs, and more than one statement soon outgrows an attr's 256-char cap anyway (see [update-user-attrs](update-user-attrs.md)). If they use per-user [bootstrap](bootstrap.md), the same array goes there as a native JSON value rather than a string.
Source and license
- Source
- Anthropic Financial Services
- Original
- anthropics/financial-services/claude-for-msft-365-install/commands/access-policies.md
- License
- Apache-2.0