Implementation Guide | Healthcare

    How to Detect Bulk PHI Downloads by an AI Agent Through SharePoint and Google Drive MCP Servers

    Treat bulk PHI download as a pattern across MCP tool calls, not a single event. Record every call with an identity that separates the agent session from the delegated user or service account, and measure file count, bytes and sensitivity per session. Enforce thresholds in the execution path so rate limits, redaction, blocking and human approval act before content is returned. Use platform audit logs to correlate and investigate afterward, and retain time-synchronized, tamper-evident records as audit evidence.

    Evidence to retain for HIPAA 164.312(b) audit controls

    • Actor: agent identifier, session identifier and the delegated user or service account
    • Action and object: tool name, parameters, files or folders targeted, response size and file count
    • Timestamp from a synchronized (NTP) clock, consistent across MCP and platform log pipelines
    • Policy decision for each call: allow, redact, block, rate limit or escalate, with the policy version and any approver
    • Changes to agent permissions, tool scope and policy thresholds
    • Integrity protection, such as hashing, so alteration of retained records can be detected

    What bulk PHI retrieval looks like at the tool-call layer

    A human downloading files produces a recognizable footprint: a browser session, a sync client, a spike in volume. An agent connected through an MCP server produces something different. It issues search, list, read and download tool calls in quick succession, often under one delegated user or one service account, and the platform sees only that credential.

    For detection to work, define bulk retrieval in terms the tool-call layer can measure. Useful dimensions are the number of distinct files returned per session, cumulative bytes returned, the number of folders or sites traversed, the share of returned files carrying a PHI sensitivity label or matching PHI classifiers, and the ratio of read or download calls to the user's stated task.

    Several patterns are worth writing down explicitly. Enumeration followed by fan-out is one: a broad list or search call, then reads against most of the results. Repeated traversal of directories unrelated to the task is another. A third is a sudden change in query shape, such as wildcard searches for identifiers, after the agent has processed untrusted content. Each pattern should have a threshold, an owner and a defined response, so that alerts are not left to interpretation.

    Where each signal source is sufficient and where it has gaps

    No single source covers detection, prevention and evidence. The practical question is which layer answers which question.

    • MCP tool-call record: Sees the tool name, parameters, response size, file count and agent session before the response is returned. It can distinguish the agent session from the credential it runs under. It does not know file sensitivity unless it classifies content or reads labels.
    • Platform audit logs: Confirm which files were accessed and when, under which credential. Access is attributed to the service account or delegated user, not to the agent's tool call, so they cannot show which session or instruction caused a burst. Best used for correlation and investigation.
    • Sensitivity labels and DLP classification: Where your tenant uses them, they supply the sensitivity signal that tool-call metadata lacks. Coverage depends on how consistently PHI is labeled or matched, and unlabeled repositories are a blind spot.
    • Execution-path enforcement: Can act on a call before data leaves, using tool-call metadata and sensitivity signals together. It depends on well-tuned thresholds and on every agent path going through it.

    Designing the layered detection and response approach

    Build the approach from the tool call outward. Start by deciding what must be true of every record, then set thresholds, then bind each threshold to an action. The sequence below keeps the design testable.

    • 1. Establish agent identity: Assign each agent and session an identifier carried on every tool call, alongside the delegated user or service account, so platform logs can later be tied to a session.
    • 2. Inventory the retrieval tools: List which exposed tools can return file content or enumerate files, including search, list, read and download, and which parameters bound their scope.
    • 3. Baseline by task: Measure normal file counts and bytes for each approved agent task. A claims summarization agent and a records indexing agent need different limits.
    • 4. Set tiered thresholds: Define soft limits that trigger rate limiting or redaction and hard limits that block or require human approval, with stricter limits for PHI-labeled content.
    • 5. Synchronize clocks: Align the MCP layer and platform log pipelines to a common time source so agent-side and platform-side records can be correlated reliably.
    • 6. Test with adversarial input: Replay scenarios where an agent is induced by untrusted content to over-retrieve, and confirm the thresholds fire before content is returned.

    Controls that act before data leaves versus after-the-fact review

    The most important design distinction is timing. Rate limiting, redaction, blocking and human approval act in the execution path. They can change what the agent receives. Alerting on platform audit logs, DLP findings reviewed by an analyst, and periodic access reviews act after content has already been returned to the agent and potentially to a model or downstream tool.

    That does not make after-the-fact review unnecessary. It is how you investigate, confirm what was accessed under a shared credential, and tune thresholds. But for bulk PHI the pre-return controls carry the risk reduction, so match the action to the situation. Allow calls within the task baseline. Redact identifiers when the task does not need them. Rate limit when volume rises but intent is plausible. Block when a hard limit is crossed or the target is outside the agent's approved scope. Escalate for human approval when the request is legitimate in principle but unusual in size, such as an authorized export for a specific project.

    The tradeoff is friction. Thresholds set too low interrupt legitimate work and teach users to route around the control. Start with monitoring-only decisions recorded at the tool-call layer, review them against real tasks, then move the clearest patterns to enforcement.

    Where runtime policy enforcement fits

    Trussed enforces policy in the execution path of MCP tool calls, including calls to SharePoint and Google Drive servers. For each interaction or tool call it can allow, redact, block, rate limit or escalate for human approval, and the enforcement itself generates audit-ready evidence mapped to HIPAA. Decisions are enforced at runtime, not reviewed after the fact. Trussed runs in production with healthcare and pharma organizations and supports self-managed deployment in the customer cloud, with configurable retention and data residency.

    Its scope is individual interactions and tool calls. It complements platform audit logs rather than replacing them: the tool-call record explains what the agent asked for and what policy decided, while SharePoint and Google Drive telemetry confirms what the platform recorded under the underlying credential. Whether you build this layer yourself or adopt one, the evaluation criteria are the same: per-call identity, pre-return enforcement, correlation with platform logs, and records an auditor can inspect.

    Layered detection for agent file access

    Tool-call record

    Tool, parameters, response size, file count and agent session identity for every call.

    Runtime enforcement

    Allow, redact, block, rate limit or escalate for human approval before content is returned.

    Platform telemetry

    SharePoint and Google Drive audit and DLP data used to correlate and investigate.

    Retained evidence

    Time-synchronized, tamper-evident records mapped to HIPAA audit controls.

    Review your agent file-access controls

    Talk through bulk PHI patterns, tool-call enforcement and audit evidence for your SharePoint and Google Drive MCP deployments.

    Talk to an Expert
    Next step

    How does your AI governance program compare?

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