The Most Important AI Discipline No One Talks About: Context Engineering in Healthcare
There’s a pattern in how healthcare organizations talk about their AI systems. When something goes wrong, whether it’s a hallucinated drug interaction, a confused clinical agent, or a recommendation that completely missed a patient’s situation, the instinct is to blame the model or the prompt. Reactions like, “We need a better foundation model,” or “The prompt should be more specific,” are common. But that framing misses what’s actually happening.
The model is rarely the problem, and the prompt alone is rarely enough of a solution. What’s usually missing is something more fundamental: the right clinical context, assembled the right way, at the right moment. Achieving that requires discipline, and it’s one that most healthcare organizations haven’t yet developed.
Why Prompt Engineering Is the Wrong Frame for Clinical AI
Prompt engineering gained traction because it was observable and low-cost. Teams could iterate on a prompt, evaluate the output a large language model (LLM) produced, and continue refining it until they achieved an acceptable balance of accuracy, speed, and cost. It felt like leverage.
Prompt engineering can create leverage, but only to a point. Instructions, phrasing, and few-shot examples can meaningfully improve output quality. However, prompt engineering as a practice treats the model like a static function: put text in, get text out, tune the input. Lather, rinse, repeat.
Real clinical AI systems aren’t like that. They’re stateful, operate across complex care environments, make decisions over time, and interact with electronic health record (EHR) data, lab systems, imaging, pharmacy records, and clinical guidelines. A prompt that performs beautifully in a sandbox can fail in production if the model doesn’t have access to the information it needs.
Imagine asking an attending physician to evaluate a patient’s medication regimen. You hand them a slip of paper that says, “Is this medication list appropriate?” That’s the prompt. But where’s the patient’s full chart? Their allergies? Kidney function? Current diagnoses? The formulary? The relevant clinical guidelines? Without that information, the question can’t be answered responsibly.

This is what happens when we treat prompting as the primary engineering challenge of AI. We optimize the question while overlooking whether the model has the information it needs to produce a reliable answer.
Context Windows Are Not Clinical Understanding
To leverage AI effectively, we need to optimize context. Most AI systems, such as LLMs, operate within a context window, the model’s immediate, finite working space. It represents the complete set of information available to the model at the moment it reasons through a task.
In our example, the context window isn’t a permanent memory or a repository of clinical expertise; it’s a temporary, curated workspace. Unlike a clinician, whose decisions are informed by years of training, a model is limited entirely to the information provided within that window. If a critical piece of information, such as a lab result or allergy, isn’t present, the model can’t account for it.
Mistaking an LLM’s context window for a clinical mind is to fundamentally misunderstand how these systems operate. A model possesses no inherent awareness of a patient population, formulary, institutional protocols, or organizational policies. It can reason only with the information currently available to it. This is the defining architectural property of these systems, and it has profound implications for how they’re designed.
When a clinical decision support tool recommends a medication that’s contraindicated for a patient, the real question isn’t whether the model should have known better. It’s whether the model had the information it needed to make the recommendation. Was the patient’s allergy list, renal function, and current lab data available? If any of those were missing, the model wasn’t making a poorly reasoned decision. It was making the best recommendation it could with incomplete information, just as any clinician would if asked to make a decision without the full chart.
The model’s reasoning is applied only to the information it receives. Your job is to make sure it’s given the right information.
Context Engineering as a Clinical Discipline
Context engineering is the practice of deliberately assembling what goes into a model’s context window at inference time and defining the boundaries around what should and shouldn’t be included. It sounds deceptively simple. It isn’t.
Done well, context engineering in healthcare requires deliberate decisions across at least five dimensions.

1. Retrieval
What patient data and clinical knowledge does this request require, and how do you retrieve it? This is where retrieval-augmented generation (RAG) fits, but RAG is only one approach. Key considerations include the retrieval strategy across fragmented EHRs, surfacing the most relevant encounter notes from charts containing thousands of entries, and determining how the system should respond when retrieved information conflicts with outdated model knowledge. A sepsis screening tool that retrieves yesterday’s vital signs instead of the previous two hours’ trend is retrieving the wrong information.
2. Tool Selection
Modern AI systems don’t just generate text. They take actions. They query lab systems, access medication histories, retrieve imaging reports, check drug interaction databases, and alert care teams.
Which tools are available to a given agent based on the clinical workflow and the user’s role? Tool selection is an architectural decision, not a default setting. An agent that can query every available data source is an agent that will eventually access the wrong one or expose information it shouldn’t.
3. Permission Scope
What should the model be allowed to see? What should it be allowed to do?
In healthcare, those decisions are shaped by HIPAA’s minimum necessary standard, role-based access controls, and the reality that a clinician and a billing specialist have different information needs. Context engineering therefore intersects directly with PHI governance, consent frameworks, and authorization logic. The model’s inputs shouldn’t reflect everything that’s available. They should reflect only what’s clinically appropriate and legally permissible.
4. Memory and Session State
Useful AI systems remember information within an encounter, across a patient’s care journey, about a care team’s preferences, and around institutional protocols. But memory isn’t free. Unconstrained accumulation creates noise, increases PHI retention risks, and produces contexts that eventually become too large to be useful.
Good context engineering deliberately defines what gets persisted, summarized, pruned, and retrieved on demand. A patient’s chronic condition list may be persisted, prior encounter notes summarized, resolved acute issues removed, and historical lab trends retrieved only when needed.
5. Interaction Boundaries
What should the model refuse to engage with, escalate to a clinician, or flag for review?
These decisions are an essential part of the context architecture. A model’s context should explicitly define its scope, operating constraints, and escalation conditions. That means supportive decision aids should never function as autonomous prescribers, out-of-range values should always trigger alerts, and pediatric dosing questions should be routed to pharmacy review. Those boundaries should be established before the model generates an output.
This Is Clinical Infrastructure, Not Configuration
Here’s where the conversation shifts for clinical informatics leaders and healthcare IT architects. Each of the dimensions above represents an engineering decision that builds on the next. The retrieval strategy determines what the model knows about the patient, which influences the tools it can use. Those tools shape the orders and alerts that become available, driving the HIPAA authorizations that must be enforced. Those permissions determine what gets recorded in the audit trail, what information is retained in memory, and ultimately what informs the next retrieval.
These aren’t prompt-level concerns. They’re system-level concerns that demand the same rigor as EHR schema design, HL7 FHIR interface specifications, or clinical access control architecture.
Organizations doing this well have stopped asking, “What should the prompt say?” as their primary question. Instead, they’re asking, “What does the model need to see about this patient, at this point in their care, within this clinician’s scope?” They’re also asking, “How do we ensure it never sees what it shouldn’t?” That shift in thinking leads to fundamentally different engineering decisions and clinical outcomes.
In Healthcare, Context Is Also a Patient Safety Mechanism
Context engineering in healthcare directly affects patient safety.
Consider a documentation assistant supporting emergency physicians. If the model generates a discharge summary with medication instructions, evaluating the output alone isn’t enough. The more important question is whether the model had the patient’s medication reconciliation, the attending physician’s verbal instructions, and any pending lab results available when it generated the summary.
Context is also a critical part of the audit trail. It’s the mechanism that allows organizations to demonstrate to the Centers for Medicare & Medicaid Services, the Joint Commission, and internal risk management teams that the model operated within defined clinical boundaries using appropriate, current information. A prompt alone can’t provide that level of traceability. A thoughtfully engineered context, with controlled inputs, logged state, and traceable data lineage, can.
Clinical AI systems that fail in production often do so because information was assembled incorrectly. Common causes include missing or stale data, information from the wrong patient encounter, or data that was never intended to inform the decision being made. Done well, context engineering makes these failure modes both traceable and preventable.
The Stakes Are Higher Than in Most Industries
Healthcare AI operates in an environment where errors have direct consequences for patients. That asymmetry changes the calculus around context engineering in ways that don’t apply in most other industries.
When a financial services AI misclassifies a transaction, there’s usually a remediation path. The transaction can be reversed, the customer can be compensated, or the model can be retrained. When a clinical AI system provides guidance based on missing or outdated information, however, care may already have been delivered. The opportunity to correct the error is much narrower, and the consequences can be far more significant.

This means healthcare AI teams must treat context completeness as a first-class reliability concern. That includes validating the information flowing into the model, not just the output coming out of it. It also means being able to replay what the model saw. Teams should have explicit plans for scenarios such as delayed EHR APIs or patient allergies documented only in legacy systems.
These are a few of the defining challenges of deploying AI responsibly in clinical environments.
The Discipline Is Still Being Built and Healthcare Needs to Lead It
To be clear, context engineering doesn’t yet have the tooling, vocabulary, or established patterns that prompt engineering does. Much of what’s known today lives with the teams that have successfully deployed clinical AI systems and learned from real-world failures, including ours.
That is beginning to change. Healthcare organizations that invest in context engineering now, treating it as a foundational clinical informatics capability rather than an afterthought, are building expertise that will be difficult to replicate from a prompt-first starting point. More importantly, they’re building AI systems that clinicians can trust because the information flowing into those systems is governed just as carefully as the information flowing out.
The underlying insight is straightforward, even if the practice is not: models are only as effective as the information they receive. You can’t solve a context problem by switching foundation models, and you can’t prompt your way around missing patient data.
The healthcare organizations that recognize this earliest will build AI systems that perform reliably in the ICU, the emergency department, the outpatient clinic, and every other environment where real patients, real clinical decisions, and real regulatory requirements intersect.
That’s what good context engineering makes possible. In healthcare, it’s more than a competitive advantage. It’s a clinical imperative.
The News(fire)
Curated insights delivered monthly to your inbox.