Document Review Copilot
Turn versioned rules and evidence into a verified draft for a named human reviewer.
- Kind
- Case study
- Level
- Core
- View
- Interview prep
- Sections
- 4
- By
- Sourav Banerjee
- Last updated
- 20 Nov 2026
Interview view. The case brief, design walkthrough, technical deep dives and quick review, condensed into bullets, tables and lines to say out loud, with interactive diagrams to step through.
Want to go deep? The full casebook has the complete reasoning in prose, the original diagrams, practice questions with worked answers and the sources.
Case brief
The case in one line: a copilot that compares permitted documents with the governing rule, cites every supported fact, keeps every gap visible and leaves the decision with a named human.
30-Second Cheat Sheet
- The product: a person compares documents with requirements; the copilot finds facts, links them to source passages, flags missing or conflicting evidence and prepares a draft for review.
- The anchor example: a healthcare coordinator preparing a prior-authorisation request for a payer.
- Who decides: a named clinician approves, edits or rejects. External submission is a separately authorised action.
- The hard rule: missing evidence stays a gap. It never becomes a claim that treatment happened.
- The check before review: confirm the software could read the required pages and tables at all.
- The parser trap: if page 7's policy table is unreadable, stop, reprocess, validate. More search can't restore evidence that never reached the index.
- First release: internal drafts only, PHI minimised, reviewer edits not training data by default.
- Evaluate separately: extraction accuracy, claim support, citation correctness and escalation.
1. From a document packet to a reviewable draft
What the copilot does
- It helps a person compare documents with a set of requirements.
- It finds the relevant facts and links them to the source passages.
- It identifies missing or conflicting evidence.
- It prepares a draft for review.
- The output should make a decision easier to check, with a clear account of what the documents do and do not support.
The anchor workflow: prior authorisation
| Term | Meaning |
|---|---|
| Prior authorisation | A request for an insurer to approve a procedure |
| Payer | The insurer. It publishes a policy describing the required evidence |
| Request packet | The draft request plus the supporting patient records, assembled by the coordinator |
| Coordinator | Assembles the packet. Prepares; does not approve |
| Named clinician | Checks the clinical content and approves, edits or rejects the draft |
| External submission | A separately authorised action, outside the draft flow |
Other review tasks on the same approach
| Workflow | Compares |
|---|---|
| Compliance analyst | A communication with applicable obligations |
| Lawyer | Contract clauses with an approved playbook |
| Claims processing | Reuses evidence extraction and triage |
- Each workflow has different rules, data permissions and decision owners.
- Caveat: the healthcare example does not validate those other uses.
2. One request, from records to outstanding questions
Illustrative case: the payer's policy requires evidence of a previous therapy.
- Ask. The coordinator selects the patient's case and asks for an internal draft.
- Scope. The copilot needs:
- The records the coordinator may access.
- The policy version applicable to the procedure and date of service.
- Extract. It pulls the relevant facts and keeps their page or passage references.
- Compare. It checks those facts against the policy's requirements.
- Gap. No evidence of the previous therapy → that requirement is marked a gap.
- It must not turn missing evidence into a claim that treatment occurred.
- Deliver. The coordinator receives:
- A draft with supporting citations.
- A missing-evidence list.
- Unresolved conflicts.
- Review. The clinician can follow each citation, request more records, edit the draft or reject it.
The core-idea figure, as a flow
Check the software could read the required pages and tables → extract evidence → compare against rules → draft supported text → human approval
- The readability check happens before the human review. A draft built on unread pages can't be trusted, however good it reads.
3. The design task and first release
The task in one sentence
Design the path from permitted documents and the applicable rule to a supported draft and a recorded human decision, keeping uncertainty visible throughout.
What you must explain
- Document extraction
- Rule-version selection
- Evidence fields
- Comparisons
- Citation checks
- Escalation
The dangerous constraint: page 7
- Page 7 holds a required policy table, but the parser cannot read it.
Parser = the software that extracts text and tables from documents.
- Stop the affected review.
- Reprocess the document.
- Validate the corrected extraction before relying on it.
- Why: more search results cannot restore evidence that never reached the index.
First-release boundaries
- Produces internal drafts only.
- Qualified human owners keep clinical, legal, compliance and claims decisions.
- Changing case records, sending communications and submitting externally need a separately approved action flow.
- Access controls and data minimisation apply to PHI and other sensitive records.
- Reviewer edits do not become training data by default.
PHI = protected health information: health data tied to a person.
Who it's for and what it assumes
- Engineers designing review workflows, or preparing for forward-deployed, solutions or applied-AI interviews.
- Helps to know: APIs, parsing, retrieval and model calls.
How the sections divide the work
- Design walkthrough: develop the design.
- Technical deep dives: examine its mechanisms.
- Practice (in the full casebook): test it.
- Quick review: the card for the night before.
Evaluate four things apart
- Extraction accuracy: did the field come out of the document?
- Claim support: does the draft claim follow from the evidence?
- Citation correctness: does the link point at the supporting passage?
- Escalation: did the case reach the right reviewer?
- A good result on one does not establish the others.
Soundbite: "Extraction, support, citation and escalation each get their own gate. Passing one proves nothing about the others."
Quick Recall: Lines to Say in the Interview
- "The copilot drafts; the named clinician decides."
- "Missing evidence is a gap, never a claim that treatment happened."
- "Pick the policy version for the procedure and the date of service."
- "If page 7's table is unreadable, stop, reprocess and validate. More search can't restore what never reached the index."
- "External submission is a separately authorised action, not part of the draft."
- "Reviewer edits are not training data by default."
- "The healthcare example doesn't validate the compliance or contract uses."
Design walkthrough
The goal: a drafting workflow built around the reviewer's decision: a versioned rule, validated document coverage, typed evidence with spans, deterministic comparison, verified citations and a named human approval.
30-Second Cheat Sheet
- Start with the decision and its owner: coordinator prepares, clinician approves, manager approves rollout stages, privacy officer can block release.
- Ask for the top 5 by volume and the top 5 by consequence: routine extraction for one, careful exception review for the other.
- Make every outcome testable: governing rule, typed fields, supporting passages, visible gaps, complete audit.
- One processing spine: prepare evidence in the background; at request time scope the user, retrieve, extract with a smaller model, compare in deterministic code, route, draft hard cases with a stronger model, verify citations.
- Three boundaries, not one: extraction, verification and human approval. A stronger model doesn't merge them.
- Fields carry provenance and state: present, absent, not extracted, conflicting. An OCR failure isn't "undocumented".
- Scope travels everywhere: retrieval, index, model input, provider routing, logs and UI.
- Evaluate each stage against SME labels, then roll out offline → shadow → read-only pilot → one low-risk category.
1. Find the decision and its owner
Who owns what
- Coordinator assembling records → needs a draft and missing-evidence list.
- Clinician → needs to verify clinical claims before signing.
- Operations manager → needs preparation time, rework and failure rates.
- Privacy or compliance officer → needs evidence of access and audit controls, plus authority to stop a release that violates them.
Split the work early
- Ask for the five highest-volume cases and the five with the greatest consequences if wrong.
- They may need different treatment: routine extraction for one group, careful exception review for the other.
- Agree which operations read, draft or change data.
- Then identify:
- The governing rules and their effective dates.
- The critical fields and tables.
- Patient or matter permissions.
- Allowed provider handling.
- The escalation route.
Discovery questions that determine the workflow
| Question to ask | What the answer decides |
|---|---|
| Which exact review workflow is slow, risky or inconsistent today, and what decision does the user make at the end? | Scope of the first slice and the definition of done |
| Who is the primary user, who reviews the output, and who owns the risk if the assistant is wrong? | Approval routing and the audit trail's audience |
| Which tasks are read-only, which draft-only, and which need explicit human approval before write-back? | The tool allowlist and the risk tiers |
| Which systems hold the trusted source of truth, and how do their permissions, freshness and ownership differ? | Connector list, ACL mapping, freshness SLO per source |
| What are the top 5 recurring cases by volume and the top 5 highest-risk cases by impact? | Where the cheap path and the expensive path each go |
| What answer must the assistant refuse or escalate instead of generating? | The output policy engine's refuse and escalate modes |
| What audit evidence must be stored so security, legal or management can reconstruct why the system answered? | The audit record's fields |
| Are payer rules structured policies, PDFs, web portals or internal documents? | The ingestion pipeline and the table-extraction gate |
| Are we allowed to generate text that goes directly to the payer, or only internal drafts? | Whether external submission exists at all in version one |
| How should the system behave when clinical notes conflict with payer rules? | The conflict policy: surface, prefer the approved current source, escalate |
| Which PHI fields are necessary, and what is excluded from prompts and logs? | Data minimisation and log redaction rules |
ACL = access control list: who may see or change a thing. SLO = service level objective: the target you commit to internally.
Users, noticed failures and approval roles
| User | Workflow | Failure they notice first | What the copilot gives them | Approval role |
|---|---|---|---|---|
| Coordinator, analyst or contract reviewer | Selects the case, gathers the packet, checks required evidence, finds what's missing | A packet that comes back incomplete or wrong | Draft with citations, missing-evidence list, denial-risk or deviation explanation | Prepares; does not approve |
| Clinician, compliance manager or counsel | Reviews the draft, confirms necessity or risk, overrides wrong suggestions, approves | Language that reads as a decision they did not make | Editable draft, every claim linked to its source, with confidence and escalation reason | Approves, rejects, edits or asks for more documentation |
| Revenue-cycle, surveillance or legal-ops manager | Tracks denial patterns, false-positive burden, turnaround | A tool that adds review time without improving first-pass rate | Dashboards separating operational from safety metrics | Approves rollout stages |
| Compliance or privacy officer | Reviews audit logs, access controls, PHI handling | A record accessed without a reason, or PHI in a log | Immutable audit of evidence IDs, policy versions, edits and approvals; least-privilege access | Any violation blocks release |
Conflicts go to the owner, not the model
- In a prior-authorisation case, "rule out" in a note is not a confirmed diagnosis.
- A governing rule and clinical notes can disagree or leave evidence missing.
- Expose the conflict with source versions and route it to the professional who owns the decision.
- Never manufacture a resolution from general model knowledge.
2. Specify what must be observable
Every required outcome is independently checkable
- Select the governing rule for the case.
- Extract facts or clauses into named fields with defined types.
- Attach their supporting passages.
- Compare them with the requirements.
- A draft may use only supported claims.
- Missing, stale or conflicting evidence stays visible and routes to the named reviewer.
- The audit keeps the evidence and rule versions, generated draft, edits and final state.
Reviewer and operator needs
- Reviewer actions: explicit edit, approve, reject and override, with a reason where the workflow requires one.
- Show confidence next to the field or gap it describes. Confidence is not an approval.
- Govern how corrections enter evaluation and whether any later training is allowed.
- Operators need source freshness, policy configuration, blocked actions and an audit export.
Testable constraints and illustrative latency expectations
| Constraint | Stated so it can be tested |
|---|---|
| Latency | Interactive questions 3 to 8 s; packet generation under 10 to 20 s per the vendor case; bulk surveillance overnight as batch, with interactive p95 under 10 s for analyst drill-down. Longer workflows go asynchronous with progress state |
| Availability | Business-critical hours, graceful degradation when the LLM, vector store or a source system is down: partial packet with gaps labelled, or refusal, never a silent guess |
| Cost | Token budgets, caching for stable policy documents, retrieval pruning, small models for classification and extraction, strong model only on flagged risk. Reported as cost per document and cost per true issue found |
| Security and privacy | SSO; RBAC and ABAC; source-level ACLs and patient-level restrictions; encryption in transit and at rest; secrets management; no training on customer data unless the contract allows; PHI minimised in prompts and redacted from logs |
| Audit and compliance | Immutable log of queries, retrieved evidence IDs, policy versions, model and prompt version, policy decisions, reviewer edits, approvals and final output, with full evidence traceability for every generated statement |
| Reliability | Fail closed on permission uncertainty, stale rules, missing citations and any high-risk write. Degrade on retrieval quality. Low hallucination tolerance for clinical, payer or policy claims |
p95 = 95% of requests finish faster than that figure. SSO = single sign-on. RBAC = permissions by role. ABAC = permissions by attributes such as region, department or data sensitivity.
Requirements and the components that implement them
| Requirement | Primary component(s) |
|---|---|
| Governing rule by version | Policy ingestion pipeline, rule versioning store, rule retriever |
| Evidence and clause extraction | Parser with table extraction, extraction service with schema, evidence mapper |
| Draft with span-level citations | Drafting service, citation builder, citation verifier |
| Missing evidence and gap detection | Completeness and risk checker |
| Route material cases to a human | Risk tiering, review queue, approval workflow |
| Complete audit trail | Audit and compliance layer, trace store |
| No cross-user or cross-patient disclosure | Identity mapping, permission-aware retrieval, output policy engine |
| Fail closed on missing citation | Citation verifier, output policy engine |
Caveats on the numbers
- Source figures: interactive answers 3 to 8 s, packet generation around 10 to 20 s, overnight batch screening, drill-down p95 below 10 s.
- The packet range is a source-reported expectation, not a demonstrated benchmark for this prototype.
- Longer jobs need status and an asynchronous result.
- Missing permissions, governing rules, material citations or required approval stop the transition even when the service is busy.
3. Draw one processing spine
Two halves
- Background (prepare evidence):
- Ingest approved documents and versioned rules.
- Parse pages and tables.
- Measure extraction coverage.
- Request time (review one case):
- Authenticate the user; bind the tenant and patient or matter.
- Classify the operation as reading, drafting or acting before touching the case.
- Retrieve the permitted evidence and the applicable rule version.
- A smaller model extracts typed fields linked to their supporting spans.
- Deterministic comparison code applies the requirements and flags gaps or conflicts.
- Route unknown or high-risk cases to the right reviewer.
- A stronger model drafts difficult cases from the selected evidence.
- Verify each material citation before presenting an editable draft for human review.
Tenant = the organisation boundary used to isolate records. Typed field = a value with a defined structure.
The control plane versions everything
- It versions extraction schemas, rules, thresholds, approval routes, identity mappings, connector credentials, parsers, prompts, models, budgets and evaluation gates.
- The serving path records those versions.
- Why: otherwise a changed threshold or parser could silently alter a review while the audit still points at the old behaviour.
Components, responsibilities and failure behaviour
| Component | Responsibility | Fails how |
|---|---|---|
| Gateway and identity | Authenticate via SSO, load role and tenant, scope to patient or matter, classify read, draft or action | Closed: no scope, no case |
| Rule ingestion and version store | Ingest payer policies, regulations, playbooks; version by effective and expiry date | Degrades: an unversioned rule is excluded, not guessed |
| Parser, table extractor, layout QA | PDFs to text and tables; emit coverage and confidence; gate high-risk documents | Closed: low table coverage on a high-risk document fails ingestion |
| Extraction service | Map content into the schema for its type with a cheap model | Degrades: low-confidence fields flagged as missing, never filled |
| Rule retriever | Fetch the governing rule at the right version, under the user's permissions | Closed: no permitted rule, no draft |
| Comparison and gap detector | Evidence against criteria; missing, stale, conflicting flagged | Degrades: gaps listed, draft marked incomplete |
| Risk classifier and router | Assign a tier; decide reviewer-accept versus named-approver | Closed: unknown tier routes up, never down |
| Drafting service | Strong model only on flagged tiers; never writes decision language | Refuses when evidence is missing or conflicting |
| Citation builder and verifier | Cite the exact supporting span; reject any citation that isn't the span used or isn't permitted | Closed on span mismatch |
| Approval workflow | Named approver edits, approves, rejects; nothing external leaves without it | Closed: no approver, no submission |
| Audit, trace, eval, dashboards | Rule IDs and versions, evidence IDs, draft, edits, approval; golden and red-team evals; operational and safety metrics apart | Degrades: preparation continues, gap logged; approval waits for a durable audit record |
QA = quality assurance: checking it works before real users see it.
Three boundaries to defend
- Extraction turns source documents into uncertain typed evidence.
- Verification tests whether a draft and its citation are supported.
- Human approval authorises the material decision.
Soundbite: "Buying a stronger model doesn't collapse extraction, verification and approval into one reliable step."
4. Make the schema carry evidence
A field explains its value and where it came from
- Store alongside each extracted value:
- The source document.
- Page or offsets.
- Version.
- Confidence or a missing-state reason.
- The comparison can then join a case fact to the applicable rule and show the reviewer the evidence.
- A value without provenance cannot support that explanation.
Fields per workflow
| Workflow | Fields to preserve | Compared with |
|---|---|---|
| Prior authorisation | Payer, plan, procedure, diagnosis codes, date of service, prior therapies, labs, imaging | Payer policy (a low-confidence diagnosis stays uncertain) |
| Compliance | Document type, jurisdiction, product, business unit, obligation, evidence span | Applicable obligations |
| Contract | Clause type, normalised text, counterparty, jurisdiction, confidentiality | The approved playbook |
Four field states, kept apart
| State | Meaning |
|---|---|
| Present | Found, with its span |
| Absent from the supplied records | The records really don't contain it |
| Not extracted | The software couldn't read it |
| Conflicting | Sources disagree |
- A typed representation gives deterministic code something concrete to validate.
- If OCR can't read the therapy table, the system has not established that therapy is undocumented. It has an extraction failure.
- Keep the page reference.
- Block the affected conclusion until reprocessing or review resolves it.
- A model returning a long summary of the file doesn't prove the required field was found or that the source supports it.
OCR = optical character recognition: turning scanned pages into text.
5. Keep sensitive data inside its scope
Scope travels with the request
- SSO establishes identity.
- Role and attribute policies apply to the requested tenant and patient, customer or matter.
- Carry that scope through retrieval, index access, model input, provider routing, logs and the review interface.
- Checking a patient ID at the gateway is insufficient if a later search can return another patient's record.
Controls
- Least-privilege credentials, encryption and secret management.
- Minimise prompts and redact logs.
- Agree retention/deletion and residency.
- Review provider contracts and training restrictions.
- Store source IDs and rule versions when raw content is unnecessary.
- An approved break-glass workflow requires a reason and audit trail.
- Retrieved instructions in a PDF or email cannot widen permissions or trigger submission.
Break-glass = an emergency access path that bypasses normal limits, with every use justified and audited.
6. Evaluate each stage against a human reference
Four stage questions
- Did extraction recover the required field?
- Does each draft claim follow from the evidence?
- Does its citation point to the actual supporting span?
- Did the case reach the right reviewer?
- Historical decisions reviewed by SMEs can help set these labels.
- Model-generated scores alone cannot supply the reference.
- Audit high-risk extraction fields on a sample every release.
SME = subject-matter expert: the person who can tell you if an answer is right.
Illustrative evaluation bars, failure thresholds and owners
| Metric | Good threshold | Bad threshold | Test dataset | Owner |
|---|---|---|---|---|
| Extraction accuracy on a sampled audit | Agreed bar per field; high-risk fields audited every release | Any drop on a high-risk field | Sampled documents with SME-labelled fields | SME / eval |
| Answer groundedness | >= 90% supported claims |
< 80% |
Golden Q&A + SME review | FDE / SME |
| Citation accuracy at span level | >= 95% correct citations |
< 85% |
Source-span audit with clause-level labels | SME |
| Permission and PHI violations | 0 |
> 0 |
ACL and PHI red-team suite | Security |
| Escalation quality | >= 95% correct escalation on high-risk cases |
Missed high-risk case | Risk-labelled scenarios | Product / compliance |
| Task completion | >= 80% workflows completed with less manual effort |
< 65% |
Workflow replay tests | Product |
| Unsupported claim rate | Blocked or flagged, trending to zero | Any unsupported claim in an approved packet | Evidence-faithfulness review | SME |
| Reviewer override rate and edits | Falling over the pilot; spikes investigated | Rising | Production telemetry | Product |
| p95 latency and cost per document | Within budget; cost per true issue found tracked | Breach | Load test + telemetry | Platform |
FDE = forward deployed engineer.
Caveats on those bars
- Source example targets: groundedness at least 90% (below 80% bad); citation correctness at least 95% (below 85% bad); high-risk escalation at least 95%; task completion at least 80% (below 65% bad).
- PHI or permission violations must be zero in the defined suite.
- These are design examples, not clinical validation standards or a claim of regulatory compliance.
- The SME, Product, Security and Platform owners must agree the actual gates.
What to track in production
- All workflows: unsupported approved claims, false-positive burden, reviewer overrides, extraction accuracy, p95 and cost.
- An edit-rate spike can indicate drift.
- A low edit rate alone doesn't prove quality if reviewers have stopped checking.
- Prior authorisation: preparation time, first-pass approval, coordinator rework, clinician review time, denial categories by payer.
- Compliance: high-risk recall, escalation precision, audit completeness, injection resilience and drift.
7. Roll out through shadow work
The sequence
- Weeks 0-1: agree workflow, risk boundary, success measures, source owners, approvals and exclusions.
- Weeks 1-2: ingest a limited approved corpus, validate offline; no external submission or write-back.
- Weeks 2-3: compare historical cases with expert decisions; run adversarial tests.
- Weeks 3-4: shadow mode: drafts measured while users can't act on them. Calibrate risk thresholds before the reviewer pilot.
- Around week 5: read-only reviewer pilot with citations, uncertainty, feedback and escalation.
- Weeks 6-8: one high-volume, low-risk category, payer or business unit with approved draft actions.
- After: expand only when observed outcomes justify it.
Shadow mode = the system runs on real cases and is measured, but its output is never shown to the people acting on the case.
Rollout stages and gates
| Stage | Gate |
|---|---|
| Week 0-1 | Define the workflow, risk boundary, success metrics, source owners, approval rules and non-goals |
| Week 1-2 | Ingest a limited approved corpus; offline prototype, no write-back, no external communication |
| Week 2-3 | Golden dataset from historical cases and SME-approved answers; red-team and permission tests |
| Week 3-4 | Shadow mode: drafts generated, compared with human decisions, never shown to end users; thresholds calibrated by risk category |
| Week 5 | Read-only pilot with citations, confidence, feedback capture, escalation path; coordinators use drafts, every request needs the approver |
| Week 6-8 | Draft-only workflow actions behind human approval; one high-volume low-risk category first, such as imaging authorisation or one business unit |
| After | Outcome measurement: approval rate, denial reasons, preparation time, override rate. Expand payers, categories or document types only while eval metrics, incident rate, latency and cost hold; keep the rollback plan |
- Autonomous adjudication would need additional governance beyond this design.
Every change is a release
- A parser, chunker, model, prompt, rule or threshold change is a versioned release.
- Keep the previous configuration and compatible evidence/index state for rollback.
- Publishing a new parser without coverage regression tests can make a previously correct answer impossible.
Soundbite: "A parser upgrade is a release. It gets regression tests and a rollback, like a model change."
Quick Recall: Lines to Say in the Interview
- "Who owns the decision at the end of this review, and who can stop a release?"
- "Give me the top five by volume and the top five by consequence."
- "Small model extracts, deterministic code compares, the strong model drafts only flagged cases."
- "Extraction, verification and human approval are three boundaries. A stronger model doesn't merge them."
- "An unreadable therapy table is an extraction failure, not missing therapy."
- "Scope rides through retrieval, model input, logs and the UI, not just the gateway."
- "Groundedness 90%, citation 95%, escalation 95%, zero PHI violations: design examples the owners must agree."
- "Offline, then shadow, then a read-only pilot, then one low-risk category."
- "Every parser, prompt or threshold change is a versioned release with a rollback."
Technical deep dives
The goal: the mechanisms behind the follow-ups: per-workflow schemas, parser coverage, rule-version joins, citation and approval states, failure behaviour, two source incidents and cost routing.
30-Second Cheat Sheet
- One spine, three schemas: prior authorisation, financial compliance and legal contracts swap records, rules and approvers, not the pipeline.
- Parser coverage before publishing: a non-empty file or a successful HTTP response doesn't prove the critical table survived.
- Rule selection is a join over attributes and time: "latest" can pick a future rule for an older case.
- Explicit case states; approval binds to the exact draft, case, evidence set and rule version. Any material change → fresh approval.
- Document text is data. Identity, output policy and tool approval run outside the model.
- Incident 1: groundedness 0.91, citation accuracy 0.38. Two components, two gates.
- Incident 2: 9 of 17 tables (52.9%). Raising top-k can't retrieve absent content.
- Cost: dedupe, select sections, small models for extraction, strong model on flagged cases; track cost per true issue found.
1. One spine, distinct schemas and source contracts
Prior authorisation
- Extract facts from encounter notes, codes, labs, imaging and therapy records.
- Select the payer/plan/procedure rule for the service date; map each required fact to its evidence.
- Records:
Patient,Encounter,PayerPolicy,AuthRequest,EvidenceLink,AuditLog. - Reviewer gets a cited packet, missing-evidence flags and any denial-risk explanation the evidence supports.
- The clinician keeps the clinical decision.
Financial compliance
- Ingests adviser email, chat, marketing drafts, client and regulatory documents.
- Rules depend on jurisdiction, product and business unit.
- Records:
Document,Rule,Finding,ReviewerDecision,AuditLog. They link obligations to exact evidence, severity and remediation. - An analyst reviews routine findings; a supervisor or counsel reviews higher-risk cases.
- Caveat: a banned-phrase detector can miss subtle promissory language and does not establish supervision quality.
Legal contract
- Starts with uploaded contracts and extracted clauses, not clinical fields.
- Records:
Contract,Clause,PlaybookRule,RiskFinding,ReviewAction. They keep clause type and jurisdiction. - Compare to preferred terms and approved fallback language.
- A model must not invent legal language or accept a material fallback without counsel.
- Matter confidentiality, privilege and counterparty scope affect retrieval and display.
How three workflows map onto the shared processing spine
| Prior authorisation | Financial compliance | Legal contract | |
|---|---|---|---|
| Document in | Patient encounter, clinical notes, labs, imaging, prior therapies | Advisor email, chat, marketing draft, client or regulatory document | Uploaded contract |
| Governing rule | Payer policy, versioned by payer, plan, procedure, diagnosis, date of service | Regulatory rule library and internal policy, by jurisdiction and product | Negotiation playbook and clause library, by clause type |
| Extraction | Medical-necessity evidence mapped to payer requirements | Policy gaps, promissory language, disclosure gaps | Clauses by type, normalised text |
| Comparison | Evidence versus criteria; missing documents; conflicting notes | Text versus obligation; severity | Clause versus preferred position; deviation |
| Output | Draft packet with citations, denial-risk explanation | Findings with rule citations, risk class, remediation notes | Flagged deviations, risk rationale, proposed fallback language |
| Human | Clinician approves before submission | Analyst, then supervisor or legal on high risk | Counsel on material changes |
| Records | Patient, Encounter, PayerPolicy, AuthRequest, EvidenceLink, AuditLog | Document, Rule, Finding, ReviewerDecision, AuditLog | Contract, Clause, PlaybookRule, RiskFinding, ReviewAction |
| Sources | EHR via FHIR, payer portals, document store, claims system, IdP, audit logs | DMS, policy repository, regulatory rule library, GRC platform, case management, IdP | CLM, contract repository, clause library, playbook, DMS, e-signature, IdP |
| Persona-specific red-team | PHI leakage, invented necessity, stale payer rule, wrong patient, "just submit it anyway" | Missed violation, outdated regulation, hallucinated rule, over-automation of legal judgement | Unauthorised legal advice, privilege leakage, wrong jurisdiction, hallucinated clause, risky fallback accepted without a lawyer |
EHR = electronic health record. FHIR = the health-data exchange standard. CLM = contract lifecycle management. DMS = document management. GRC = governance, risk and compliance. IdP = identity provider.
Source formats, owners, freshness, permissions and failure risks
| Data source | Format | Owner | Freshness | Permission model | Risk |
|---|---|---|---|---|---|
| EHR via FHIR | Structured codes, notes, labs, imaging reports | Clinical informatics | Minutes if the EHR supports FHIR Subscriptions; otherwise polled | Patient-level and role-based; break-the-glass audited | Wrong patient; PHI over-exposure; "rule out" read as confirmed |
| Payer policy portals and PDFs | Semi-structured PDFs, portal pages | Payer relations | Days to weeks; versioned by effective date | Public or contract-restricted | Outdated rule version; tables dropped by the parser; injection in an uploaded PDF |
| Regulatory rule library and GRC | Structured obligations, policy documents | Compliance | Weeks; versioned | Business-unit and jurisdiction | Superseded obligation; wrong jurisdiction |
| Advisor communications | Email, chat, drafts | Surveillance | Real time; immutable ingestion | Supervisory and legal hold | Injection inside reviewed messages; PII and financial data |
| CLM and contract repository | Contracts, clause library, playbook | Legal ops | Days | Matter-level and confidentiality level; privilege | Privilege leakage; wrong jurisdiction; stale playbook |
| Case, claims and e-signature systems | Structured records | Operations | Minutes | Queue and role membership | Write-back without approval |
Freshness caveats
- Minute-level EHR updates depend on actual subscription support; otherwise polling governs lag.
- Subscription support alone doesn't guarantee update latency.
- In FHIR R5, event numbering and heartbeats help a client detect missed notifications; delivery behaviour depends on the channel and server (FHIR R5 subscriptions).
- So:
- Persist the last processed event.
- Reconcile gaps against the source.
- Make repeated notifications idempotent before publishing a new evidence version.
- Payer PDFs and portals change over days or weeks, sometimes with future effective dates.
- Regulatory libraries and internal policies need jurisdiction and version tracking.
- Adviser communications arrive continuously and need retention controls.
- CLM, DMS, GRC, claims and e-sign systems each keep their own ownership and permission contracts.
Idempotent = processing the same notification twice gives the same result as processing it once.
Claims processing
- Can reuse classification, OCR, extraction, summarisation and missing-information triage.
- Fraud or anomaly signals need explainability, thresholds, human decision evaluation and rollout by claim type.
- Treat autonomous adjudication as a separate scope with additional approval and evidence requirements.
- An example from one workflow does not validate the others.
2. Parser coverage and rule-version selection
Measure what the parser recovered, before retrieval sees it
- OCR turns scanned page images into text, but extraction can still miss rotated tables, reading order or page anchors.
- Check:
- Page-level coverage
- Layout confidence
- Detected vs extracted table counts
- The specific regions the review needs
- A non-empty file or successful HTTP response doesn't prove those regions survived.
Extract tables apart from prose
- Keep each row or row group with its header and schema metadata.
- A zero-overlap row record can work when the header travels with it.
- Never split the condition from its threshold, or the approver from the applicable amount.
- Keep page anchors and the original document so operators and reviewers can inspect the evidence.
The coverage gate
- Agree a coverage gate for policy documents with tables.
- Below it, fail ingestion and reprocess with OCR/table fallback. A warning isn't enough when the omitted content governs the decision.
- Block affected questions until the corrected index passes checks.
- Re-evaluate every parser/chunker change against rotated pages, merged cells, layout changes and known critical tables.
Rule selection is a join over case attributes and time
- Choose the policy effective at the date of service or applicable transaction, including expiry and jurisdiction.
- "Latest" can select a future rule for an older case.
- Store and show the selected version and any mismatch.
- Notes conflict with policy → keep both evidence sets and escalate the gap. Never use a model to invent the missing clinical fact.
Soundbite: "Rule selection is a join on payer, plan, procedure and the date of service, not a lookup of the latest PDF."
3. Drafting, citation verification and approval states
The schema limits what later stages may assume
- A smaller model fills routine fields from permitted evidence.
- Comparison code checks extracted fields against the rule.
- Unknown and conflicting values stay explicit rather than becoming plausible facts.
- Flagged or difficult case → selected evidence goes to a stronger model, and the reason for that route is recorded.
- Model size can't compensate for an omitted source table.
Citation builder and verifier
- The builder attaches the exact supporting span, page or clause to each material claim.
- The verifier checks:
- Semantic support
- Source version
- Whether the reviewer may open the evidence
- It must not attach the nearest chunk or shortest plausible clause because the answer sounds right.
- A contract fallback from an approved playbook still needs counsel where the approval policy requires it.
Case states
ingested → extraction validated → gaps/risk assessed → draft verified → pending review → approved or rejected
- An edit creates a new draft version and sends it back through verification and review.
- Approval binds to the exact draft, case identity, evidence set and governing-rule version the reviewer inspected.
- Any of those changes materially → fresh approval.
- "Just submit" doesn't skip the permitted human transition.
- Approval workflow or required citation verification unavailable → case stays pending.
Audit before finality
- Final decisions need an immutable audit.
- Audit storage down → internal preparation may continue with a visible audit-pending state.
- Final approval or any external transition waits until its audit record is durable.
4. Sensitive data, injection and degraded service
Classify records before choosing where stages run
- Patient information, personal data, financial records and privileged contracts need scoped access through the whole pipeline.
- Agree with their owners: encryption, tenancy, retention/deletion, audit, residency, human oversight, explainability, model/prompt versions, incident response, vendor risk and governance.
- Caveat: production requirements depend on the workflow and its professional and legal review. This case doesn't determine compliance.
Injection
- A document can tell the model to ignore the reviewer, expose another patient or invoke a tool.
- Keep document text as data.
- The gateway binds identity and scope.
- Output policy and tool approval checks run outside the model.
- A disclaimer has no effect on a credential or a submission endpoint.
Failure responses by stage
| Fails | Behaviour |
|---|---|
| Parser drops tables or pages on a high-risk document | Ingestion fails; reprocessed with OCR and table fallback; affected questions blocked until the corrected index is live |
| Rule version missing or stale for the date of service | Draft refused; policy-version mismatch counted; reviewer told which version was expected |
| Evidence missing, conflicting, or a note says "rule out" | Gap flagged, no language invented, case escalated to the clinician or analyst |
| Citation span doesn't match the claim | Response rejected; low citation-accuracy answers routed to human review |
| Wrong patient or matter in scope | Closed: patient-level restriction in retrieval, never in the prompt |
| Retrieved document carries embedded instructions | Treated as untrusted data (this lowers but doesn't stop injection), so it can never trigger an action or widen access; suspicious chunks flagged; red-team test in the gate |
| LLM, vector store or a source system down | Partial packet with gaps labelled, or refusal; overnight batch queued; never a silent guess |
| User asks to "just submit it anyway" | Refused; autonomous submission is disabled by design |
| Approval workflow unavailable | Fail closed. Nothing leaves. |
Read the table as outcomes
- Missing or stale rule → return the expected version and a clear refusal or escalation.
- Missing step therapy → a gap.
- Wrong patient → fails closed.
- Mismatched span → rejects the draft.
- Provider, index or source outage → a labelled partial packet or queued batch, never a complete-looking decision with hidden gaps.
- Material approval stays blocked when required evidence or approval is missing.
What the audit keeps
- References to input documents, rule versions, parser/schema/model/prompt versions, extracted fields, comparisons, evidence links, generated drafts, reviewer edits and final state.
- Restrict trace access and avoid unnecessary raw PHI.
- Why: investigation is possible without turning every prompt into a permanent copy of the patient record.
5. Incident: correct answer, wrong clause
Source-reported example (legal review, 8 July 2026), not an incident observed in this prototype.
What happened
- The answer described the correct 30-day termination-for-convenience right but linked the wrong clause.
- Clause 8.2 supported the claim; the response cited Clause 12.4, a data-processing clause.
- Groundedness 0.91, citation accuracy 0.38.
- Those scores diagnose two different components: generating a supported statement, and attaching the evidence the reviewer will open.
Replay keys and root cause
| Key | Value |
|---|---|
| Trace | trc_cite_2088 |
| Request | req_legal_33102 |
| Document | doc_contoso_msa_2026 |
| Tenant | acme |
| Pipeline | cite_v5 |
- The wrong clause scored 0.74, the true clause 0.68; the correct span ranked seventh.
- Reranking used
semantic_similarityandheading_matchbut lacked clause-type features. - The verifier recorded
span_match=falseand still allowed the draft because groundedness exceeded 0.85.
Response
- Contain: roll back to
cite_v4; route low-citation-confidence drafts to human review. - Repair: the exact-span gate and clause-type features.
- Replay the termination example and other clause families.
- Measure apart: answer correctness, citation correctness and quote/span match.
- Highlight the actual source clause in the UI.
Soundbite: "A correct general answer with a misleading legal link still fails the product's evidence promise."
6. Incident: the policy table never reached the index
Source-reported example (compliance, the second 8 July 2026 incident), not observed in this prototype.
What happened
- A compliance answer missed the requirement for Head of Compliance plus Legal approval on a trade exception above €5 million.
- The PDF had 48 pages and 17 detected tables.
- Extraction recovered nine tables: 52.9% (
9 ÷ 17 × 100, rounded to one decimal place). - Caveat: even all 17 recovered wouldn't prove the €5 million threshold, currency and joint-approval cells came out right. Check those critical cells against the original page too.
- Layout confidence 0.61 and
ocr_fallback=false, yet ingestion reported success. - The defect was in the index before the user asked.
The trace
| Signal | Value |
|---|---|
| Trace / request | trc_parse_8827 / req_fin_55019 |
| Missing text | Pages 31, 32 and 33 |
| Expected table | restricted_list_threshold_matrix on page 32 |
| Retrieval returned | Pages 12, 13, 14 and 21 |
| Context flags | table_required=true, chunk_has_table=false, completeness 0.46 |
| Index | 184 chunks, heading_aware_v2, text_embed_v5 |
Root cause
- A parser upgrade from
pdf_extract_v2.9topdf_extract_v3.2regressed on rotated landscape tables. - The document was misclassified as a plain policy, so coverage was a warning, not a hard gate.
Response
- Reprocess with OCR/table fallback.
- Manually inspect the missing pages.
- Rebuild and validate the affected index; block those questions meanwhile.
- Prevent: policy-with-tables classification, critical-page coverage gates, rotation regression fixtures, stored page warnings.
Soundbite: "Raising top-k cannot retrieve absent content."
7. Cost, bulk screening and delivery pressure
Where the money goes
- Start with how much document text is processed and which model processes it.
- In the source design, long input contexts and every page through the strongest model dominate cost.
- Levers:
- Deduplicate repeated templates by content hash.
- Select relevant sections.
- Smaller models for routine typed extraction.
- Deterministic code for comparing requirements.
- Stronger drafting only for flagged cases.
- Audit the cheaper path's extraction and support quality as well.
Cost drivers, routing and measurement
| Question | Answer |
|---|---|
| Dominant driver | Input tokens on long documents, and every page going through the strongest model |
| Cheapest lever first | Extract only the relevant sections first; dedupe templated documents by hash; cheap model for extraction, strong model only on flagged risk; batch the non-urgent queue off-peak |
| Metric that proves it | Cost per document; tokens per document; escalation rate; extraction accuracy on a sampled audit |
| Do not | Send the whole document to the premium model every time |
Bulk surveillance
- Inexpensive rules or classifiers screen all items; borderline or high-risk cases go to the model and reviewer.
- Sample low-risk cases to detect missed issues.
- Monitor the flagged fraction: if it grows, expensive work can approach the full workload.
- Prioritise high-risk queues, precompute rule matches and embeddings, use off-peak batch where the workflow permits.
Eighteen seconds against a below-ten-second target
- Profile stages first.
- Parallelise independent lookups.
- Cache permission/version-sensitive work (keyed on those versions).
- Reduce irrelevant context and tune candidate counts.
- Stream to improve perceived progress.
- Keep material citation verification synchronous before serving an actionable draft.
- Only non-material explanatory work may move later, under the agreed risk policy.
Measure value, not just the bill
- Track cost per document and cost per true issue found, plus tokens, extraction accuracy, escalation and reviewer effort.
- A global switch to a cheaper model can cut the bill while increasing missed high-risk findings.
- Business value, failure cost and ROI assumptions need observed workflow data before expansion.
8. References and source context
Boundaries on the claims
- The November review adds:
- The FHIR R5 notification-delivery qualification above.
- The split between unread fields and absent evidence.
- Approval bound to a verified draft version.
- Incident counts and scores are source-reported examples, not incidents observed in this prototype.
- Table counts and confidence scores are diagnostic signals, not clinical validation results.
- Tables and diagrams keep source case data; numerical targets are illustrative unless explicitly identified otherwise.
- This adaptation reorganises the source's repeated interview, deep-dive, cheat-sheet and full-pack explanations.
- The source lists a 27 September 2026 reference check. Its retention, supervision and vendor examples need current workflow-specific review before a production claim.
Reference list
- HL7 FHIR R5 Subscriptions framework
- FINRA Books and Records (SEA 17a-4, FINRA 4511)
- FINRA Rule 3110: Supervision
- Unstructured partitioning (infer_table_structure)
- OWASP GenAI LLM01:2025 Prompt Injection
- MSRC: How Microsoft defends against indirect prompt injection attacks (Jul 2025)
Quick Recall: Lines to Say in the Interview
- "Same spine for prior auth, compliance and contracts; swap the schema, the rule and the approver."
- "A successful HTTP response doesn't prove the critical table survived parsing."
- "'Latest' can select a future rule for an older case."
- "Approval binds to the exact draft, evidence set and rule version. Change one, approve again."
- "Patient scope lives in retrieval, never in the prompt."
- "Groundedness 0.91 with citation accuracy 0.38: two components, two gates."
- "Nine of seventeen tables is 52.9%, and raising top-k cannot retrieve absent content."
- "Track cost per true issue found, and watch the flagged fraction."
- "If audit storage is down, preparation continues; final approval waits."
Quick review
One sentence: build a versioned evidence-to-draft pipeline whose parser, citations and approval transitions can be tested independently, and keep the final professional decision with the named reviewer.
30-Second Cheat Sheet
- Scope first: the user and the case, then permitted evidence and the effective rule version.
- Validate coverage before extraction counts; unread critical content blocks ingestion.
- Missing facts stay missing. Gaps stay visible.
- Citations point to supporting spans, verified before review.
- Material actions wait for approval by the required professional.
- Gate groundedness and citation apart: 0.91 can sit beside 0.38.
- 9 of 17 tables = 52.9%. Higher top-k can't recover an omitted table.
- Small models for routine extraction, strong drafting for flagged cases; offline → shadow → one reviewer category.
1. Recall the processing and approval path
The path
Scope user and case → retrieve permitted evidence + effective rule version → validate document coverage → extract fields with supporting spans → compare requirements, keep gaps visible → draft only from that evidence → verify material citations → required professional approval → record versions, edits and final state
- Record: source and configuration versions, reviewer edits and the final state.
Six rules govern the path
- The copilot drafts. It doesn't decide.
- Rules match case attributes and effective dates.
- Unread critical content blocks ingestion.
- Missing facts stay missing.
- Citations must point to supporting spans.
- Material actions wait for approval.
- Plus: sensitive data stays scoped at every boundary.
2. Recall the incident tests
The numbers
| Test | Value | Lesson |
|---|---|---|
| Wrong-clause incident | Groundedness 0.91, citation accuracy 0.38 | They can coexist. Gate them separately |
| Parser incident | Nine of seventeen tables = 52.9% coverage | Higher top-k can't recover its omitted table |
| Wrong-patient record | Fails access checks | Fails even if the answer would otherwise be correct |
Cost and rollout
- Smaller models for routine extraction; stronger drafting for flagged cases.
- Monitor:
- The flagged fraction
- Cost per document
- Cost per true issue
- High-risk recall
- Rollout: start offline, then shadow, then one reviewer category.
- A disclaimer cannot authorise a submission or repair missing evidence.
3. Close with the owned decision
Closing line: "Build a versioned evidence-to-draft pipeline whose parser, citations and approval transitions can be tested independently, and keep the final professional decision with the named reviewer."
- Versioned: rules, parsers, prompts and thresholds are releases.
- Tested independently: parser coverage, citation spans and approval transitions each have their own gate.
- Owned: the named reviewer makes the professional decision; the copilot prepares it.
Flashcard Drill
Quick Recall: Lines to Say in the Interview
- "The copilot drafts; the named reviewer decides."
- "Rules match case attributes and effective dates."
- "Unread critical content blocks ingestion."
- "Missing facts stay missing."
- "Groundedness 0.91 beside citation accuracy 0.38: gate them separately."
- "Nine of seventeen tables is 52.9%, and higher top-k can't recover the omitted one."
- "A wrong-patient record fails access checks even if the answer is right."
- "A disclaimer can't authorise a submission or repair missing evidence."
Where next
- Revise the concepts