Implementation Guide

    Keeping Psychotherapy Notes Stored in SharePoint Out of AI Agent Context

    Keep psychotherapy notes out of agent context by layering controls. Isolate the notes in a separate SharePoint location, apply least-privilege permissions to every identity an agent uses, label the content, and narrow search and indexing scope. Then enforce policy at runtime on each interaction and tool call, with allow, redact, or block decisions that are recorded as evidence. No single native control covers every retrieval path.

    Adding runtime enforcement in the execution path

    1. 1

      1. Define the policy

      Express the exclusion in terms the enforcement point can evaluate: the notes location, the label, and the tools or connectors that can reach them.

    2. 2

      2. Evaluate each request

      Check the calling agent, identity, and target of every tool call before it executes.

    3. 3

      3. Evaluate each result

      Inspect tool results and retrieved content before they enter the model's context.

    4. 4

      4. Decide

      Allow content outside the boundary, redact partial matches where that is acceptable, and block requests or results that involve the notes.

    5. 5

      5. Represent exceptions

      Encode any approved authorization-based exception, such as originator use for treatment, as an explicit and narrow rule.

    6. 6

      6. Record the decision

      Write each decision as evidence at the moment it is made.

    Audit-ready evidence that the exclusion held

    • The written classification rule derived from the HIPAA definition, including the excluded summary and administrative items
    • An inventory of where psychotherapy notes and other mental health records are stored
    • Records of permissions, labels, indexing scope, and DLP settings for the notes location, with change history
    • The list of agent identities, connectors, and tools, with the access each holds
    • Per-interaction enforcement decisions showing what was allowed, redacted, or blocked and under which policy version
    • Results of periodic tests showing the notes cannot be retrieved through each path, and documentation of any approved exception

    Preventive controls at the storage, identity, and retrieval layers

    Segregate storage

    Place psychotherapy notes in a dedicated site or library with its own owners, separate from the general record. This aligns the regulatory separation with a technical boundary.

    Enforce least privilege

    Limit membership to the originating clinicians and necessary administrators. Remove broad groups and inherited access, and review service identities and delegated permissions used by agents.

    Label the content

    Apply a sensitivity label dedicated to psychotherapy notes so that policy in other layers has a reliable attribute to match.

    Narrow search and indexing scope

    Use the sensitive-content exclusion and discovery-restriction features available in your Microsoft 365 tenant for the notes location, so assistants such as Microsoft 365 Copilot do not ground on it. Verify the result with test queries.

    Apply DLP

    Add DLP policies keyed to the label or location, and check which agent and connector activity they actually evaluate.

    Separate related records

    Inventory other mental health content and keep summaries and administrative items out of the notes location, so exclusions do not depend on guesswork.

    What you are excluding: the HIPAA definition

    Under 45 CFR 164.501, psychotherapy notes are notes recorded in any medium by a mental health professional that document or analyze the contents of conversation during a private counseling session or a group, joint, or family counseling session, and that are separated from the rest of the individual's medical record. The separation element matters for engineering. Where and how the notes are stored is part of what makes them psychotherapy notes.

    The definition excludes medication prescription and monitoring, session start and stop times, modalities and frequencies of treatment, results of clinical tests, and summaries of diagnosis, functional status, treatment plan, symptoms, prognosis, and progress to date. Those items may sit in the same SharePoint environment as other mental health records, but they are not psychotherapy notes and need their own handling decisions.

    Under 45 CFR 164.508(a)(2), a covered entity must obtain an authorization for any use or disclosure of psychotherapy notes, subject to listed exceptions. One exception is use by the originator of the notes for treatment. Whether a given agent use falls under an exception is a legal and privacy determination, not a configuration choice. Until that determination is made, the safe engineering default is exclusion.

    How notes enter agent context

    Agent context is wider than the prompt. Content can reach a model through the user's question, through retrieved passages added by a search or grounding step, and through the results of tool calls that the agent then reads. Anything an agent can retrieve, it can place in context, and anything in context can be repeated in output, passed to a downstream tool, or stored in conversation history.

    Several retrieval paths can reach SharePoint content: the native assistant experience, custom agents calling Microsoft Graph, third-party connectors that copy or index content elsewhere, MCP servers exposing file or search tools, and custom tool calls written by internal teams. Each path authenticates differently. Some act with the signed-in user's rights, and some act with a service identity that may hold broader access than any individual user.

    This is why a single setting rarely settles the question. A control that limits one path says little about the others, and the risk grows when notes live in a broadly shared site or share a library with ordinary clinical documentation.

    Where preventive controls leave gaps

    Permission trimming returns only what the requesting identity can see, so it is only as strict as the identity's access. An agent running under a service account with wide read rights, or a user with legitimate access to the notes site, can still retrieve the notes. Labels and DLP depend on content being classified correctly and on the path being one those policies evaluate. Indexing and search exclusions shape what search-based retrieval returns, but they do not by themselves govern a tool that reads files directly, a connector that has already copied content elsewhere, or an MCP server with its own credentials.

    There is also a drift problem. Notes get moved, copied into email or chat, or pasted into documents outside the segregated location, and the separation requirement erodes with them. Federal work on AI agent security reflects the same concern: least privilege and zero trust remain relevant, and data and tool restrictions and continuous monitoring are cited as agent-level controls alongside them. The practical conclusion is that storage, identity, and retrieval controls are necessary but leave residual risk on paths they do not mediate, and you need a way to prove which paths held.

    Four layers between psychotherapy notes and agent context

    Label: Storage

    Description: Dedicated site or library, kept separate from the general record.

    Label: Identity

    Description: Least privilege for users, service identities, and delegated access.

    Label: Retrieval

    Description: Labels, indexing scope, and DLP limit what can be surfaced.

    Label: Runtime

    Description: Allow, redact, or block on each interaction and tool call, with evidence.

    See how runtime enforcement and evidence work together

    Review how policy is enforced on individual interactions and tool calls, and how each decision becomes audit-ready evidence for a regulated enterprise.

    See How Evidence Is Produced
    Next step

    How does your AI governance program compare?

    See where your program has gaps in less than 2 minutes.