EUVIMEDObjevte EUVIMED
Open access · CC BY 4.0

Do Open-Weight LLMs Respect Minimum-Necessary Access in Text-to-SQL? An Automated Audit on EHR Benchmarks

Alberto Ballesteros-Rodríguez, Lino González-García, Miguel-Angel Sicilia, Elena García-Barriocanal

Electronics · 2026-07-23 · 15 (15) · 3252

DOI: 10.3390/electronics15153252 ↗

At a glance

Journal article in Electronics, published online on 2026-07-23. Written by Alberto Ballesteros-Rodríguez and 3 co-authors. Cited 1 times so far (Crossref); 26 references. The full text is freely available (open access, CC BY 4.0).

AbstraktBibliografické údajeCiteRelated studies

Abstract (original language)

Large language models are increasingly deployed as natural-language interfaces to clinical databases, yet their evaluation has focused almost exclusively on query correctness rather than access minimality. Data-protection frameworks such as HIPAA §164.502(b) and the GDPR data-minimisation principle require that personal data be accessed only to the extent necessary for the immediate purpose. This paper presents the first empirical audit of open-weight LLMs on this access-scope dimension, using the EHRSQL 2024 benchmark over MIMIC-IV. We measure deviations from minimum-necessary access via three static metrics computable without executing queries: Sensitive Column Exposure (SCE), Table Over-Join Rate (TOJ), and Aggregate Identifier Exposure (AIE). Unlike prior work on adversarial attacks, we study default model behaviour under ordinary, benign queries—the over-reach we document requires no attacker and is present from the first interaction. Among twelve open-weight models, a non-trivial fraction fail a basic SQL-generation viability threshold; among nine viable models, SQL-specialised training paradoxically increases over-reach while domain-adapted medical variants achieve the lowest exposure. Schema redaction largely eliminates column-level exposure but increases table-level over-reach for most models. Random in-context demonstrations produce statistically significant over-reach regressions in specific models; BM25-based retrieval resolves most of these failures, though a residual aggregate-identifier exposure risk persists for one model family.

Cite

APA

Ballesteros-Rodríguez, A., González-García, L., Sicilia, M., & García-Barriocanal, E. (2026). Do Open-Weight LLMs Respect Minimum-Necessary Access in Text-to-SQL? An Automated Audit on EHR Benchmarks. Electronics, 15(15), 3252. https://doi.org/10.3390/electronics15153252

Vancouver

Ballesteros-Rodríguez A, González-García L, Sicilia M, García-Barriocanal E. Do Open-Weight LLMs Respect Minimum-Necessary Access in Text-to-SQL? An Automated Audit on EHR Benchmarks. Electronics. 2026;15(15):3252. doi:10.3390/electronics15153252

BibTeX
@article{BallesterosRodrguez2026,
  author = {Ballesteros-Rodríguez, Alberto and González-García, Lino and Sicilia, Miguel-Angel and García-Barriocanal, Elena},
  title = {Do Open-Weight LLMs Respect Minimum-Necessary Access in Text-to-SQL? An Automated Audit on EHR Benchmarks},
  journal = {Electronics},
  year = {2026},
  volume = {15},
  number = {15},
  pages = {3252},
  doi = {10.3390/electronics15153252}
}
Start for free →