Automatic text anonymization is a crucial step in ensuring compliance with privacy regulations, particularly when sharing sensitive clinical data between institutions and feeding the models that underpin clinical decision support systems. However, anonymization requirements can vary significantly across use cases, institutions, or regulatory contexts, highlighting the need for customizable and context-aware privacy policies. This paper presents an intelligent framework, namely GAIMP, for text sanitization in multiple domains using Large Language Models (LLMs) and AI Agents. GAIMP relies on two methodologies, a single- and multiple-agent approach, which were evaluated through preliminary experiments on heterogeneous medical prescriptions validated by domain experts to assess its effectiveness in masking sensitive information while preserving the text's utility. Results show that agent-based configurations outperform the baseline, yielding 94% for the single-agent and 95% for the combination of single-agent and LLM base F1 scores, albeit at the expense of longer execution times. These configurations allow smaller LLMs to be used in conjunction with intelligent agents, achieving a trade-off between accuracy and computational cost that outperforms larger models. This makes the proposed approach particularly suitable for deployment in resource-constrained environments and highlights its potential for domain-specific, ontology-driven anonymization tasks.
GAIMP: Clinical Text Sanitization via Agent-Based Generative Anonymization
Cirillo, Stefano;Polese, Giuseppe;Solimando, Giandomenico
2026
Abstract
Automatic text anonymization is a crucial step in ensuring compliance with privacy regulations, particularly when sharing sensitive clinical data between institutions and feeding the models that underpin clinical decision support systems. However, anonymization requirements can vary significantly across use cases, institutions, or regulatory contexts, highlighting the need for customizable and context-aware privacy policies. This paper presents an intelligent framework, namely GAIMP, for text sanitization in multiple domains using Large Language Models (LLMs) and AI Agents. GAIMP relies on two methodologies, a single- and multiple-agent approach, which were evaluated through preliminary experiments on heterogeneous medical prescriptions validated by domain experts to assess its effectiveness in masking sensitive information while preserving the text's utility. Results show that agent-based configurations outperform the baseline, yielding 94% for the single-agent and 95% for the combination of single-agent and LLM base F1 scores, albeit at the expense of longer execution times. These configurations allow smaller LLMs to be used in conjunction with intelligent agents, achieving a trade-off between accuracy and computational cost that outperforms larger models. This makes the proposed approach particularly suitable for deployment in resource-constrained environments and highlights its potential for domain-specific, ontology-driven anonymization tasks.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


