Implementation Guide | Healthcare

    Logging Snowflake MCP Server Queries as HIPAA Accounting of Disclosures Evidence

    Query logs alone do not satisfy HIPAA accounting of disclosures under 45 CFR 164.528. Audit-control logging records activity, while an accounting is organized around an individual's request and requires per-disclosure content. When an AI agent queries Snowflake through an MCP server, the requester, purpose, data scope, and policy decision are best captured together at the tool call and then joined to the Snowflake queries that result. This is a design guide, not legal advice.

    Where identity, purpose, and policy must be captured

    1. 1

      Requester and agent identity

      Capture at the tool call. The warehouse sees only the service account or role, so the end user and agent must be recorded upstream.

    2. 2

      Purpose

      Capture at the tool call as a declared value, and validate it against policy for the requester's role.

    3. 3

      Data scope and PHI description

      Record the tables, columns, and patient identifiers requested and returned, after any redaction.

    4. 4

      Policy decision

      Record allow, redact, block, or escalate, the rule applied, and any approver.

    5. 5

      Query linkage

      Store Snowflake query identifiers on the tool-call record so both log sets can be joined.

    Three questions that are often merged

    Teams usually ask one question: do our Snowflake logs cover HIPAA? It is more useful to split it into three.

    First, what does Snowflake record natively? Query history, access history, and login history describe SQL activity and sessions. When an MCP server connects through a service account or role, that activity is attributed to the account or role. The agent, the end user behind the request, and the reason for the request are not part of that attribution unless something upstream carries them through.

    Second, what does HIPAA require? Under 164.528, an individual may request an accounting of PHI disclosures made in the six years before the request, or for a shorter period they choose. The covered entity gives a written accounting that includes disclosures to or by its business associates, with specified content for each disclosure. Certain disclosures are excluded from the accounting, and the exclusion list should be read from the full regulation text by your compliance team.

    Third, what is missing between the two? Audit controls under 164.312(b) concern recording activity in systems that handle ePHI. An accounting is a different artifact: it is keyed to a data subject, scoped to disclosures, and organized around a recipient and purpose. Raw query logs can support both, but they do not become either without additional context captured at the time of the request.

    Deciding which queries are disclosures

    Not every agent query is a disclosure that must be accounted for. An agent summarizing a clinician's own patient panel for treatment is a different case from an agent returning PHI to an outside party for another reason. Whether a given call falls inside or outside the exceptions in 164.528(a)(1), such as treatment, payment, and operations, is a compliance determination. It should have a named owner in compliance or legal, and engineering should not infer it from SQL text.

    What engineering can do is make that determination recordable. Tag each tool call with a classification derived from policy: the requester's role, the declared purpose, and the data scope. Keep the classification, the rule that produced it, and any human override as part of the record. Edge cases then have a review path instead of being reconstructed from logs months later.

    Two scoping points affect volume. HHS indicates a more general accounting is permitted for subsequent multiple disclosures to the same person or entity for a single purpose, so decide early whether your schema supports grouping. Also record outcomes. If a call is blocked, or fields are redacted before results return, the data actually disclosed differs from the data requested, and the record should show both. Whether redacted or blocked calls count toward an accounting is for compliance to confirm.

    Building the disclosure record

    Build the schema from the full text of 164.528(a)(1) and (b)(2), not from a summary. For the fields this guide works from, the mapping is direct, and each field should be verified against the regulation text before you finalize it.

    • Date and time: Timestamp the tool call and decision from a synchronized time source. Synchronized time is an expectation in ONC audit criteria, which is a certification matter rather than a HIPAA requirement.
    • Recipient: Resolve the requesting user, agent, and any downstream party to a named person or entity, including business associates, not to a service account.
    • Description of the PHI: Store a structured summary of the data categories and the individuals affected, keyed by patient so an accounting can be queried per individual.
    • Purpose: Store the declared purpose and the policy that validated it.
    • Classification: Store whether the call was treated as an accountable disclosure or an excluded one, with reviewer notes for edge cases.

    Retention, tamper resistance, and retrievability

    The accounting lookback is six years, so disclosure records must remain queryable at least that long, including for requests that cover a shorter period. Retention should be set by compliance policy, and it should cover the tool-call records, the policy decisions, and the Snowflake query identifiers they reference. Evidence that outlives the logs it points to is hard to defend.

    Tamper resistance matters because the record is evidence. Write tool-call records to an append-only store separate from the systems the agent can reach, restrict who can alter retention, and log changes to the evidence store itself. Retrievability matters because an accounting is requested by an individual. Test that you can produce every agent-initiated disclosure for a named patient over a chosen period within the time your policy allows for responding.

    Keep the ONC disclosure criteria in perspective. Criteria such as 170.315(d)(11) bind health IT developers through certification, and their field set is a reference, not the HIPAA 164.528 content list. Track ONC changes, but do not substitute them for the regulation.

    How runtime enforcement produces the evidence

    A policy layer in the execution path turns the capture points above into a by-product of enforcement rather than a separate logging project. Trussed enforces policy on MCP server tool calls at runtime, not reviewed after the fact, and applies allow, redact, block, or escalate for human approval to each call. Each decision generates audit-ready evidence mapped to HIPAA, so the requester, the data scope, and the outcome are recorded at the moment of the decision. This complements Snowflake-native logs, which remain the record of what executed in the warehouse.

    The scope is individual interactions and tool calls. Trussed does not provide end-to-end tracing of agentic workflows or transaction-level governance, so linking a sequence of calls to one business event remains your design work. Trussed runs in production with healthcare organizations, can be self-managed in the customer cloud, and supports configurable retention and data residency, which bear on the retention decisions above.

    From tool call to disclosure evidence

    MCP tool call

    Requester, agent, purpose, and requested data scope are captured before execution.

    Policy decision

    Allow, redact, block, or escalate is recorded with the call.

    Snowflake query

    Query identifiers are linked back to the tool-call record.

    Disclosure record

    Date, recipient, PHI description, and purpose are retrievable per individual.

    Review your MCP disclosure evidence design

    Walk through how tool-call enforcement produces audit-ready evidence for agents querying PHI in Snowflake.

    Explore Agent and Tool-Call Enforcement