The Agent
Ask the Agent to build or investigate. It reads the engine as you, drafts workflows and fixes, shows its steps, and asks first before anything live, opening the screen where you make the change. On whenever AI features are on.
On this page
The Agent screen is MedHook's assistant. Ask it to build something, such as a new feed, or to find out why something broke, such as a failed message or a tunnel that went down. It reads the engine through the MedHook API with your permissions, shows each call it made, and puts what it made (a draft workflow, a diagnosis, a fix plan, a postmortem) beside the conversation. It never changes anything live: a change that would go live is a card that asks first and opens the screen where you make it yourself.
It is on whenever AI features are on, and an administrator can switch it off with CHAT_ENABLED=false; see Turn it on.
flowchart LR
Ask["Ask: build or investigate"] --> Reads["Reads, drafts and tests: does it alone"]
Reads --> Arts["Artifacts: draft, diagnosis, fix plan, postmortem"]
Reads --> Card["Live change: an Asks first card"]
Card --> Screen["Open in the screen that makes it"]
Screen --> You["You confirm there"]
You --> Done["The card reads Approved by you · done"]
Card --> Skip["Not now: nothing changes"]Before you start
- AI features on for the engine, with an AI provider set up. See Turn it on.
- Any role can open the Agent and ask it questions. What it can read is what your role can read. Operators and admins can attach files, dry-run drafts and act on its cards; only admins choose what it does alone. See Roles.
- Don't paste patient data or credentials. Secrets go in the adapter form. See PHI and secrets.
Turn it on
The Agent needs two things on the engine:
- AI turned on (
AI_FEATURES_ENABLED=truein production). See AI-assisted mapping and conditions. - An
ANTHROPIC_API_KEY(or Claude on your Vertex project).
In production it also stays off until an admin marks the Business Associate Agreement as signed in Settings, and an admin can turn the Agent off there on its own. There is no separate switch to turn it on: with AI on, the Agent is on. CHAT_ENABLED=false (any case) is an off switch for an engine that wants AI features without the Agent; any other value, or none, leaves it on.
| Where you deploy | AI on | Agent off (optional) |
|---|---|---|
| Environment | AI_FEATURES_ENABLED=true | CHAT_ENABLED=false |
| Helm | engine.aiFeaturesEnabled: true | engine.chatEnabled: false |
| GKE Terraform | engine_ai_features_enabled = true | engine_chat_enabled = false |
Restart the engine after you change them. With AI on, Agent is in the sidebar. Every role gets the same screen; what each person can read stays limited by their role.
While AI features are off, Agent opens on a card, AI features need a BAA first (or The Agent is turned off when an admin switched it off in Settings), with what the Agent would do: investigate failures across tunnels and connections, draft workflows from a description, map fields from a sample message, and write postmortems. Nothing is sent to an AI service while it's off.
- Ask an admin to turn it on tells the engine's admins, by email and on the Slack channel when those notification channels are connected, and the button then reads Asked. You can ask once a day: a second ask reads Already asked today. With no channel connected, the request is in the audit log only (
ai.access.requested). - Under the button, admins see where to turn it on: Admins: set AI_FEATURES_ENABLED=true while the engine's environment keeps AI off, otherwise a link to Admins: Settings › AI features.
With CHAT_ENABLED=false, the Agent screen says the Agent is switched off and how to turn it back on, and /api/ai/chat answers 404.
The Agent is the engine's only agent. The older agent loop (/api/ai/agent) and the workflow generator (/api/ai/workflow-build, including its GET status) are removed; GET /api/ai/chat reports AI availability, the model and your daily budget.
The Agent screen
The screen has three columns: Conversations on the left, the conversation in the middle, and Artifacts on the right. On a narrow window they stack.
| Part | What it holds |
|---|---|
| Conversations | New conversation, your past conversations, and at the bottom What it can do · 20 actions and Activity · today |
| The conversation | The header (the mode, Build or Investigate, the title and Pin), the thread, the bar of cards waiting for you, and the message box |
| Artifacts | What this conversation made: Built in this conversation or Found in this conversation, one tab per thing, with the action that goes with each |
Conversations
Each conversation is either building something or finding out why something broke. The mode follows how you started it: Ask the agent why on a failure, or the help panel's question, opens an Investigate conversation; Review AI rewrite from a Mirth import opens a Build one. Otherwise your first message decides ("Add a SIU feed …" builds, "Why did … fail?" investigates), and a draft, a guided setup or a card makes it Build.
The rail lists them under Pinned, Today and Earlier, newest first, each with its mode, its time ("13:40", "yesterday" or the date) and its first message as the title. Pick one to bring back its thread and draft and carry on where you left off. Pin in the header keeps a conversation under Pinned. While an answer is streaming, the other rows and New conversation wait.
Your conversation history is kept for 90 days. The engine keeps your conversations for you in each workspace, so they follow you to another browser; your team doesn't see them, and nobody else can open or delete them. It keeps up to 50 per workspace (the oldest unpinned go first) and deletes one 90 days after its last update. What you typed is PHI-scrubbed and encrypted before it is stored, and it never appears in the logs or the audit log: the audit log records only that a conversation was kept or deleted. Conversations this browser held from before are moved to the engine the first time you open the Agent. If the engine can't be reached, the rail works from this browser until you reload, and signing in again clears what it holds, so nothing outlives the session on a shared workstation. A conversation whose postmortem you posted reads shared with # in its header.
The thread
A new conversation opens with what the Agent does and three starters under Try:: "Why did the last PACS order fail?", "Add a SIU feed from Demo Health" and "Summarize today's incidents". A starter fills the message box; nothing is sent until you press Enter or Send.
Each Agent reply shows, in order:
- The steps chip, such as 2 steps · 3 s: open it to see every call it made, each with a one-line note and whether it was done, failed or held back. While it works, a Working row names the tools so far.
- The answer.
- Evidence chips that open the screen each read came from, such as Tunnel events, Queues or Connections.
- did it alone: the drafts it made, such as Created the draft workflow (not live). Nothing live is ever on this list.
- Cards: a question with one button per option (your pick is sent as your reply), a guided setup checkpoint, a profile, a replay plan, or an Asks first card.
Guided setup chips in the header start one of the four guided setups (see What it reads and drafts).
The message box
The placeholder follows the mode: Describe a change, or @mention what to build on or Ask what happened, or @mention a tunnel, connection or message. Enter sends and Shift+Enter adds a new line.
- Type
@to mention something: the Mention list shows the tunnels, connections, workflows and messages (by control id) whose name holds what you typed, up to 6 of each. ↑ and ↓ move, Enter or Tab picks, Esc closes. A pick adds a chip under Context, and the Agent reads that item as you. Only its id goes with your message, never its name; one item of each kind at a time. - + File attaches a partner's API document (operators and admins). See What it reads and drafts.
- Under the box: "@ to mention a workflow, tunnel, connection or message · it asks before anything live", and the reminder not to paste patient data or credentials. Hover it to see what the engine masks.
Artifacts
The panel has a tab for each thing the conversation made. With nothing made yet, Summary says Nothing produced yet.
| Mode | Tabs | What you can do |
|---|---|---|
| Build | Draft workflow, Data map (when it mapped fields), Test run | Save as draft and Open in builder. Test run dry-runs the saved draft on a sample message; until you save, it reads Save as draft to dry-run it on a sample message. |
| Investigate | Diagnosis, Fix plan, Postmortem | Diagnosis gives the cause and impact. Fix plan lists each step marked alone or asks first, and follows what came after: approved, skipped or recovered. Postmortem has Copy and Post to # · asks first |
Post to # · asks first posts the postmortem to the Slack channel connected under notification channels. It asks first: Post the postmortem to #? shows the text as it will be sent, with PHI removed, and nothing is sent until you choose Post. With no Slack channel connected, the button reads Post to Slack · asks first and is disabled. Viewers can't post. A post is audited as ai.postmortem.posted, without the text.
What it can do
What it can do · 20 actions at the bottom of the rail opens What the Agent can do in the middle column. Every action is a call to the MedHook API with your permissions, in five groups, with the API call behind it and its mode: Does it alone or Asks first.
| Group | Action | Mode |
|---|---|---|
| Workflows | Read workflows, versions and test cases | Does it alone |
| Workflows | Create and edit drafts | Does it alone |
| Workflows | Run tests with samples or pinned cases | Does it alone |
| Workflows | Deploy a version or start a canary | Always asks first: goes live |
| Workflows | Turn a workflow on or off | Always asks first: goes live |
| Workflows | Open an MLLP listener for a draft | Always asks first: goes live |
| Messages | Search messages with PHI masked | Does it alone |
| Messages | Reveal PHI in a message | Always asks first: PHI, audited |
| Messages | Dry-run a replay | Does it alone |
| Messages | Replay or reprocess messages | Always asks first: goes live |
| Messages | Pause or resume a destination queue | Asks first (an admin can switch it) |
| Tunnels | Read tunnels, events and IKE logs | Does it alone |
| Tunnels | Send an MLLP test through a tunnel | Does it alone |
| Tunnels | Rotate or roll back a PSK | Always asks first: changes a live tunnel |
| Tunnels | Send a one-time link outside MedHook | Always asks first: leaves MedHook |
| Connections | Read connections and test them | Does it alone |
| Connections | Change limits and timeouts | Asks first (an admin can switch it) |
| Connections | Replace a secret | Always asks first: credentials |
| Docs and messages | Write postmortems and summaries | Does it alone |
| Docs and messages | Post to Slack | Always asks first: leaves MedHook |
An admin switches a row between Does it alone and Asks first for the workspace; the change is audited as ai.capability.changed. Locked rows are dimmed and can't be switched. Other roles see every row with the switch disabled: Choose what the Agent does alone needs the Admin role. A row the Agent has no tool for yet reads The Agent can't do this yet.
The Agent follows these choices: a read or draft set to Asks first is never run from the conversation. Its step reads asks first · not run, and no API call is made. Anything that changes something still opens the screen that does it, even on a row set to Does it alone.
Activity
Activity · today opens Agent activity: every call the Agent made for you in this workspace, newest first, with the columns Time, Action, Conversation, Approved by and Result.
- Action is the tool and what it acted on, such as
get_workflow wf-demo. - Conversation is the conversation's title from your conversations, or Not in this tab when it isn't among them.
- Approved by names who made a card's change (two admins are joined with " + "), or reads asks first for a card or a held-back call, or what it did alone: alone · read, alone · draft or alone · PHI masked for a message search.
- Result is ok, passed for a test, not sent for a drafted email, failed · , or for a card done, waiting for 2nd admin, skipped or not run.
The workspace audit log link opens the audit log on its Agent filter, which holds everyone's Agent events.
Open it from any screen
The assistant also opens as a side panel on every dashboard screen: press ⌘J (Mac) or Ctrl+J. The sidebar's Agent link names the shortcut when you point at it. Escape closes it, and the conversation stays until you reload the page.
The panel knows what you have open and says so under its title (Knows this page:):
- the workflow open in the builder, and the step selected in the graph;
- the message selected on Messages (or linked with
?message=); - the tunnel on Tunnels.
Only the ids go with your question, never the page's content. The engine checks each id as you, in your current workspace, and tells the assistant which ones it can read; the assistant then reads them with its normal tools, under your role. An id that was deleted, or that belongs to another workspace, reaches the assistant as not available, without the id. Answers stream in as the assistant writes them. A draft it proposes appears below the conversation with Save as draft and Open in builder.
What it reads and drafts
This is what the Agent can answer and make for you. Each read and draft sits under a row of What it can do.
-
Answer questions about workflows, recent executions, adapter types, adapter profiles, tunnels, engine health and templates, and also:
- messages (search and one message's details), the failed messages Needs action lists (and whether Replay can run now), destination queues and batch reads;
- a workflow's version history, its deploy checklist, saved test cases and sender settings (the setting keys, not the values);
- topics and components;
- one tunnel's state, health and remote subnets (never the pre-shared key or peer settings), and why a tunnel is down in plain language: an IKE phase 1 proposal or pre-shared key mismatch, phase 2 subnets that differ, a BGP session down (the ASNs) or no prefixes advertised, one HA interface down, or the partner's firewall or ACL when the tunnel is up but the last reachability test failed. It names the fix on the partner's side, such as MedHook's IKE proposals or the subnets to set, and the next step;
- for an outage: one tunnel's state and how long it has been down, its events over a window, the IKE log excerpt (not available when the engine has no Cloud Logging access), its pre-shared key versions with when and by whom each was rotated (never the key), whether the network engineer opened the one-time link, and the deliveries waiting at each destination queue. The link's token and the key never reach the Agent;
- the license (status, term end, grace end and whether PHI workflows may run), the last 24 hours' metrics summary, and the audit log (when, event, resource, action and who; no event details, IP address or user agent). Who is the staff member's email or user id as stored, not masked: staff are not patients, and you need to know who did what.
It calls the engine's own API as you, so the role table, your workspace and PHI redaction apply exactly as they do in the UI. An id from another workspace, or one that was deleted, comes back as Not found or not available in this workspace.
-
Answer how-to questions from these docs. It searches the MedHook docs and reads the matching section, and links the page it used. The docs ship inside the engine image, match your engine's version and need no internet access; only the model call leaves the engine. Every role can use them. A how-to answer comes from the docs, the UI map or the API spec, with the page it used; when none of them covers your question, the assistant says it isn't sure and points you to the closest page instead of guessing steps or button names.
-
Explain how to call the API. It looks up an operation in the engine's OpenAPI spec (the one the API reference shows) by name, path or keywords, and gives you the method, path, parameters and request body. The spec ships inside the engine image like the docs. It only looks the operation up; it never calls it.
-
Tell you where a control is. Ask where a button, tab or menu item is (for example, where to rotate a tunnel's pre-shared key) and it names the screen, such as Tunnels or Messages, and the label on the control. The map of screens and labels is built from your engine's own UI when the image is built, so it only names controls your version has. Every role can use it.
-
Guide a setup. Pick one of the Guided setup chips in the conversation's header: Connect an EHR over FHIR, MLLP to FHIR store, SIU to BigQuery, or Site-to-site tunnel. It follows the steps and stops at each checkpoint: choose Confirm or an option, or type in the answer field and choose Send answer. A build request in your own words drafts from the matching template first and then offers the guided setup.
-
Draft a workflow, and prove it. The assistant drafts the workflow with this workspace's real adapter profiles, then checks it before you see it: the save checks first, then a dry run of every step on a sample. The sample is the one you paste, a stored message you name, or a synthetic Demo Health sample of the trigger's type. Nothing is sent: destinations only report what they would send. If a check fails, the assistant fixes the draft and checks it again, up to 3 times. The draft appears in the panel on the right, disabled, and the assistant tells you in the chat how each step did on the sample. If it still fails after 3 fixes, you get the last draft in the panel and, in the chat, the problems left to fix, and the assistant stops trying for that message. You choose Save as draft; deploying and enabling stay yours.
- Viewers get the save checks only: the dry run runs the workflow's code, so it is for operators and admins, as Test steps is.
- A step whose adapter profile you have not created yet is a warning, not a failure: create the profile, then pick it on the step.
- A stored message as the sample needs permission to view message content.
-
Prepare an adapter profile. A card lists the non-secret settings and the secret fields you will type. New connection opens the New connection form with that adapter and those settings filled in, and the secret fields empty. Every URL, host or endpoint the assistant filled in is marked Suggested by the assistant — verify this host before entering credentials, on the card and next to the field: a host can come from text the assistant read, so check it before you type a secret.
-
Read a message you paste. It parses HL7 v2, FHIR (R4 and R5), X12, CDA, JSON and CSV with the engine's own parsers, never by eye: the message type and version, each field's path with its dictionary name (
PID.3.1Patient Identifier List,2100C.NM103Subscriber Name), conformance problems against the built-in HL7 profiles (ADT^A01, ADT^A04, ADT^A08, ORU^R01) or FHIR resource checks, a JSON or FHIR body checked against a JSON Schema (the same keywords and checker as a webhook trigger's body schema), the value at one path (to check a mapping), and an HL7 v2 to FHIR or FHIR to HL7 v2 conversion. For an operator or admin, values in patient-identifying fields (PID-3, PID-5,Patient.name, NM1 names and the like) come back to the model as tokens such as[masked:3f2a], so it can say a field is populated without seeing it; for a viewer, or withAI_MESSAGE_CONTENT=false, no values come back at all (see Message content). It reads up to 1 MB and lists up to 400 fields; for a batch or a larger paste it reads the first message or the first part and says so. -
Propose a condition or mappings, checked on your sample. Describe a condition in plain words, such as "admissions from clinic DEMO", and the assistant proposes it with the engine's condition-suggest engine. HL7 v2 routing (the event, the message type, the sending facility or application) comes back as rules for a condition step or trigger filter, for example
MSH.9.2in A01, A04 andMSH.4.1equals DEMO; with a sample, the rules run on it with the condition step's own evaluator and the answer says whether the sample passes. Anything else comes back as a JavaScript expression, which is not run here: dry-run the draft to check it. Ask for mappings from a sample to a target format or schema and it uses the engine's mapping-suggest engine (the model sees a de-identified copy of the sample), then reads every source path on the sample and flags a path that is missing or empty there. Mapping proposals need an operator or admin, with message content on. Nothing is saved: the proposal goes into a draft you review. A sample over 200,000 characters is refused; pass one message, not a batch. -
Comment on a builder step. Ask what is wrong with a step (by default, the workflow open in the builder) and the assistant dry-runs the workflow up to that step on its saved sample, inside the engine, never sending. It answers with a short note on the output: a step that fails, a mapped field that comes out empty with its source path, or an output the next step or the destination cannot take. The note also appears on the step's Live proof in the builder, marked Assistant. The model gets the note, which names paths and steps, never a value from the sample. A viewer's note uses a synthetic Demo Health sample and the save checks only. A workflow that was deleted or is in another workspace is not available.
-
Explain a failed test, and propose the fix. When a test fails, Ask the Agent sits next to the error: on a failed step in the builder's test drawer (Run test and Run this step only), on a failed case under Test cases, on a failed Run with sample dry run, and on a failed step of a message on Messages. It opens the Agent and sends what failed as your message, so you see exactly what the Agent got:
- the workflow, the failed step's id and type, and the run or test case;
- the error's class (for example URL template value missing or authentication refused) and its text, with secrets masked and every value from the sample or message replaced by
[value]; - the step's settings, with secrets, header values and the user and password in a URL masked;
- the sample's shape: its field paths and their types (
$.patient.external_id text,PID.7 date), never a value.
The Agent answers with the likely cause. When a change to the step's settings fixes it (an Endpoint with a
{{...}}placeholder that belongs in URL template, a wrong path, a method), it shows a Proposed change card with each setting's old and new value. In the builder, Apply to draft makes the change in your unsaved draft and opens the step; run the test again, then save. Nothing is saved, deployed or sent for you, and the Agent never proposes a secret, a header or a step's type: you change those in the step or connection form. Elsewhere the card's Open step opens the step in the builder. On Messages, the Agent diagnoses the failed message as below. The Agent can also read one step's settings (secrets masked) and the saved sample's shape on its own, when the role may see message content. -
Diagnose a failure. Ask the agent why in a failed message's panel on Messages, or on a batch with failed rows opens the Agent with the question filled in; you press Send. You can also ask "why did execution … fail" with its id. The assistant reads the failed run's steps and Delivered records, the destination profile's name and type (never its settings or secrets), the health of a tunnel the destination sits behind, deploys of the workflow in the last day and its other failures in the last 24 hours. It answers with:
- the root cause and the evidence for it (the step, the delivery's status, the profile, the tunnel, a version deployed shortly before the failures, how many similar failures there were, a lane held by the failure);
- a class: data, mapping, destination, auth, tunnel or config;
- a proposed fix. For a required field that came out empty, a Data Map change (for example, read
PID.7instead ofPID.17forbirthDate), offered only when the engine's own mapper fills the field on the failing message with it; the failing message is its test case. For a 401 or 403, the profile to update in the adapter form. For a destination or tunnel that is down, wait. Nothing is applied: you change the step in the builder, or ask for a draft; - a replay plan: the failed messages, one per message, in lane order when they share an ordering lane, else oldest first, leaving out messages a later attempt already delivered. Uncertain deliveries (a run the engine restart interrupted, a send that timed out waiting for its ACK) are listed apart: the destination may already have them, so check it before replaying them from Needs action on Messages.
The plan shows as a card. Operators and admins replay from its button, as themselves, through the bulk replay API,
POST /api/ack-queue/replay(or one execution at a time for runs that are not messages); viewers see the plan without the button. The assistant never replays. The link is hidden while the assistant is off. -
Turn a Mirth or Rhapsody export into workflows. Ask it to migrate the export you uploaded, or the Mirth server you scanned, on Migration. It runs the same importer as the import screen and gives you one disabled draft per channel (up to 20 at a time) in the panel on the right. Imported steps that use E4X, or that the import left as a Mapper, Message Builder or Rhapsody mapper placeholder, go through Rewrite with AI: only the step's code is sent, never a message, and a rewrite goes into the draft only if it passes on a synthetic message (up to 10 rewrites at a time). Each draft is then tested like any draft the assistant makes: the save checks and a dry run of every step, never sending. The test cases are the channel's own sample from the export (a Mirth inbound template), or 3 synthetic Demo Health samples of the trigger's type when it has none; a channel whose trigger takes no sample (polling, a file reader) gets the save checks only. For each channel the assistant tells you how the test cases did and what did not convert and why: a connector MedHook has no adapter for, a step type the importer cannot convert (for example, an XSLT step: rewrite it as a JavaScript transform or a Data Map), or a rewrite that did not pass. Nothing is saved: you apply the import on Migration, then test and enable each workflow yourself. It is for operators and admins, because it reads the stored export and dry-runs the drafts. It never compares the results with Mirth's own output; the replay step on Migration does that.
-
Connect to a partner's API from its OpenAPI document. Attach the partner's OpenAPI 3.x or Swagger 2.0 document (a
.jsonor.yamlfile, up to 5 MB) with + File next to the message box, and name the operation. Don't paste it: the document is a contract, not a message, so it is uploaded as an attachment and does not count toward the 4,000-character message limit. The engine reads the document, resolving its$refs locally (a remote$refis refused), and the assistant lists the operations, the auth schemes and how each read pages. For one operation it proposes:- Call it: a Generic REST profile card (the base URL and the auth from the spec: OAuth2 client credentials with its token URL and scopes, an API key header, bearer or basic; you type the secrets in the form), and a disabled workflow: a webhook (JSON) or MLLP (HL7 v2) trigger, a data map from your sample to the request schema, and the REST call, with a URL template for path parameters, the full response for branching on the status, or paging for a list (cursor, next token, next URL, offset or page, as the spec suggests). The call step names no profile yet: save the proposed profile, then pick it on the step.
- Serve it: a disabled webhook workflow whose trigger checks the body against the operation's request schema (a body that does not match gets 400) and answers from its last step (response mode destination, with the spec's success status). Add the steps that do the work; the answer's values are placeholders until then.
The draft is proved before you see it, against an in-memory mock of the API built from the spec: it checks the auth, the path, the required parameters and the body against the request schema, and answers with the spec's example or a synthetic response. A request that does not match gets the 400 the partner would send, and the assistant tells you which fields are missing. The run reaches only the mock: nothing goes to the partner, or anywhere else, until you save the profile, type its secrets and deploy. Attaching a file needs an operator or admin. The attachment is stored encrypted in the engine's database for 7 days, in your workspace only, so it survives a restart and works on every replica; after 7 days it is deleted and you attach it again. Before anything from the document reaches the model, the mock or the proof, its
exampleandexamplesvalues are replaced with placeholders of the schema's type (a date stays a date), so a real record left in a spec's examples is never shown to the model. The model gets the attachment's id, never the file name. Uploads are audited asai.chat.attachment_uploaded(the id, size and hash, never the content). -
Draft adapter code. For a system no adapter or Generic REST profile can reach, it drafts code on the public adapter SDK, with a contract test. You can copy it, download it as Markdown, or copy it as a GitHub issue. It is not installed: it needs code, registration and a rebuild.
-
Draft an email, a postmortem or a code table change. Drafts only: nothing is sent, posted or saved. An email to the healthcare organization's network engineer about a new pre-shared key never holds the key or a link; a fresh one-time link is made when you send it from Tunnels. A postmortem comes from the diagnosis and goes on the Postmortem tab. A code table change is a draft version of the table (added, changed, unchanged and flagged codes) to copy or download; you apply it on Code tables.
Live changes ask first
When the Agent suggests a change to something live, such as rotating a tunnel's pre-shared key or deploying a version, it never makes the change. It shows a card instead:
- The card reads Asks first with the reason (for example, changes a live tunnel), the change, and the MedHook API call the screen makes. There is no Approve button.
- Open in and the screen's name (Open in Tunnels, say) opens the screen that makes the change. For a pre-shared key rotation, Tunnels opens on the tunnel with its Rotate the pre-shared key? confirm already up. Nothing changes until you confirm there, and the screen's own permissions, confirm and audit apply. Not now skips the card; nothing changes.
- While cards wait, a bar under the conversation reads n waiting for approval · live changes wait for you. Review all lists them under Review live changes, each with Open and Skip only.
- Once you've made the change on its screen, the card reads Approved by, your name, and · done, also when you reopen the conversation from the list on the left. Until then it can read something in between: a pre-shared key rotation reads · rotating until the tunnel takes the new key, and · failed if that background job fails. A deploy that needs a second admin reads waiting for 2nd admin until they approve it, then · ready to deploy until the version is deployed. A pending deploy card names an admin who can review it: Needs a second admin as well; Request approval asks every admin, including .
| The change | Opens |
|---|---|
| Deploy a version | The workflow's Versions, on its deploy card |
| Turn a workflow on or off | Workflows |
| Open an MLLP listener for a draft | The draft in the builder, with Open MLLP listener : on ? up |
| Reveal PHI, or replay or reprocess messages | Messages, on the message |
| Pause or resume a destination queue | Queues, on the lane |
| Rotate a PSK, or send a one-time link | Tunnels, on the tunnel |
| Change limits or replace a secret | Connections, on the connection |
PHI stays masked on the Agent screen. What the Agent sends to the AI provider is masked too, with limits: structured HL7 and FHIR identifiers are always masked, free text is masked on a best-effort basis (a name with no cue word can get through), and every prompt goes to the provider the engine is configured for (Anthropic or Vertex AI). The banner at the top of the Agent names the provider and the BAA state; it says Synthetic data only until a BAA covers the provider. A card to reveal PHI opens the message on Messages, where Show PHI asks for a reason and the reveal is audited as phi.revealed.
A draft that has never been deployed can listen before its first deploy. Confirm Open listener in the builder and the sender starts delivering: the builder reads MLLP listener : is open on with messages held until the first deploy. The messages are accepted and held in arrival order; the first deploy runs them, in order. Close listener stops it and keeps what it held for the deploy. Deleting the draft drops what it held, unrun. Opening and closing the listener needs operator or admin.
Not now on a pre-shared key rotation card asks the engine to watch the tunnel's one-time link. While the tunnel waits on the healthcare organization's firewall and a link is live, the Agent replies "OK, I won't touch it. The tunnel stays down until their firewall has v3. I'll watch the link and tell you the moment it's opened." (with the tunnel's real key version); otherwise it replies only "OK, I won't touch it." When their engineer opens the link, the engine tells you on the Agent asks first notification, with the tunnel's name and the time and never the key, and the conversation shows {tunnel}'s one-time link was opened at {HH:MM}. A watch waits up to 7 days.
A card also reaches you outside the screen: the Agent asks first notification goes to the person who started the conversation (Slack by default; set the channels in Settings › Notifications), names each card and links to the Agent. Nothing runs from the notification.
A role that cannot make the change (a viewer, say) sees the card's Open in button disabled, with what it needs.
What it cannot do
- Create, change, enable or deploy anything. There are no write tools.
- See or accept secrets. Never paste a password, key or token: secrets go in the adapter form. If one is pasted, the engine masks it before the model sees it.
- See message content. Executions come back as ids, status, timings, the failed step and a scrubbed, shortened error. Messages come back as metadata: id, control id, type, workflow, source, status, ACK, timing, format and segment names, never the body, the segments' fields, the output or the patient.
- Create tunnels or handle pre-shared keys. An admin does that on the Tunnels page.
- Reveal PHI. A message's details come back as metadata, and a stored message you name as a draft's sample goes to the model masked, audited as
message.viewedwith the Agent as the way in; in the audit log's PHI access it reads "masked fields only". Showing PHI is a person's action on Messages (see Live changes ask first). A step comment runs the step on the saved sample inside the engine; the model gets the note, not the sample. It can tell you how to name a field, such ashl7:OBX[2].5orhl7:PID.3(2).1; see Field paths.
Roles
Anyone signed in can open the Agent. What it can read depends on your role, because each read goes through the engine API as you. Viewers can look but not edit: they see the same answers, cards and artifacts, with the buttons that act disabled and a title that says the role they need.
| Action | Viewer | Operator | Admin |
|---|---|---|---|
| Ask, read answers, open past conversations, see What it can do and Activity | Yes | Yes | Yes |
| Attach a partner's API document, dry-run a draft, propose mappings | No | Yes | Yes |
| Act on a card (Open in a screen, Not now), post the postmortem | No | Yes | Yes |
| Choose what the Agent does alone | No | No | Yes |
Open in also needs the role the change itself needs on its screen: deploying, for example, needs operator or admin, and a deploy that needs a second admin waits for one.
PHI and secrets
Before anything reaches the model, the engine scrubs your message and the earlier turns.
A message you paste, on its own or inside a question, is parsed first: HL7 v2 (whatever its encoding characters), FHIR and JSON, X12, CDA and CSV. The values in patient-identifying fields become tokens such as [masked:3f2a], component by component, and the syntax stays as it is. One request uses one key, so the same value gets the same token in your message and in the earlier turns. When the assistant passes masked text to a message tool (reading, validating or converting a message, checking a condition or mapping on a sample, drafting a workflow from one), the engine swaps that request's tokens back for the real values before the tool runs, so a check is about your message and not about the tokens; the tool's answer is masked again before the model sees it. A token from another request is never swapped back.
| Format | Masked | Kept |
|---|---|---|
| HL7 v2 | PID, NK1, GT1, IN1 and IN2 person fields; PV1, ORC, OBR and ROL provider names and NPIs; NTE; OBX-5 unless it is coded or numeric; AL1, DG1 and PR1 descriptions; Z-segments; and every other field not on the keep-list, such as PV2 notes or PV1 admit times | MSH, message types, segment ids, and the keep-list: set ids, codes, units and flags (OBX-2, OBX-3, a coded or numeric OBX-5, AL1-3.1, DG1-3.1) |
| FHIR | Patient, RelatedPerson, Practitioner and Person names, identifiers, birth dates, telecoms and addresses; Organization contacts; every text, valueString and note | Keys, resourceType, resource ids, codes, coding displays (an identifier's type, such as MR), the use and system of a person's elements, quantities |
| X12 | NM1 names and ids, N3 and N4 addresses, DMG birth dates, REF ids | The envelope, segment ids and qualifiers |
| CDA | The recordTarget, author and custodian headers and the section narrative | Tags, template ids and codes |
Values outside those fields are not passed through as they are. In FHIR, JSON, X12 and CDA they go through pattern masking, and a JSON value under a key such as apiKey or password becomes [secret]. The prose around a message goes through the same pattern masking: names after a cue (including a single upper-case name, as in "patient TESTPATIENT"), MRNs, dates, SSNs, phone numbers (10-digit, and 7-digit such as 555-0100), emails, addresses, caret-joined HL7 values and secret-looking strings. The names of your workflows, profiles and tunnels, ids such as UUIDs, and times such as 10:30 are not masked. Pattern masking misses a name typed without a cue, so don't paste patient data.
The conversation stays in your browser: each message sends back up to the last 16 turns (24,000 characters). When an answer finishes, the engine signs a summary of the tools it used, with a key derived from ENGINE_AUTH_SECRET. The model is told an earlier answer was grounded in tools only when that signature checks out for that answer's text, so an edited or made-up history can't claim the engine looked something up. Without ENGINE_AUTH_SECRET (local development), earlier answers go back as text only.
Every API answer is reduced to a short list of fields, scrubbed again, cut to a few thousand characters, and marked as untrusted data, so text stored in a name or an error can't instruct the model.
Message content
Whether a tool result may carry message content depends on your role and one engine switch:
| Who | What the model gets from a message |
|---|---|
| Operator or admin (the default) | The content, masked as above: tokens for patient-identifying values, codes and syntax kept |
| Viewer | Metadata only: paths, field names, which fields hold PHI, the type, version and problems; never a value |
Anyone, with AI_MESSAGE_CONTENT=false | Metadata only, as for a viewer |
Content is on by default on the assumption that a BAA covers the deployment, or that only sample data is used. Set AI_MESSAGE_CONTENT=false (Helm engine.aiMessageContent: false) to turn it off for everyone. The tools always read the real message inside the engine; the switch changes only what goes back to the model, and the assistant is told which mode it is in. Problem messages are masked in both modes.
The same rule covers what you type. For an operator or admin, a message you paste into the chat goes to the model masked. For a viewer, or with AI_MESSAGE_CONTENT=false, a pasted message (HL7 v2, FHIR or other JSON, X12, CDA, CSV) reaches the model as structure only: it is replaced by a [message content withheld: ...] note that gives its format, its type and version, and the field paths that hold a value (such as PID.5.1), never the values. Your question around it still goes, scrubbed.
Audit
Every turn, tool call and draft is in the audit log with you as the actor:
| Event | When | Details |
|---|---|---|
ai.chat.turn | Each message you send | Model, model calls, tokens, tools used, outcome |
ai.chat.tool_call | Each tool the model runs | Tool, API operation, status, duration; the docs page for a docs read; the operationId when one API lookup matched |
ai.chat.proposed | Each draft or card, and each message it reads | Workflow, profile, scaffold, format, condition, mapping, step note, diagnosis, tunnel, migration or API document; adapter, template; for a step note, the workflow and step ids and the note's tone; for a diagnosis, the execution id, its class, the fix kind and how many messages the replay plan holds; for a tunnel explanation, the tunnel id, its state and where it fails; the format tool and the format read; for a workflow, where its sample came from, the stored message id it read, the fixes made and whether it passed; for a migration, the migration id, the export format, how many channels were drafted and whether every draft passed; for an API document, its id (a hash, never the text), the operation, call or serve, and whether the draft passed |
ai.chat.attachment_uploaded | Each file you attach | The attachment id, its size and SHA-256 hash; never the content or the file name |
ai.capability.changed | An admin switches a row in What it can do | The action, its mode before and after |
ai.proposal.resolved | You make a card's change on its screen | The action, its target, the step, who approved it and the version |
ai.proposal.skipped | Not now or Skip on a card | The action and its target |
ai.watch.created | Not now on a pre-shared key card starts a watch | The tunnel and the card |
ai.postmortem.posted | You post a postmortem | The channel and the conversation id; never the text |
ai.access.requested | Ask an admin to turn it on | You, as the actor |
Turns and tool calls carry the conversation's id (a random id, never its text), which is how Activity groups them; a call held back by Asks first is a tool call with notRun: true. Opening and closing a draft's listener are listener.opened and listener.closed. No message, answer or tool result is stored in the audit log. Saving a draft writes the usual workflow.created or adapter.profile.* event.
Limits
Each message can make up to 12 model calls and run up to 6 tools per call. Drafting a workflow makes its own model calls (the first draft and up to 3 fixes), counted in the same budget. So does each AI rewrite a migration makes (one call per step). The daily AI budget applies (AI_DAILY_TOKEN_LIMIT), and the route allows ten messages a minute. Each viewer also has their own daily allowance, AI_CHAT_VIEWER_DAILY_TOKEN_LIMIT (default 20,000 tokens, resetting at midnight UTC), so one read-only account cannot use up the whole engine's budget; operators and admins use the engine budget only. Set any of these limits to unlimited to turn that cap off; usage is still counted.