Concepts / Audit Logging for Clinical Systems

Audit Logging for Clinical Systems

Role-based access control restricts what a clinician can reach according to their role, and in this implementation it was applied to a dedicated agent identity for each clinician.

  • Programming

Why a Clinical System Must Refuse Some Requests

Picture an electronic health record system used by a large group of clinicians. Each clinician needs to open the records of the patients in their own care, but nobody should be able to open the records of a colleague's patients simply because they happen to be logged into the same system. Deciding who may see what, and keeping that decision enforced automatically, is the job of access control.

This article follows one concrete implementation in which every clinician received a dedicated software identity that acted on their behalf. As you read, keep one question in mind: when a clinician asks the system for a patient record, what must the system check, and what must it refuse?

Role-Based Access Control and the Agent Identity

Definition

Role-based access control is a security approach that restricts what a user can do according to the role that user holds within an organization.

In this implementation, the thing being restricted is not only the human clinician but also an agent identity created for that clinician. The agent is the software identity that acts inside the system, and it is the identity the system checks when a request arrives. The clinician's role therefore determines what the agent can reach, and the system evaluates the agent, not the clinician's typing, when deciding whether to allow a request.

Creating the identity is not the same as granting access. The agent's reach was set by scoping it through the EHR's role-based access controls. Scoping is the step where the abstract role becomes a concrete boundary: this clinician's agent can work with this clinician's patient panel and nothing beyond it. The identity exists first; the scope is then attached to it.

Tracing an Agent Identity Through Its Stages

An agent identity does not stay in one unchanging state. It moves through a small set of stages that the source describes: it is created at onboarding, it is scoped, it is reviewed on a recurring schedule, and it is eventually revoked when the clinician leaves. Read the diagram below as a map of what can happen to an identity over time, not as a description of any particular software screen.

Follow the stages in order. The identity is created when the clinician is onboarded, and it is then scoped so that its reach matches the clinician's role. While the clinician is employed, the identity is in use. At a recurring interval, the identity is reviewed. The source's standard access-review cadence was ninety days, so an identity that remains in use is checked again on that schedule rather than being trusted indefinitely. In the diagram, the review loops back to the in-use state because a review that finds nothing wrong does not end the identity's life.

Notice what does not end the identity. The review step does not end it; the only event the source ties to ending it is offboarding, when the clinician leaves. Revocation is therefore the terminal state in the diagram, and no other transition leads there.

The Four-Hour Revocation Window

Creating and scoping an identity protects the system while the clinician is employed. The harder question is what happens when the clinician leaves. The implementation handled this through its offboarding process, which automatically revoked the departing clinician's agent identity. The source reports a specific case: two months after go-live, a clinician left the system, and the identity was auto-revoked within four hours.

The timeline shows that the gap between departure and cut-off is the revocation window. The source states that the customer's security team chose this window deliberately to limit misuse. A departed clinician's identity remains usable during that interval, which is why the window is kept short. Every hour of delay is an hour in which an identity belonging to someone no longer on staff could still act, so the design goal is to make that interval as small as the offboarding process allows.

Keeping Every Action Traceable to a Human

Scoping and revocation control who may act. A third requirement controls how actions are recorded. The audit log had to connect every agent action to a specific human clinician and to a specific timestamp. A record of activity is useful only if someone can answer which clinician's agent did something and when.

The diagram follows one action from request to record. The agent's action carries the identity of the clinician it belongs to. The audit log stores that action with a timestamp. Because the identity is individual, the log entry points to a person rather than to a generic account. The source states that this traceability depends on giving each clinician their own identity, so the design choice at onboarding is what makes the later record useful.

Checking a Request Against a Clinician's Scope

Worked example

A request that crosses a colleague's panel

Dr. Okafor's agent identity is scoped to Dr. Okafor's patient panel. Dr. Okafor's agent receives a request to open a record that belongs to a patient on Dr. Lindqvist's panel. What should the system check, and what should it do?

  1. 1
    Identify the acting identity

    The request arrives from Dr. Okafor's own agent identity, because each clinician has a dedicated identity. The system therefore knows exactly whose scope applies.

  2. 2
    Compare the target record to the scope

    The scope for this identity covers Dr. Okafor's patient panel. The requested patient is on Dr. Lindqvist's panel, which falls outside that boundary.

  3. 3
    Refuse the request

    Because the record is outside the scope attached to the identity, the system refuses it. Being logged into the same system does not make the record reachable.

  4. 4
    Record the attempt

    The audit log ties the attempt to Dr. Okafor and to a timestamp, so the activity can later be traced to the clinician whose agent made the request.

Result

The request is refused because the record lies outside the agent's scope, and the attempt remains traceable to Dr. Okafor.

This example is generated for teaching and is not a case from the source. It applies the source's three requirements in order: the scope limits what the identity can reach, the identity is individual, and the audit log records the action against a specific clinician and timestamp.

Mistakes That Break Traceability and Revocation

  • Common mistake

    Giving a whole group of clinicians one shared agent identity

    Why it fails

    The source ties traceability to individual identities. With a shared identity, the audit log can name the group but not the clinician who acted, so the record cannot answer which clinician's agent did something.

    Do this instead

    Create one dedicated agent identity per clinician at onboarding, so every later access decision and log entry can be tied to one person.

  • Common mistake

    Treating the access review as a one-time check at creation

    Why it fails

    The source's review cadence was ninety days. An identity that is checked only once is trusted indefinitely, which the periodic review is designed to prevent.

    Do this instead

    Schedule recurring reviews of the identity's scope while it remains in use.

  • Common mistake

    Assuming that a departed clinician's identity stops working immediately without a process

    Why it fails

    Access is cut off by the offboarding process, and the source describes a revocation window of up to four hours. Without offboarding revocation, the identity of someone who has left stays usable.

    Do this instead

    Tie revocation to the offboarding process so the departing clinician's agent identity is revoked automatically, and keep the window short.

  • Common mistake

    Logging actions without a timestamp, which makes it impossible to say when an agent acted

  • Common mistake

    Assuming that being logged into the system is the same as being allowed to reach a record

Checking Your Understanding of Scope and Revocation

MEDIUM

A clinician, Dr. Reyes, is scheduled to leave the organization on a Friday. Using the lifecycle and the revocation window from this article, describe the states her agent identity passes through, and explain what would be wrong if her identity were still usable a day after she left.

Hints
  • Start from creation at onboarding, then scope, in use, periodic review, and revocation.
  • Think about the revocation window and what it is meant to limit.
  • Consider which record the audit log would need to point to if a later action is questioned.

Key Takeaways

  • Role-based access control restricts what a clinician can reach according to role, and in this implementation it was applied to a dedicated agent identity for each clinician.
  • An agent identity is created at onboarding, scoped through the EHR's role-based access controls, reviewed on a ninety-day cadence, and revoked when the clinician leaves.
  • Offboarding automatically revoked a departed clinician's agent identity within four hours, a window the customer's security team chose deliberately to limit misuse.
  • The audit log ties every agent action to a specific human clinician and timestamp, which depends on giving each clinician their own identity.
  • Scoping limits reach, review rechecks scope over time, revocation ends the identity on departure, and the audit log preserves the link between each action and the responsible clinician.