ClearPass AI — Clinical Safety Through Agent Collaboration

Inspiration

Working closely with healthcare professionals, we discovered a frightening reality: dangerous medical errors don't always happen because clinicians don't know better , they happen because clinicians are overwhelmed. A patient with a titanium implant gets sent for an MRI. A patient with a penicillin allergy receives amoxicillin. A patient on warfarin goes into surgery without anticoagulation review.

These are preventable mistakes. We built ClearPass AI to prevent them.

The idea was validated through direct conversations with practicing doctors who confirmed that time pressure, data overload, and fragmented patient records are the root causes of these near-misses. One doctor told us:

"Time critical patients don't leave a lot of time for patient history — which forces us to coordinate with relatives, but that information could not be 100% correct."

That quote became our mission statement.


What It Does

ClearPass AI is a clinical safety ecosystem built on the Prompt Opinion platform using A2A agent collaboration.

It consists of three intelligent agents working together:

🛡️ ClearPass AI (Safety Core)

The specialist safety agent. Any other agent in the ecosystem can consult it before performing a clinical action. It checks patient records against org safety policies and returns severity-graded safety reports:

  • 🔴 CRITICAL — Do not proceed
  • 🟡 CAUTION — Specialist clearance required
  • 🟢 CLEARED — Safe to proceed

Agent Ecosystem — ClearPass AI + Discharge Planner

ClearPass AI doesn't work alone. It serves as the safety backbone for a growing ecosystem of clinical agents.

How Discharge Planner works with ClearPass AI

When a doctor initiates a patient discharge, the Discharge Planner agent prepares the full discharge summary — but before finalising anything, it automatically consults ClearPass AI via A2A

No unsafe medication leaves the hospital. This is A2A collaboration solving a real clinical problem.

📋 Discharge Planner

Prepares complete patient discharge summaries. Before finalising any medication list, it automatically consults ClearPass AI via A2A removing unsafe medications and replacing them with safe alternatives per org policy.

🏥 PreOp Guard (Future Addition)

Pre-operative safety checker. Before any surgery is confirmed, it checks anticoagulants, implants, allergies, diabetes management, and anaesthesia risks all verified through ClearPass AI.


How We Built It

Platform

Built entirely on Prompt Opinion using their native A2A and MCP infrastructure no custom glue code required.

Knowledge Base

Patient records and clinical org policies are stored in Prompt Opinion's vector store (Po Collections), enabling semantic search and retrieval across all patient documents.

Agent Architecture

Doctor Query ↓ Discharge Planner / PreOp Guard ↓ (A2A consultation) ClearPass AI ↓ (knowledge base lookup) Patient Records + Org Policies ↓ Severity-graded Safety Report ↑ Back to clinician via originating agent

Safety Policies

We created a comprehensive org policy document covering:

  • MRI safety protocols (implants, pacemakers, contrast dye)
  • Medication safety (penicillin, sulfa, NSAIDs, anticoagulants)
  • Procedure safety (pregnancy, renal failure, diabetes)
  • Escalation protocols

Test Patients

Six realistic test patients were created covering a wide range of contraindication scenarios — from a patient with a titanium hip implant and penicillin allergy to a pregnant patient and a completely healthy control.


Challenges We Faced

Knowledge Base Retrieval

The biggest technical challenge was ensuring patient records were actually retrieved from the vector store rather than the model hallucinating clean records. We solved this by explicitly instructing the agent to only use knowledge base data and to accept inline patient data passed via A2A.

A2A Data Passing

When agents consulted ClearPass via A2A, patient context sometimes wasn't being passed correctly. We refined the consult prompts to include explicit patient identifiers and clinical details in every A2A call.

Balancing Specificity vs Generality

We wanted ClearPass to be specific enough to catch real contraindications but general enough to work across any hospital's workflow. The org policy document architecture solved this — hospitals can customise the policies while the agent logic stays the same.


What We Learned

  • A2A is genuinely powerful — watching two agents collaborate to produce a safer clinical outcome than either could alone was remarkable
  • Prompt engineering is clinical work — the difference between an agent that hallucinates and one that saves lives is in how precisely you write its instructions
  • Real problems need real validation — talking to actual doctors before building anything made every design decision clearer and more grounded

What's Next

  • Integration with live FHIR servers for real patient data
  • PreOp Guard agent for full surgical safety workflows
  • Medication Recommender agent that suggests treatments and verifies safety through ClearPass before recommending
  • Expansion of org policy library for different hospital types

Built With

  • Prompt Opinion (A2A, BYO Agents, Knowledge Base)
  • FHIR data standards (AllergyIntolerance, Condition, Device, MedicationStatement, Procedure)
  • GPT-4o via GitHub Models
  • Clinical safety protocols validated with practicing physicians

Future Scope

ClearPass AI is designed to be the safety backbone for an entire clinical agent ecosystem. Any agent that touches a patient can consult it. Here's what that ecosystem looks like:

Agent What it does Why it needs ClearPass
PreOp Guard Pre-surgical safety checklist Checks implants, anticoagulants, anaesthesia risks
Medication Recommender Suggests treatments for symptoms Verifies suggestions are safe before presenting to doctor
Lab Test Ordering Agent Orders diagnostic tests Checks contrast dye safety before CT/MRI orders
Prescription Writer Drafts prescriptions Validates against allergies before generating
Triage Agent Prioritises incoming patients Flags high-risk patients needing immediate safety review
Clinical Trial Matcher Matches patients to trials Checks if patient conditions disqualify them safely
Referral Agent Manages specialist referrals Checks if referred procedure is safe for that patient
ICU Monitoring Agent Monitors critical patients Alerts when new medication order conflicts with history

The vision: every clinical action in a hospital workspace passes through ClearPass AI before reaching the patient.

Built With

  • gpt-4o
  • promptopinion
Share this project:

Updates