INSS 'AI Doctor' — ML-Based Sick Leave Fraud Detection (Modelo de Priorización de Citas)
Overview
The Instituto Nacional de la Seguridad Social (INSS) — Spain's national social security institute — deploys two XGBoost (gradient-boosted decision tree) machine learning algorithms to assess sick leave (incapacidad temporal) cases on a daily basis. The system generates a numerical score between 0 and 1 for each worker currently on sick leave, estimating the likelihood that the worker is ready to return to work. These scores are used to prioritise which cases medical inspectors should review first, effectively creating a 'digital waiting list' that controls the order of medical inspection appointments.
The scoring system operates on a four-tier scale: 0.00–0.30 indicates slow recovery expected (maintain leave), 0.31–0.60 indicates favourable progress (standard review scheduling), 0.61–0.80 indicates notable improvement (priority appointment), and 0.81–1.00 indicates imminent clearance (possible end of leave). The model draws on a range of input variables including gender, age, place of residence (which carries three times the statistical weight of specific medical diagnosis), medical diagnoses, duration of current leave, patient medical history, prior leave history, case type, medical reports from public health services, reports from mutual insurance companies (mutuas), and inspector assessments recorded in the Atrium internal application.
The system was built by SAS (a US-based analytics software company) and implemented by ViewNext (a Spanish subsidiary of IBM), at a cost of at least EUR 1 million based on procurement tender documents. It was deployed in 2018 and integrated into inspector workflows from 2018. The current model version has been operational unchanged since November 2020.
Critically, the system operated in secret for approximately five years (2018–2023), with no public disclosure of its existence or functioning. It was exposed in April 2023 through an investigation by Lighthouse Reports and El Confidencial, part of the cross-border 'Suspicion Machines' investigative series that also examined algorithmic welfare systems in the Netherlands (SyRI), Serbia, and other countries. Following exposure, the Spanish Ministry of Inclusion denied transparency requests from journalists, citing that disclosure would 'compromise essential public interests' and affect system 'efficacy'.
Internal performance evaluations have revealed significant quality concerns. The system has a documented internal validation error rate of 15.4%, meaning it fails in approximately one out of every six cases. In the first half of 2025, only 35.48% of algorithmically-selected workers received medical discharge, compared to 41.48% for cases selected manually by inspectors — meaning human judgment consistently outperforms the algorithm. Senior INSS officials have conceded the algorithms are 'not accurate', and expert Ana Valdivia of the Oxford Internet Institute described the false positive performance as 'poor' and 'unbalanced'. Medical inspectors working with the system daily have stated they 'are not able to explain what it is'. The system has been described as 'rendered effectively useless' due to chronic underfunding and inspector staff shortages across the INSS inspection corps.
The incapacidad temporal programme processed by this system represents a major fiscal commitment: 2024 national spending was EUR 16.5 billion (approximately 1.8% of GDP), with spending having increased 60% since 2017. An average of 1.6 million workers are on sick leave on any given day across Spain. The system would be classified as high-risk under the EU AI Act (Annex III — systems determining access to public benefits), requiring conformity assessments, transparency obligations, and human oversight provisions. Compliance with these forthcoming requirements has not been verified.
Classification
AI Capabilities
Use Cases
Social Protection Functions
| SP Pillar (Primary) | Social insurance |
Programme Details
| Programme Name | Incapacidad Temporal (Temporary Disability / Sick Leave Benefits) |
| Programme Type | Health Insurance |
| System Level | Implementation/delivery chain |
Workers receive 60% of salary for days 4-20 of sick leave, 75% from day 21 onward. Maximum duration 365 days, extendable by 180 days. 2024 national spending was EUR 16.5 billion (~1.8% of GDP). Average 1.6 million workers on sick leave on any given day.
Implementation Details
| Implementation Type | Classical ML |
| Lifecycle Stage | Monitoring, Maintenance and Decommissioning |
| Model Provenance | Commercial/proprietary |
| Compute Environment | Not documented |
| Sovereignty Quadrant | Not assessed |
| Data Residency | Domestic |
| Cross-Border Transfer | Not documented |
Risk & Oversight
| Decision Criticality | High |
| Human Oversight | HOTL |
| Development Process | Fully third-party developed |
| Highest Risk Category | Governance and institutional oversight risks |
| Risk Assessment Status | Not assessed |
Documented Risk Events
Internal validation error rate of 15.4% (fails in ~1 of 6 cases). Algorithm-selected cases have LOWER discharge rate (35.48%) than manually-selected cases (41.48%), meaning human judgment outperforms the algorithm. Place of residence weighted THREE TIMES HIGHER than specific medical diagnosis. System operated in secret for 5 years. INSS refused transparency requests citing 'essential public interests'. Medical inspectors report they 'cannot explain what it is'. Senior INSS officials conceded the algorithms are 'not accurate'. Expert Ana Valdivia (Oxford Internet Institute) described false positive performance as 'poor' and 'unbalanced'.
Risk Dimensions
Data-related risks
Governance and institutional oversight risks
Market, sovereignty and industry structure risks
Model-related risks
Operational and system integration risks
Impact Dimensions
Accountability, transparency and redress
Autonomy, human dignity and due process
Equality, non-discrimination, fairness and inclusion
Systemic and societal
Safeguards
Deployment & Outcomes
| Deployment Status | Full Production Deployment |
| Year Initiated | 2018 |
| Scale / Coverage | ~1.6 million workers on sick leave nationally; processes cases daily across all INSS inspection offices |
| Funding Source | Spanish Social Security budget (at least EUR 1 million in SAS tender) |
| Technical Partners | SAS (fraud detection software platform); ViewNext (IBM subsidiary, implementation) |
Outcomes / Results
Few of the originally promised gains have materialised after 5+ years. System described as 'rendered effectively useless' due to chronic underfunding and inspector staff shortages. Algorithm-selected cases perform worse than manually-selected cases (35.48% vs 41.48% discharge rate).
Challenges
Chronic INSS inspector staff shortages and budget cuts undermine the system's utility regardless of algorithm quality. 60% increase in sick leave spending since 2017 creates political pressure to use algorithmic tools even when they underperform. EU AI Act will classify this as high-risk (Annex III) requiring conformity assessment, transparency, and human oversight — compliance is unverified.
Sources
- SRC-005-ESP-001 Nieto Garrote, A. (2025) 'Sistemas de IA en las Entidades Gestoras de la Seguridad Social', Revista de Derecho de la Seguridad Social, Laborum.
https://revista.laborum.es/index.php/revsegsoc/article/view/1215 - SRC-008-ESP-001 Andalucía Informa / elDiario.es (2026) 'Tu baja laboral la decide ahora un algoritmo con inteligencia artificial: el sistema del INSS está en el punto de mira'.
https://andaluciainforma.eldiario.es/tramites/tu-baja-laboral-la-decide-ahora-un-algoritmo-con-inteligencia-artificial-el-sistema-del-inss-esta-en-el-punto-de-mira/ - SRC-007-ESP-001 Andalucía Informa / elDiario.es (2026) 'Así es la lista de espera digital del INSS: el algoritmo secreto que decide tu alta tras una baja laboral'.
https://andaluciainforma.eldiario.es/asi-es-lista-de-espera-digital-del-inss-el-algoritmo-secreto-que-decide-tu-alta-tras-una-baja-laboral/ - SRC-004-ESP-001 Fidelitis (2025) 'El algoritmo del INSS que decide tu baja médica'.
https://www.fidelitis.es/ia-bajas-medicas-inss-guarda-silencio/ - SRC-006-ESP-001 González, J.A. (2026) 'La Seguridad Social tira de la IA para cazar bajas laborales dudosas: un 35% de éxito', Diario de León, 23 February 2026.
https://www.diariodeleon.es/economia/260223/2076512/seguridad-social-tira-ia-cazar-bajas-laborales-dudosas-35-exito.html - SRC-001-ESP-001 Lighthouse Reports (2023) 'Spain's AI Doctor', Suspicion Machines series, April 2023.
https://www.lighthousereports.com/investigation/spains-ai-doctor/ - SRC-003-ESP-001 Observatorio de Bioética y Derecho, Universitat de Barcelona (2023) 'La Seguridad Social usa una IA secreta para rastrear bajas laborales y cazar fraudes'.
https://www.bioeticayderecho.ub.edu/es/la-seguridad-social-usa-una-ia-secreta-para-rastrear-bajas-laborales-y-cazar-fraudes - SRC-002-ESP-001 The Olive Press (2023) 'How Spain's Social Security system is using artificial intelligence to identify fraudulent sick leave', 17 April 2023.
https://www.theolivepress.es/spain-news/2023/04/17/how-spains-social-security-system-is-using-artificial-intelligence-to-identify-fraudulent-sick-leave/
How to Cite
DCI AI Hub (2026). 'INSS 'AI Doctor' — ML-Based Sick Leave Fraud Detection (Modelo de Priorización de Citas)', AI Hub AI Tracker, case ESP-001. Digital Convergence Initiative. Available at: https://socialprotectionai.org/use-case/ESP-001