Controlling AI agent access to Medplum through MCP starts with a dedicated client
Agent access to Medplum should run through its own client application with narrow access policies, not a shared admin login. A team that wants AI assistants to query or update Medplum data needs to know two things before anything is connected: what the MCP integration lets an agent reach, and which identity the agent acts under. The answer to the second question determines the answer to the first. Medplum's authentication model is built around client applications, access policies and projects, and each of those is a control you can set deliberately. Create a separate client application for each agent or agent role so that its sign-in method, token lifetime and permissions are visible and revocable without touching human users or other integrations. Medplum supports client credentials for server-to-server access and multi-factor authentication for people, so the agent path and the staff path can be governed differently. Confirm in the Medplum authentication documentation which client authentication methods apply to your deployment before you choose one.
The shared admin login is the pattern to avoid. If an agent authenticates as a person or a privileged service account, every action it takes is attributed to that identity, its permissions are far wider than the task needs, and removing its access means disrupting people who depend on the same credentials. A dedicated client lets you attach an access policy that limits the resource types and operations the agent can use, and lets audit records tie each action to that specific client. Write the policy from the task backward: list the resource types the assistant must read, the few it may write, and the compartments or patient sets it should never see. Then test the policy by running the agent's typical requests and confirming that out-of-scope requests fail. Before you go further, check the current MCP tool list, supported transport and any setup steps in the Medplum documentation, because the available tools and their behavior change between releases and this page does not list them.
How an agent request travels from an assistant to Medplum
The request starts in the AI assistant or MCP host, which sends a tool call to the Medplum MCP integration. The integration acts through a dedicated client application that obtains its token from Medplum Auth, so the agent never uses a person's login. The Medplum server then applies access policies before it reads or writes PostgreSQL and writes an audit event for the request. Check that everything right of the boundary runs in your own infrastructure, and that the client application's token and policy scope are as narrow as the agent's task.
Agent requests pass through Medplum Auth and access policies inside the self-hosted boundary.
Which agent access pattern fits which team
Analysts who ask an assistant population questions need the narrowest access in the set. Give the assistant its own client application and have it act through a named analyst's login with multi-factor authentication, so every query traces to a person. The policy should allow reads on the resource types the analysis needs and nothing else.
- Access policy shape: read permissions only, scoped to the resource types and projects analysts actually use. No create, update or delete permissions.
- Authentication: a user login through your identity provider with MFA enforced, so the assistant's session belongs to a named person whose access you can revoke.
- Data exposure: decide which identifiers and free-text notes the assistant may return. Confirm whether your Medplum version can limit returned fields through the policy or whether a separate view layer is needed.
- Result size: confirm how large result sets and bulk exports are blocked or capped for this client.
- Review burden: low for each query, but every new resource type added to the policy needs a privacy review, and assistant access should be recertified in your regular access review cycle.
Before rollout, test the policy with a sample analyst query that should succeed and a write attempt that should fail.
Workflow agents, such as ones that draft a task or update a status, often run without a person present, so they usually authenticate with client credentials: a client ID and secret tied to a dedicated client application. The policy grants create and update rights only on the resource types and operations the workflow requires. Because every write is made under the agent's identity, these agents need the heaviest review of the three patterns.
- Access policy shape: narrow create and update rights per resource type, no delete rights, and no access to administrative resources.
- Authentication: client credentials for one client application per workflow, with the secret held in a secrets manager and rotated on a schedule you set. See the Medplum authentication docs for the supported machine sign-in options.
- Human approval: decide which consequential writes must wait for a person or a separate check before they commit, and document where that gate sits in the workflow.
- Blast radius: keep each workflow in its own client application so that one leaked secret cannot write across unrelated data.
- Review burden: highest of the three. Review each new write scope and each workflow change, and check audit events regularly to confirm the agent's writes match what the workflow was approved to do.
Before go-live, revoke a test client secret and confirm the agent stops writing, and confirm its writes appear in audit events under the agent's identity.
Coding assistants help engineers build and debug against Medplum, and they should work only in a non-production project loaded with synthetic or de-identified data. The developer's own login is the identity, with MFA, and the assistant never receives production credentials. Keeping the sandbox separate from production is the main control in this pattern, so confirm that boundary before any developer installs the tool.
- Project boundary: a non-production Medplum project that holds only test data. Confirm that it sits apart from production tenants and that its resources cannot be reached with production credentials.
- Authentication: a developer user login with MFA for interactive use. If the tool needs unattended access, use a client application limited to the sandbox project.
- Access policy shape: broad enough for engineers to build and test features, but with no production client IDs or secrets in local environment files, shell history or assistant configuration.
- Data controls: PHI must stay out of prompts, pasted examples and logs that the assistant reads. Confirm the data retention and training terms in your coding tool's agreement with its vendor.
- Review burden: moderate. Periodically check that the sandbox holds no actual patient records and that developer access is removed when people change roles or leave.
Before approving the setup, search the sandbox for records with real-looking identifiers and confirm that production secrets are absent from repositories and assistant configuration files.
Setting up a dedicated Medplum client for an AI agent
This sequence gives an AI agent its own identity, scope and permissions in Medplum, so every request it makes is limited by a policy you wrote and can prove with a test. Each step ends with a check that confirms the setup before the next one begins.
Confirm the Medplum deployment and version
Record the Medplum version your deployment runs, the hosting model (Medplum Cloud or self-hosted) and the identity provider in use. Compare the version against the release notes and the versioning policy so you know which security patch window applies. If the deployment is self-hosted, confirm the server is on a supported minor version before adding new integrations, because the upgrade path must be followed in sequence. Done when you have a written record of version, hosting and identity provider that the security team has accepted.
Create a separate project or scope for the agent
Decide whether the agent gets its own Medplum project or a scope inside an existing one. A separate project keeps the agent's clients, policies and data boundary apart from staff and application access, which makes review simpler. Your Medplum administrator creates the project and records who owns it. Done when the project exists, its administrators are named, and no existing user or application is a member of it by default.
Register a dedicated client application
Create a client application inside the agent's project for the MCP integration, using a name that identifies the agent and its purpose. Do not reuse a client that an existing app or Bot already holds. Record the client ID, the owner and the intended use in your access inventory. Done when the client appears in the project, has its own identifier, and a search for its ID returns only this client.
Choose client credentials or a user identity
Pick the identity the agent will use. Client credentials suit a machine-to-machine connection with no human signing in. A dedicated user identity suits cases where a person's approval or session must govern the agent's actions. Confirm with your identity team which option matches your MCP client's authentication support, and check the current authentication documentation before committing. Done when the choice is documented with the reason, and the credential is stored in your secrets manager rather than in a configuration file.
Attach access policies limiting resource types and compartments
Write an access policy that lists only the resource types the agent needs, such as the specific clinical or administrative types for its task, and restrict it to the compartment or patient set it may read. Deny write and delete operations unless a documented use case requires them. Attach the policy to the agent's client or identity and nothing else. Done when the policy file is version-controlled, reviewed by a second person, and attached to the agent identity only.
Configure MFA and token lifetimes where applicable
For user-based identities, require multi-factor authentication through the identity provider and confirm the setting applies to this account. For client credentials, review the token lifetime and the rotation schedule for the secret, and set both to the shortest practical values your security policy allows. Document any setting that cannot be applied to machine identities so the risk is accepted in writing. Done when a test sign-in shows the MFA prompt for user accounts, and token expiry and secret rotation dates are recorded.
Connect the MCP integration
Configure the MCP client with the dedicated client ID, the credential from your secrets manager and the Medplum base URL for your deployment. Limit the tools the assistant can call to those your use case needs, and keep audit logging on for every session. Confirm the connection through a read request for a single permitted resource type. Done when the assistant returns that resource, and the request appears in the Medplum audit events under the agent's identity.
Verify the agent cannot exceed its policy
Run a scripted test set as the agent identity. Include requests for a resource type outside the policy, a read outside the permitted compartment, a create, an update and a delete, and a request with an expired or revoked token. Each request outside the policy should return an authorization failure, and each should appear in the audit log. Keep the test results, repeat the test after every policy or version change, and sign off only when every case behaves as designed.
Keeping PHI inside approved boundaries when agents read clinical data
Once an assistant can call Medplum tools, PHI can leave your boundary at more points than the Medplum server itself. Each tool result that returns a Patient, Encounter or Observation is text that may be sent to the model provider, written to the MCP host's conversation history, copied into client-side logs, or cached in a prompt store. Map each of these hops before go-live. For every hop, record who operates it, where it runs, whether it stores content, how long it retains it, and whether it is covered by a contract that binds the operator to HIPAA obligations. The HIPAA Security Rule applies to electronic protected health information (ePHI) that a covered entity or business associate creates, receives, maintains or transmits (45 CFR 164.302), so an agent path that moves ePHI is in scope even when the Medplum data itself stays in your infrastructure.
The technical safeguards map directly onto this flow. Access control needs unique user identification and a way to scope what the agent may read, audit controls need records of which user, agent client and tool call touched which resources, and transmission security needs encryption for ePHI in motion, with the encryption specifications classed as addressable in 45 CFR 164.312. Confirm with your security team how the MCP host and model connection implement each of these, and do not assume the Medplum deployment settings cover the model leg. Under 45 CFR 164.314(a)(2)(i), a business associate contract must require the business associate to flow the same terms down to subcontractors that handle ePHI. If a model provider receives prompts or tool outputs that contain PHI, you must establish whether that provider is a business associate or subcontractor for your organization, and whether it will sign the required agreement. Ask each vendor for its position in writing, and confirm retention and training-use terms for prompts and outputs before any clinical record reaches it.
Security and operational controls for agent access
Agent access to Medplum data is only as safe as the identity, policy, logging and testing behind it. The six controls below connect the identity an agent uses, the limits placed on it, the evidence left behind and the checks run before any rollout.
Dedicated identities and least-privilege policies
Give each agent its own Medplum client application and identity rather than reusing a clinician's session or a shared admin key. Attach an access policy that limits the resource types, compartments and operations the agent can reach, and confirm that policy in a test project before it touches production records. Ask the team which resource types an agent truly needs for each task, and review that list whenever the agent's job changes. Illustrative example: a scheduling assistant may need Appointment and Slot reads but no access to clinical notes.
Medplum auth docsMFA and token lifetimes for people
Interactive users who sign in to an assistant or the MCP setup should authenticate through an identity provider with multi-factor authentication enabled. Medplum supports its own identity provider, external providers and domain-level corporate identity providers, so the choice should follow your workforce directory. Set token lifetimes deliberately, since a long-lived token held by an assistant extends the exposure window if a device is lost. Confirm these settings in your own tenant, because the available options depend on your plan and configuration.
Audit events and resource history
Every write Medplum records is versioned, so reviewers can read resource history to see what changed, when and under which identity. Pair that with the audit events the server produces for reads and other activity, and check that agent client identities appear distinctly in both. HIPAA's technical safeguards require unique user identification and audit controls that record and examine activity in systems holding ePHI, so agent actions should be attributable to a specific client. Ask your team how long these records are kept and who can query them.
Prompt injection and tool misuse testing
Before an assistant reaches production data, test whether injected instructions in a note, message or document can make it call tools it should not use, such as bulk searches or writes outside its task. Check that each MCP tool enforces the same access policy as the underlying API, not only the assistant's own instructions. Retest after each change to tools, prompts or model versions. Scope and pass criteria should be written down before testing begins, and the findings should name each fix and its retest.
Secrets handling for client credentials
Agent client credentials grant server-to-server access, so a leaked secret is equivalent to the agent's full policy. Store secrets in a managed secret store rather than in configuration files, prompts or chat logs, and limit which runtimes can read them. Plan rotation and revocation of each client before go-live, and confirm that a compromised client can be disabled without affecting other agents. Ask your team who holds rotation responsibility and how often the process is exercised.
Monitoring agent request volume
Track request counts, search patterns and error rates per agent client, and alert on sudden changes such as a bulk read that falls far outside normal use. Baselines should be set during a supervised pilot, when expected volumes are known. Feed these signals into the same review process as audit events so that a spike can be traced to a client, a time window and a policy. Confirm with your team which metrics Medplum exposes in your deployment and which must come from your own logging stack.
What HIPAA and HITRUST do and do not require for AI access
HIPAA does not certify anyone. No Security Rule standard requires an entity to certify compliance, and HHS has said that private certifications do not stop it from later finding a violation. The HHS Office for Civil Rights enforces the Security Rule through complaints, compliance reviews and audits, so the question an investigator asks about an AI agent connected to Medplum is whether your own records show the controls worked: unique user identification for each agent identity, access limited to what the agent needs, automatic logoff, and audit records of what was read or written. A HITRUST report or SOC 2 Type II report about Medplum is useful evidence about the platform's controls, but it covers Medplum's environment, not the access policies, client applications and token settings you configure for your deployment. Confirm with Medplum which of its compliance reports you can obtain under your agreement, and map each one to the controls you own.
The HHS proposed revision of the Security Rule, published on 6 January 2025 (90 FR 898), would tighten requirements for electronic protected health information, but no final rule had been published as of October 2026, and the Unified Agenda projects final action for July 2027. Plan against the current rule and the revision's direction together. Expect stronger expectations around authentication and access. Ask whether your AI agent client applications and their credentials would still meet the requirements if a final rule arrives during your deployment, and record where each control is configured so you can update it quickly.
Regulators outside the United States already expect this. France's CNIL fined Hopital Prive de la Loire EUR 500,000 under GDPR Articles 32 and 34 on 3 September 2026, finding that external access to its patient record system lacked VPN and multi-factor authentication, and that access control ignored the care team's need to know. For an AI agent, the parallel is direct: an agent client that reaches patient data from outside your network, without strong authentication, or with broader scope than its task needs, will be judged the same way. Decide before rollout which network paths, identity providers and multi-factor methods agent access requires, and document why each one was chosen.
Questions buyers ask about controlling AI access to Medplum
What does it cost to control AI agent access to Medplum?
The cost depends on how many agent use cases you scope, how many client applications and access policies each one needs, and how much testing your compliance team requires before sign-off. Costs fall into two groups: one-time work (scoping, building dedicated client applications, writing access policies, audit event review and testing) and recurring work (reviewing permissions as agents and teams change, and retesting after Medplum upgrades). Your Medplum hosting choice also shapes the bill, since Medplum's pricing page lists Free, Production, Premium and custom Enterprise cloud plans, plus a free Community self-hosting option and custom-priced Enterprise Self-Hosted. Ask any partner for a quote built from a written scope that lists each agent, its data scope and the evidence your team expects.
How long does a first AI agent connection to Medplum take to scope and test?
The timeline depends less on the MCP connection itself than on the decisions around it: which resource types the agent may read or write, which patients and records fall outside its scope, whether it needs a dedicated client application, and who signs off on the policy. Teams that already have documented access rules and a working Medplum project usually move faster than teams that must first agree on data boundaries. Testing adds time, because you need to confirm that the agent cannot read data outside its policy, that writes are limited as intended, and that audit events capture each action. Ask for a timeline in the written scope with separate milestones for policy design, build, testing and approval.
What does our team need to provide before an AI agent connection is scoped?
Three inputs drive most of the work. First, named policy owners who can state which data each agent may use and why, typically from clinical, operations or data governance. Second, compliance sign-off from the people who will answer for PHI handling, including your privacy and security leads, who should confirm the boundaries before anything is built. Third, Medplum administrator access in the project or deployment where the agent will run, so the team can create client applications, access policies and audit reviews. If you self-host, you also need access to the infrastructure where Medplum runs. Confirm these responsibilities in the written scope, because Medplum's compliance documentation describes compliance as a shared responsibility between Medplum and its customers.
Can an internal team set up AI agent access to Medplum without a partner?
Yes, a team with Medplum experience can build this internally, and many will choose to. The work is well defined: create a dedicated client application for each agent, attach access policies that limit resource types and compartments, keep credentials out of prompts and logs, and confirm audit events for every agent action. The harder parts are usually the policy design and the testing. Agents can combine permitted reads in ways no single policy anticipated, and a tester who tries prompt injection, tool misuse and cross-patient lookups will find gaps that a builder misses. Decide early whether your internal team has time to design, test and document the setup for a compliance review, or whether an outside tester should review it independently.
Does a model provider need a business associate agreement to use Medplum data with an AI agent?
A business associate agreement is required when a vendor creates, receives, maintains or transmits electronic protected health information on behalf of a covered entity or another business associate. Under 45 CFR 164.314(a)(2)(i), the contract must require the business associate to comply with the Security Rule, flow the same terms down to subcontractors that handle ePHI, and report security incidents to the covered entity. Whether a model provider falls into this category depends on what PHI reaches it, whether the provider retains or trains on that data, and what its own terms say. Have your privacy counsel review the provider's agreements and data handling terms before any PHI goes to it. Also confirm whether the arrangement needs a separate agreement from any Medplum agreement, since Medplum's paid cloud plans include standard BAA and MSA agreements.
Is HIPAA certification required for an AI agent setup that touches Medplum data?
No. HHS states that no Security Rule standard requires an entity to certify compliance, and that private certifications do not prevent HHS from later finding a violation. The HHS Office for Civil Rights enforces the rule through complaints, compliance reviews and audits, so your evidence needs to show how the agent setup meets the technical safeguards in 45 CFR 164.312. Those include unique user identification, automatic logoff, encryption and audit controls. Be cautious with vendors who offer a HIPAA certificate for an agent integration, because no such certificate exists. Ask instead for documented controls, test results and records your compliance team can review.
What should we check in the Medplum audit trail after an AI agent is connected?
Check that every read and write made through the agent is recorded with an identifiable client application, so you can tell agent activity apart from human staff activity. Review whether the audit events show which resources were touched, when, and under which policy, and confirm that denied requests are logged as well as successful ones. Test this with real scenarios in a non-production project: a permitted read, a blocked cross-patient lookup and an attempted write outside scope. Then check that your team can export and review those events during an incident or compliance review. Ask your Medplum administrator to confirm which audit features apply to your plan and deployment, since these depend on configuration.
Official Medplum and HIPAA sources to read first
Start with Medplum's authentication documentation before you design any agent access, because the MCP integration depends on how clients authenticate and what they are allowed to do. Read it with your team's current identity setup in front of you and confirm which sign-in methods your Medplum project supports, how client credentials are issued for server-to-server access, and whether multi-factor authentication applies to the identities an assistant will use. The Medplum authentication docs are the natural next read, and they should drive the decision on whether an agent gets its own client application or shares a human's login, which the rest of this page treats as a non-negotiable separation.
Then read Medplum's compliance documentation to see where Medplum's responsibilities end and yours begin. Medplum states that compliance is a shared responsibility, so the agent setup, its access policies, its logs and its data handling are yours to document and defend in a review. Ask your compliance lead to map each agent control to the Medplum features you use and to confirm, with Medplum, which controls apply to your hosting model, whether Medplum Cloud or self-hosted. The Medplum compliance docs give the starting point for that mapping.
For the legal baseline, read the HIPAA Security Rule as published in the eCFR, focusing on the technical safeguards in 45 CFR 164.312 for unique user identification, automatic logoff and encryption, and on 45 CFR 164.314 for business associate contract terms. Those terms matter here because any AI vendor or tool that handles ePHI on your behalf needs a contract that requires Security Rule compliance and incident reporting, and that flows down to its subcontractors. Confirm with your counsel whether the assistant provider signs a business associate agreement before any PHI reaches its service. The eCFR text for 45 CFR 164.314 is the natural next read for that conversation.
How DeployOpen scopes and tests agent access to Medplum
DeployOpen plans, implements and tests the setup that lets AI assistants reach Medplum data through MCP, inside infrastructure you control. The work covers the dedicated client applications, access policies, audit trail and data boundaries, and it is documented so your security and compliance teams can review it.
How we scope
- We confirm which assistants, workflows and Medplum resource types the agents need to reach.
- We map each agent to its own client application, access policy and permitted operations.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We deploy and configure the Medplum MCP integration on your self-hosted or approved environment.
- We set up agent credentials, token lifetimes and audit logging against your identity provider.
- We test prompt injection, tool permissions, PHI exposure and credential handling, then retest after fixes.
How we hand over
- We document the access model, policy definitions, audit event coverage and data boundaries.
- We deliver a findings report with fixes, retest results and the configuration needed to reproduce the setup.
- We walk your engineering and compliance teams through the controls so they can review and operate them.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Retainers can cover policy changes when new agents, assistants or Medplum versions are added.
- Ask for the support scope, response expectations and upgrade handling in the written quote.

