CG-Probes: Recovering Guardrail Directions from Patient Query Embeddings
Organizations: Faculty of Informatics Masaryk University Brno, Czech Republic · Dept. of Pediatric Oncology University Hospital Brno Brno, Czech Republic · Faculty of Medicine Masaryk University · Masaryk Memorial Cancer Institute Brno, Czech Republic
Abstract
Patient-facing AI assistants promise valuable support to patients, but incoming queries can pose medical risks. To create guardrails, we work with oncologists to define three ordinal risk axes: Medical Urgency, Psychological Urgency, and Topic Sensitivity. We propose Clinical Guardrail Probes (CG-Probes) to measure the risks from query embeddings. We probe for each axis in the normalized embedding space of frozen embedders via the difference-in-means method, treating each axis as a potential linear direction. To train the probes, we cluster 79,658 Czech oncology search queries with BERTopic and use these clusters to generate pairs of queries with contrastive risk levels via few-shot prompting. We evaluate the approach on 200 queries (90 real, 110 synthetic), each graded by two oncologists, against two open-weight LLMs and a frontier LLM. We find that urgency-based axes are recoverable as linear directions, and the probes are competitive with open-weight LLMs (no significant differences in quadratic-weighted kappa) at a fraction of the latency. Each axis yields a scalar score that clinicians can inspect and use to set escalation thresholds. The pipeline requires only search logs, axis definitions, and black-box access to the embedding model, suggesting transferability across healthcare domains. Robust validation on new queries and axes remains future work.
Figures & tables
| Medical Urgency (MU) – time to clinical action | |
|---|---|
| 0 | benign, no urgent somatic issue reported – “I have a cough.” |
| 1 | physician contact required, emergency not excludable – “Diarrhea six times a day, two days after chemotherapy.” |
| 2 | somatic emergency, activate EMS – “My face is swollen can’t breathe.” |
| Psychological Urgency (PU) – expressed distress suicidality | |
| 0 | no expressed distress – “What are the side effects of radiotherapy?” |
| 1 | distress or existential doubt, no suicidal intent – “I cry every day since the diagnosis and can’t cope.” |
| embedder | instruction | MU | PU | TS |
|---|---|---|---|---|
| Qwen3-8B (4096d) | none | 0.34 | 0.67 | 0.38 |
| generic | 0.34 | 0.81 | 0.30 | |
| per-axis | 0.61 | 0.67 | 0.37 | |
| per-axis + | 0.60 | 0.58 | 0.35 | |
| Harrier-27B (5376d) | none | 0.30 | 0.62 | 0.36 |
| generic | 0.51 | 0.09 | 0.27 |
LLM Guardrails
Large language model guardrails detect or constrain harmful outputs, prompt attacks, and unsafe agent actions before they cause harm.
See all 194 papers