{
  "schema": "aaes/capability-pack/1",
  "provider": "sharepoint",
  "version": "1.0.0",
  "description": "Read SharePoint libraries and OneDrive metadata through Graph v1.0; replace file content, create sharing links and delete items. Content downloads are excluded.",
  "notes": "SITE_ID, USER_ID, DRIVE_ID, ITEM_ID and SEARCH_TEXT in paths are placeholders. Before enabling, substitute the concrete site, user, drive and item each registration may access; encode search text as an OData string literal and URL path component. Never enable the literal placeholders. The host stays graph.microsoft.com. The drive/item routes serve both SharePoint document libraries and OneDrive; site drives lists libraries, while user drives discovers a user's drives. No /me route is registered, so application and delegated bindings use explicit ids.\n\nThe API tables name Files.Read as the least delegated permission and Files.Read.All as the least application permission for every registered read. Writes need Files.ReadWrite delegated or Files.ReadWrite.All application. Sites.Read.All and Sites.ReadWrite.All are documented alternatives, not narrower defaults. Delegated access acts as one signed-in user within that user's access; application access has no user and can span the tenant. Consent only the permissions for enabled capabilities.\n\nReview Selected scopes before granting tenant-wide access: Sites.Selected, Lists.SelectedOperations.Selected and Files.SelectedOperations.Selected require consent, an explicit resource grant to the application with a suitable role, and a token containing the scope. Grant sites through the site's permissions collection, lists through the list's permissions collection, and files through the driveItem permissions collection. These setup operations are not agent capabilities in this pack. Item/list grants break inheritance. The search method explicitly does not support the Sites.Selected application permission; remove search for that deployment and verify every other selected-scope operation against its tenant before enabling it. The method-table minimums above do not establish universal Selected-scope compatibility.\n\nOnly existing-file simple upload is registered (update at R2); send the raw file stream with the documented Content-Type: text/plain. Microsoft limits this single-call upload to 250 MB. Replacing a sensitivity-labelled file with application-only authentication is unsupported. Children listing defaults to 200 entries per page; this is a default, not a declared maximum. Permission reads expose only the permissions visible to the caller and are not a full access audit. Version retention depends on tenant settings.\n\ncreateLink declares update and share at R3: retainInheritedPermissions=false can remove existing permissions on the first share; the body is not restricted to a particular link type or scope. Anonymous links may expose content outside the organization. Delete moves an item to the recycle bin, not permanent purge; delete still carries the designated irreversible action at R3. Sharing cannot undo disclosure. On supported AAES-mediated execution paths, irreversible actions require approval by an authorized person; this does not prevent calls through bypass or observation-only paths.\n\nGET file content is excluded. Graph documents /content returning 302 to a short-lived preauthenticated download URL, potentially on a different host. The executor does not follow redirects or confirm 3xx responses, and the metadata downloadUrl is not a same-host content alternative. Do not fetch or expose such URLs as an implicit second capability. Metadata may contain sensitive links and must be handled as pii.\n\nExcluded: new-file uploads, upload sessions, content downloads and conversion, copying, moving, general metadata writes, folder creation, invites, application permission provisioning, permission update/delete, version content/restore/delete, recycle-bin restore/permanent purge, delta, subscriptions, batching, beta APIs, SharePoint Embedded and sovereign-cloud hosts. Drive metadata, root and special-folder shortcuts, analytics/activities, followed/recent/shared-with-me views, follow/unfollow, thumbnails, previews, checkin/checkout/discard, sensitivity/retention labels, record locks, sharing-link grant revocation and WebSocket channels are also excluded. Only the listed Graph v1.0 operations are registered.\n\nSchema 1 has no per-capability size/type limits or result-mode fields. By default the executor digests and discards the response body under MaxResponseBytes. Returning bytes to an agent requires a deployment registration with result mode inline_bounded: ResultMaxBytes caps decoded bytes (default 256 KiB) and ResultContentTypes allowlists media types. For pii data this registration also requires the accountable owner and reason in result_ack_owner and result_ack_reason; no acknowledgement is supplied by this draft. Oversized or disallowed inline results are refused, not truncated. Neither vendor limits nor these notes enforce an upload payload cap. The deployment must bound uploads and select data handling appropriate to its contents; pii is a starting classification, and sensitive estates must raise it. Caller query parameters do not change the dialed URL: reviewed query values and pagination tokens must be bound into the registered endpoint through deployment change control. Collection responses can be incomplete; this pack supplies no automatic pagination or completeness check.\n\nOpen custody review, pending owner: delegated versus application flow; token audience, permissions and resource grants; renewal ownership; revocation delay; executor access, custody-source errors, logs, memory and crash handling; bypass paths; and live tenant verification. Documentation review and synthetic fixtures do not close that review.",
  "credential": {
    "secret_ref_id": "secret-ref-sharepoint-access-token",
    "custody": "customer_vault",
    "inject": "header",
    "inject_name": "Authorization",
    "note": "Store only the complete Authorization header value, 'Bearer <token>', where <token> is a Microsoft Graph OAuth 2.0 access token minted by an external token process for the deployment's app registration. It must never be a refresh token, ID token, client secret, certificate/private key, authorization code or token-response JSON. The external process owns obtaining consent and resource grants, minting, expiry monitoring and atomic replacement in the customer's vault; this schema 1 pack performs no OAuth exchange or refresh.\n\nFor delegated user access use the authorization-code flow, with offline_access if refresh is required; refresh tokens remain with that process. For application access use client credentials at POST https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token with scope https://graph.microsoft.com/.default; that flow issues no refresh token, so obtain a new access token. TENANT_ID is an external token-process substitution, not a registered endpoint. Default access-token lifetime is variable (normally 60 to 90 minutes); use the actual expiry from issuance, not a fixed assumed hour.\n\nRevoke delegated consent/sessions or application consent and resource grants through the tenant's administration process. Rotating/removing an application credential blocks future minting with that credential; do not assume it invalidates an already minted access token. Remove Selected resource grants to withdraw that access. Treat revocation propagation and residual token validity as an open deployment review, not an instantaneous cut-off guarantee.\n\nResolve the stored header only at execution. The custody source must never include material in errors. Verify executor-only access, redaction, traces, memory and crash-dump handling in the deployment; this pack cannot establish those properties. An expired reference or refused credential prevents execution; the provider validates the access token itself."
  },
  "capabilities": [
    {
      "capability_id": "sharepoint.sites.drives.read",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R0",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/sites/SITE_ID/drives",
      "method": "GET",
      "connector": "http",
      "actions": [
        "read"
      ],
      "resource_id": "sharepoint-drives",
      "description": "List document libraries of one site.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.users.drives.read",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R0",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/users/USER_ID/drives",
      "method": "GET",
      "connector": "http",
      "actions": [
        "read"
      ],
      "resource_id": "sharepoint-drives",
      "description": "List one user's available drives, including OneDrive.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.children.read",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R0",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/items/ITEM_ID/children",
      "method": "GET",
      "connector": "http",
      "actions": [
        "read"
      ],
      "resource_id": "sharepoint-drives",
      "description": "List children of one folder; results may be paginated.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.metadata.read",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R0",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/items/ITEM_ID",
      "method": "GET",
      "connector": "http",
      "actions": [
        "read"
      ],
      "resource_id": "sharepoint-drives",
      "description": "Read driveItem metadata; no content bytes are downloaded.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.search",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R0",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/root/search(q='SEARCH_TEXT')",
      "method": "GET",
      "connector": "http",
      "actions": [
        "read"
      ],
      "resource_id": "sharepoint-drives",
      "description": "Search one drive; Sites.Selected application permission is unsupported.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.permissions.read",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R0",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/items/ITEM_ID/permissions",
      "method": "GET",
      "connector": "http",
      "actions": [
        "read"
      ],
      "resource_id": "sharepoint-drives",
      "description": "List effective sharing permissions visible to this caller, not a complete access audit.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.versions.read",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R0",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/items/ITEM_ID/versions",
      "method": "GET",
      "connector": "http",
      "actions": [
        "read"
      ],
      "resource_id": "sharepoint-drives",
      "description": "List retained file versions; retention depends on service settings.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.content.update",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R2",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/items/ITEM_ID/content",
      "method": "PUT",
      "connector": "http",
      "actions": [
        "update"
      ],
      "resource_id": "sharepoint-drives",
      "description": "Replace an existing file with a raw stream using simple upload, limited by Microsoft to 250 MB.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.link.create",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R3",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/items/ITEM_ID/createLink",
      "method": "POST",
      "connector": "http",
      "actions": [
        "update",
        "share"
      ],
      "resource_id": "sharepoint-drives",
      "description": "Create or retrieve a sharing link; first-share inherited permissions can also be removed. Sharing is irreversible.",
      "requires_review": true
    },
    {
      "capability_id": "sharepoint.items.delete",
      "version": "1.0.0",
      "kind": "tool",
      "risk_tier": "R3",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN",
      "data_class": "pii",
      "egress_allowlist": [
        "graph.microsoft.com"
      ],
      "endpoint": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID/items/ITEM_ID",
      "method": "DELETE",
      "connector": "http",
      "actions": [
        "delete"
      ],
      "resource_id": "sharepoint-drives",
      "description": "Move an item to the recycle bin. Delete is a designated irreversible action even when vendor recovery is available.",
      "requires_review": true
    }
  ],
  "resources": [
    {
      "resource_id": "sharepoint-drives",
      "kind": "api",
      "locator": "https://graph.microsoft.com/v1.0/drives/DRIVE_ID",
      "data_class": "pii",
      "owner": "REPLACE-WITH-ACCOUNTABLE-HUMAN"
    }
  ],
  "review": {
    "state": "draft",
    "date": "2026-10-29",
    "sources": [
      "https://learn.microsoft.com/en-us/graph/api/drive-list?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-get?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-search?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-list-permissions?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-list-versions?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-delete?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/permissions-selected-overview (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/driveitem-post-permissions?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/entra/identity-platform/access-tokens (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/entra/identity-platform/refresh-tokens (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-client-creds-grant-flow (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0 (retrieved 2026-10-29)",
      "https://learn.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0 (retrieved 2026-10-29)"
    ],
    "reviewer_id": "aaes-eng"
  }
}
