Requiring human approval in n8n before an AI agent writes to the EHR through FHIR
Route every FHIR POST, PUT, PATCH and DELETE through one gate that pauses the workflow, shows a named reviewer the exact resource change, and resumes only on explicit approval of a hashed payload. Verify the hash again at execution, make rejection and timeout end without a write, and back the gate with enforcement in the execution path so that alternate branches, retries and directly held credentials cannot skip it.
- 1
Read path
Read-scoped credential, no ability to call write endpoints.
- 2
Write path
Separate credential, held outside the agent's reach and used only after approval.
- 3
Scope
Limit the write credential to the resource types and operations the use case needs.
- 4
Blocked operations
Deny delete and broad conditional or bundle writes for the agent by default.
- 5
1. Capture the proposal
Have the agent output the complete resource body, the HTTP method and the target path as structured data. Do not let it call the FHIR endpoint directly.
- 6
2. Canonicalize and hash
Serialize the proposal in a fixed form and compute a hash with an approved algorithm. Store the hash and the payload under a request identifier.
- 7
3. Pause and notify
Suspend the workflow and send the reviewer the exact payload, the patient context and the request identifier, not a summary.
- 8
4. Authenticate the decision
Accept the resume signal only from an authenticated reviewer, and record who decided and when.
- 9
5. Re-verify and execute
Recompute the hash of the request about to be sent. If it differs from the approved hash, stop and record a mismatch.
- 10
6. Record the outcome
Store the FHIR response status and the resulting resource identifier against the request identifier.
Evidence an approval-gated write should produce
- Request identifier, agent identity and the tool or workflow that proposed the write
- The exact proposed payload, the HTTP method and target, and its hash
- Named approver identity, the decision (approve, reject, timeout) and timestamps
- The hash of the executed request and a match or mismatch result
- The FHIR response status and the resulting resource identifier
- Records of any blocked or escalated attempts that did not pass through the gate
What the approval gate has to guarantee
An AI agent that can create or update clinical records through FHIR changes the risk profile of a workflow. A read that returns the wrong answer can be corrected. A write that lands in the record may be used in care before anyone notices. FHIR write interactions (create, update, patch and delete) are therefore consequential actions, and a recent federal request for information on AI agent security lists approvals for consequential actions among the human oversight controls of interest.
A useful gate makes four guarantees. No write request leaves the system until a named human has approved it. The approved request is the request that is executed. Rejection, timeout and reviewer unavailability all end without a write. And every decision leaves a record that an auditor can read without reconstructing events from workflow logs.
A Wait step that pauses a workflow and a chat or email message with an Approve button gives you the pause. It does not give you the other three guarantees unless you design for them. The rest of this guide covers that design.
Payload binding, approver identity and failure handling
Payload binding is the step teams skip most often. If the reviewer approves a message and the workflow then rebuilds the request from agent output, the two can differ. Hash the proposed resource at proposal time, store it, and verify it immediately before the write. NIST publishes the Secure Hash Standard and guidance on applications using approved hash algorithms; select the algorithm from those documents. Hash a canonical serialization, since whitespace or key order changes alone would otherwise cause false mismatches.
Approver identity needs the same care. Capture a named human, authenticated through your identity provider, and keep that identity distinct from the agent's. A shared channel or a link that anyone can click does not show who approved. NIST's National Cybersecurity Center of Excellence has raised how to bind agent identity to human identity for human-in-the-loop authorization as an open question, so treat this as a design requirement you must satisfy yourself, not a settled standard.
Define every non-approval outcome explicitly. Rejection ends the request and records the reason. Timeout ends the request and records that nobody decided. Reviewer unavailability should escalate to another named reviewer, not fall through to execution. In each case the default is that no write happens, and the agent receives a clear result so it does not retry the same write by another route.
Test the gate adversarially. Replay the resume signal, retry the failed node, take an alternate branch to the HTTP request, and attempt the write with the credential directly. Each attempt should fail or be recorded.
Where a workflow-level gate falls short
A gate built from workflow nodes protects only the paths it sits on. Another branch, a sub-workflow, a retry that re-enters downstream of the approval step, or a credential used outside the workflow can all reach the FHIR endpoint without passing through it. The gate also records what the workflow chose to record, which is usually not the full approval-to-execution relationship.
Enforcing policy in the execution path of the tool call addresses this gap from outside the workflow. Trussed enforces policy in the execution path across models, agents, tools and MCP servers, at the level of individual interactions and tool calls. For a FHIR write tool call, a policy can allow reads, redact fields that should not leave the boundary, block operations such as delete, and escalate writes for human approval. Because enforcement happens at runtime, not in review after the fact, a request that skips the workflow gate still meets the same policy.
The two controls complement each other. The workflow gate gives reviewers a purpose-built experience and payload binding specific to your design. Tool-call enforcement gives a consistent control point that does not depend on every branch being wired correctly. Trussed does not govern business transactions across tasks or agents; its scope is the individual tool call, and that is the level at which a FHIR write is stopped and escalated.
Enforcement also produces audit-ready evidence as a by-product, mapped to frameworks including HIPAA and NIST. Trussed can be deployed self-managed in the customer cloud, with configurable retention and data residency, which matters when the payloads in question contain patient data.
Approval-gated FHIR write
Propose
The agent drafts a resource change but holds no write credential.
Review
A named human sees the exact payload and decides.
Verify
The executed request is checked against the approved hash.
Record
Approver, payload, decision and outcome are kept as evidence.
Enforce FHIR write approval where the tool call executes
See how policy enforcement in the execution path can escalate agent writes for human approval and produce audit-ready evidence.
Request a Demo