Implementation Guide | Healthcare

    Preventing a Snowflake MCP Agent from Re-identifying Patients by Joining De-identified and Identified Tables

    Treat re-identification as a property of what an agent can combine, not only of what it can read. Keep identified and de-identified data unreachable by the same agent identity, use Snowflake masking, row access and projection policies to limit what each role sees, narrow the MCP server's tools, and enforce policy on each tool call at runtime. Retain evidence of every decision to support HIPAA 164.312(b) audit controls.

    Evidence to retain for HIPAA 164.312(b) audit controls

    • The calling agent identity and the MCP server and tool invoked, with a timestamp.
    • The request as submitted, including the SQL text or parameters.
    • The policy decision (allow, redact, block, or escalate) and the rule that produced it.
    • What was redacted or withheld from the response, described by field and rule.
    • For escalations, the approver, the decision and the time it was made.
    • Records that let you match the tool call to the corresponding Snowflake-side query activity.

    Layer 2: apply Snowflake data-layer controls, and know their limits

    Masking policies

    Generalize quasi-identifiers for the agent role, for example dates to year and ZIP codes to a truncated form, and withhold surrogate IDs that match identified tables.

    Row access policies

    Filter rows by role so the agent cannot reach small or unusual groups where combined fields single out one person.

    Projection policies

    Restrict linkage columns from appearing in query output. Test whether a column that cannot be returned can still be used in filters or joins, since inference through predicates is a linkage path.

    Secure views

    Expose only approved columns or aggregates to the agent role instead of base tables.

    Why joins, not reads, create the risk

    Under 45 CFR 164.514(a), health information is not individually identifiable only if it does not identify an individual and there is no reasonable basis to believe it can be used to identify one. HHS guidance notes that both de-identification methods leave a very small but non-zero risk, and that de-identified data could be linked back to the patient it corresponds to. As of November 2026, the provision is current and no amendment is reported.

    The risk rises when datasets meet. NIST gives the example of a medical test results dataset with names and medical identification numbers removed. It should not be treated as anonymized, because the tests can be re-identified if the dataset is joined with a second dataset holding room numbers, times and similar fields. An NCVHS letter makes the same point: risk grows as datasets are combined, and a downstream user can change the risk level by adding new data.

    An agent with access to both a de-identified table and an identified PHI table in one Snowflake environment is that downstream user. It composes queries dynamically and can join on dates, ZIP codes or a shared surrogate ID without anyone designing that join. Static grants were written for people and applications whose queries were known in advance.

    There is also a linkage-key issue. Under 164.514(c), a code assigned to allow re-identification must not be derived from information about the individual, and must not be used or disclosed for any other purpose. Disclosing such a code counts as disclosing PHI. Applying this to a particular schema is our reading, but a surrogate ID shared across identified and de-identified tables is the kind of mechanism the provision addresses, so mapping tables deserve PHI-level governance.

    Layer 1: separate identified and de-identified data by role and schema

    Start with the question that matters most: can any single agent identity, or any single MCP server connection, reach both datasets? If so, every later control is compensating for a design that permits the join.

    Place identified PHI and de-identified datasets in separate schemas, or separate databases where your account design allows, and grant each to different roles. Give the agent a role that can reach only one side. Put re-identification mapping tables in a restricted schema that no agent role can read, and treat access to them with the same rigor as access to PHI.

    Before granting anything, inventory which de-identified datasets share keys or quasi-identifiers with identified tables, and record the basis for each de-identification determination. Set an explicit re-identification risk threshold for agent access, as NIST SP 800-188 advises, because the organization decides what risk is acceptable.

    The tradeoff is that some legitimate work needs both datasets. Route that work through a human-operated path with review, not through the agent's standing credentials.

    Layer 3: constrain the MCP server's tool scope

    An MCP server gives the agent callable tools. A common pattern pairs a SQL execution tool with a schema discovery tool. Free-form SQL gives the agent the widest room to compose joins, and schema discovery tells it which linkage columns exist and where.

    Prefer narrow tools. Expose parameterized, pre-approved queries against de-identified views, and avoid open SQL where the use case allows. Limit schema discovery to the objects the agent role is meant to use, so identified tables and mapping tables never appear in its context. Run separate MCP servers, with separate credentials, for identified and de-identified domains, and keep both read-only.

    This layer reduces what the agent can attempt. It still does not tell you what the agent did attempt, or stop a permitted tool from being used in an unintended way. That is the gap runtime enforcement addresses.

    Layer 4: enforce policy at the tool-call boundary

    Data-layer controls decide based on role. Enforcement in the execution path decides based on the specific request the agent is making now. Trussed enforces policy in the execution path across agents, tools and MCP servers, with actions to allow, redact, block, rate limit, or escalate for human approval. Its scope is individual interactions and tool calls, and enforcement happens at runtime, not in review after the fact.

    For this problem, policy at the tool-call boundary can do the following:

    Block a SQL tool call whose statement references both an identified schema and a de-identified schema.

    Redact linkable fields, such as surrogate IDs or full dates, from a result before it returns to the agent.

    Escalate for human approval any call that touches a mapping table or requests a combination your policy marks as high risk.

    Rate limit repeated, narrowing queries that look like an attempt to isolate one individual.

    Be precise about the boundary of this control. Enforcement applies to each interaction and tool call. A join split across several separate calls is best prevented by Layers 1 to 3, which remove the ability to reach both sides. Runtime policy then covers each call that does get made. Trussed runs in production with healthcare organizations and can be deployed self-managed in the customer cloud, with configurable retention and data residency.

    Keep the determination current

    NCVHS describes de-identification as a temporary state, because a new dataset linked with earlier data may unlock an identity key. Re-test risk whenever a new dataset, table or MCP tool becomes reachable by the agent, and record the result. NIST suggests re-identification studies to gauge risk, and a review body modeled on its Disclosure Review Board concept can own decisions about what de-identified data agents may query.

    Trussed produces continuous audit-ready evidence from enforcement, mapped to HIPAA among other frameworks, so the review body can examine actual tool-call decisions when it re-assesses risk.

    Four layers between an agent and a re-identifying join

    Label: Separate

    Description: Identified and de-identified data sit behind different roles and schemas.

    Label: Restrict

    Description: Masking, row access and projection policies limit what each role can return.

    Label: Scope

    Description: The MCP server exposes narrow tools instead of open SQL and full schema discovery.

    Label: Enforce and prove

    Description: Policy runs on each tool call and produces evidence of the decision.

    See how tool-call enforcement and evidence work for PHI access

    Walk through policy at the MCP tool-call boundary and the audit-ready evidence it produces for healthcare data.

    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.