access-policies — Claude Code command: what it does, how to install
A command for Claude Code that builds IAM-style access_policies configurations. It defines granular allow and deny rules for Microsoft 365 add-in features.
Apache-2.0 ★ 41,441 updated 2026-09-21
/plugin marketplace add anthropics/financial-services
/plugin install claude-for-msft-365-install@claude-for-financial-servicesWhat access-policies does
The command constructs a JSON list of policy statements governing add-in capabilities. It replaces flat feature blacklists with conditional rules scoped to sensitivity labels or file paths.
Policies gate specific actions. Setting addin.access to deny acts as a document-level kill switch for classified files. The file.upload action restricts attaching sensitive PDFs and Office files, while skills.authoring blocks custom skill creation. A statement without a resource acts globally.
Evaluating labels requires their Purview GUIDs. Admins retrieve them using the ExchangeOnlineManagement PowerShell module with Get-Label. Matching against stable GUIDs prevents policy drift when label names change.
What it helps with
- block the add-in on files bearing strict sensitivity labels
- prevent users from attaching confidential documents to conversations
- disable skill authoring across the entire tenant
- create an allowlist restricting execution to approved Purview labels
Example prompts for the agent
- Generate an access_policies block to disable Claude on Highly Confidential documents
- Deny file.upload for attachments matching our secret label GUID
- Build a default-deny allowlist policy for approved document paths
How to install access-policies
1Plugin marketplace
/plugin marketplace add anthropics/financial-services/plugin install claude-for-msft-365-install@claude-for-financial-services2Manually: put the files in place
.claude/commands/access-policies.mdCall it with /access-policies. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/access-policies.mdCall it with /prompts:access-policies. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/access-policies.prompt.mdManually: put the files in place
.gemini/commands/access-policies.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about access-policies
How to install access-policies in Claude Code?
Add the repository with /plugin marketplace add anthropics/financial-services, then run /plugin install claude-for-msft-365-install@claude-for-financial-services. The command loads from .claude/commands/access-policies.md.
What does access-policies do?
It guides administrators through generating structured JSON access rules for the add-in manifest. Rules evaluate actions against file paths and Purview sensitivity labels.
What is required to configure access-policies?
Label GUIDs from Microsoft Purview are required. Administrators export them via PowerShell with Connect-IPPSSession and Get-Label, through Microsoft Graph Explorer, or from the compliance portal.
Source text
access-policies.md · Apache-2.0
--- description: Build the access_policies value — the granular, IAM-shaped way to allow or deny add-in features --- # 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.access` kill 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): ```powershell # One-time: Install-Module ExchangeOnlineManagement Connect-IPPSSession -UserPrincipalName [email protected] 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"): ```json { "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): ```json { "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"): ```json { "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): ```json { "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`. ```json { "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: ```json [ { "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*"), either list each sublabel's GUID, or 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): ```json { "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 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: ```json { "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/restricted` also 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 (`%20` for 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 an `allow` list, like an unlabeled document. - Only the open document is gated. Uploads have no path, so `file_path` never matches `uploaded_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_path` drop any statement that contains it, so the path rule does not apply on those versions. Keep `file_path` identifiers 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`). 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.
© Anthropic · Apache-2.0 · anthropics/financial-services