Implementation Guide | Healthcare

    Separating development, test, and production n8n environments so test workflows never see PHI

    Run development, test, and production n8n as separate instances, each with its own network segment, credential store, and data stores, so that nothing in dev or test has a route, a secret, or a data copy that reaches PHI. Promote workflow definitions only, resolve credentials per environment, use synthetic or de-identified data in test, and prove the separation with negative connectivity tests. Runtime policy enforcement on model, tool, and MCP calls then acts as a backstop if a workflow still tries to send PHI somewhere it should not.

    1. 1

      Separate accounts or network segments

      Place dev, test, and production in different cloud accounts or subscriptions, or at minimum in different segments with default-deny rules between them.

    2. 2

      No inbound route from non-production to PHI stores

      PHI-bearing databases and file stores sit on their own logical partition, reachable only from the production instance.

    3. 3

      Per-environment egress rules

      Production egress is allow-listed to approved destinations. Dev and test egress is restricted to sandbox endpoints and approved model endpoints.

    4. 4

      Separate identity and access groups

      Different groups administer and edit workflows in each environment. Access to production is the smallest group.

    5. 5

      Distinct webhook hostnames

      Each environment has its own domain and certificates, so a webhook configured in test cannot be mistaken for, or routed to, production.

    6. 6

      Visible environment labelling

      Use different names, colors, or banners per instance so operators can tell at a glance where they are working.

    7. 7

      1. Build in dev

      Author against mock or synthetic sources. Commit the workflow definition to version control, with credentials referenced by name only.

    8. 8

      2. Scan the artifact

      Before merge, automatically check the definition for embedded secrets, hard-coded production hostnames, and real identifiers in pinned or sample data.

    9. 9

      3. Review and approve

      A reviewer checks outbound destinations, especially LLM nodes, webhooks, and third-party API calls, against the approved list for each environment.

    10. 10

      4. Deploy to test

      A pipeline identity, not a person, installs the definition. Test resolves its own sandbox credentials and runs against synthetic or de-identified data.

    11. 11

      5. Gate production release

      Release requires passing tests, a recorded approval, and a change record. The production instance resolves production credentials from its own store.

    12. 12

      6. Block reverse flow

      No process copies executions, credentials, or data from production back into test or dev.

    Verification: show that the separation holds

    • From each non-production instance, attempt connections to production databases, APIs, and secret stores, and confirm every attempt is denied at the network layer.
    • Enumerate credentials in dev and test and confirm none authenticates against a production system.
    • Scan non-production databases and workflow definitions for PHI patterns and production identifiers.
    • Compare outbound destinations in dev and test against the approved sandbox and model endpoint list.
    • Review access group membership for each environment and remove cross-environment administrators.
    • Record each run with date, scope, result, and owner, so the history is available to an auditor.

    Why shared dev and test environments expose PHI

    The HIPAA Security Rule applies to electronic protected health information that a covered entity or business associate creates, receives, uses, or maintains. Nothing in that scope language exempts non-production systems. If a development or test n8n instance can read a production database, call a production API with a production credential, or hold a copy of production records, then that instance is handling ePHI and is in scope.

    The risk is practical rather than abstract. A workflow under development might read real records to see what the data looks like, pass them to an LLM node, post them to a webhook, or call a third-party API. Each of those actions sends PHI outside the controls that apply to production. The cause is usually shared infrastructure: one credential reused across instances, one database with test and live tables, or a copy of production data refreshed into test.

    NIST SP 800-218 (SSDF) practice PO.5.1 states the underlying principle: separate and protect each environment, and minimize the use of production software and services from non-production environments. The rest of this guide applies that principle to n8n.

    Credentials and secrets: scoped per environment

    Network separation fails if a production credential sits in a test instance. OWASP's secrets management guidance advises considering separate secret management solutions for production and development secrets, and reducing access to the production one. For n8n, that means each instance resolves its credentials from its own store, and the production store is readable only by the production instance and a small set of administrators.

    In practice, give every credential the same logical name in each environment but a different underlying identity. A connection called "ehr-api" exists in dev, test, and production, but in dev and test it points to a sandbox or mock service with its own service account. The workflow definition then references a name, not a secret, and promotion never needs to copy a secret.

    Issue non-production credentials with the least privilege that testing needs, and ensure none of them is valid against a production system. Rotate on a schedule, and treat any production secret found in a non-production store as an incident, not a cleanup task.

    Test data: synthetic or de-identified, never copied

    The safest test data is synthetic: generated records that match the shape, field formats, and edge cases of production data without originating from real patients. Build generators for the record types your workflows consume, including malformed and boundary cases, and store them in the non-production data layer only.

    If you need data derived from production for realism, de-identify it inside the production boundary before anything crosses to test. The de-identification job runs in production, writes only to a controlled output location, and is validated before release. Test and dev instances never hold a connection to the source. Treat the de-identified output as a governed artifact with an owner and a review step, because a weak de-identification method turns a test dataset back into PHI.

    One nuance: some healthcare IT guidance, such as the ONC SAFER guides, describes running integrated testing with test patients in the live production version under appropriate controls. That is a different goal from the one here. If your objective is that test workflows have no technical path to PHI, keep test activity in the non-production environment and reserve any production-side validation for a separate, approved process.

    Runtime enforcement as a backstop, and the evidence it produces

    Environment isolation removes the paths. It does not control what a workflow sends once it legitimately reaches a model, a tool, or an MCP server. A production workflow can still pass more data than intended to an external AI service, and a misconfigured test workflow can still try to send something it should not.

    Trussed adds a layer here. It enforces policy in the execution path on individual model interactions and tool calls, including calls to MCP servers, and the action is allow, redact, or block. Enforcement happens at runtime, not through review after the fact. For example, a policy can redact PHI from a prompt before it reaches an external model, or block a tool call to a destination the environment is not approved to use. Trussed can be deployed self-managed in the customer cloud, with configurable retention and data residency, and it runs in production with healthcare and pharma organizations.

    Each enforcement decision produces audit-ready evidence, mapped to HIPAA. That supports the audit controls provision at 45 CFR 164.312(b), which sits within the technical safeguards of the Security Rule. The evidence complements your verification records: the checks show the separation was tested, and runtime evidence shows what each model and tool call was allowed to do. The scope is individual interactions and tool calls, so it does not replace the topology, credential, and data controls above.

    As of November 2026, the 2025 HHS Security Rule proposal would require written policies and procedures that are regularly reviewed, tested, and updated, but it is a proposed rule. Documenting and testing your environment controls now fits that direction either way. Some access controls in Subpart C are addressable, so record the decision and rationale for each.

    Three environments, no shared paths to PHI

    Development

    Synthetic data only. Own instance, own secrets, no route to production.

    Test

    Synthetic or de-identified data. Sandbox endpoints for connected systems.

    Production

    The only environment with PHI sources, production credentials, and production egress.

    Promotion

    Reviewed workflow definitions move forward. Secrets and data never do.

    Add a runtime backstop to your n8n environment separation

    Discuss how enforcement on model, tool, and MCP calls fits alongside your dev, test, and production topology, and what evidence it produces for HIPAA audit controls.

    Explore Agent and Tool-Call Enforcement
    Next step

    How does your AI governance program compare?

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