Fine-tuning with administrative data: risks and practical controls
What we mean by fine-tuning and why public entities value it
Fine-tuning (or adaptation) means adjusting a pre-trained AI model with your own data to improve its accuracy on local tasks: administrative language, names of procedures, typical citizen queries, case templates, etc. For municipalities and other public bodies it can speed up services (citizen support, case classification, document analysis) and reduce repetitive errors.
However, training or adapting models with administrative data introduces legal, security and operational risks that require specific controls before, during and after the process.
Main risks to consider
- Data protection compliance: including personal data (and even metadata) requires a legal basis, data minimization and, in many cases, a Data Protection Impact Assessment (DPIA) under the GDPR.
- Obligations under the EU AI Act: if the system is classified as high-risk, there are requirements on data quality, documentation, transparency and risk management.
- IT security and ENS: training environments and storage must comply with the ENS (RD 311/2022) to ensure confidentiality, integrity and availability.
- Information leakage and extraction attacks: poorly managed models can memorize sensitive data and expose it via prompts (model inversion).
- Provider dependency and continuity: risk of vendor lock-in, loss of control over versions and model portability.
- Bias and degradation: municipal data may contain local biases that the model could amplify.
Practical controls before starting fine-tuning
-
Data inventory and classification
- Identify and label datasets: personal, sensitive, and non-personal administrative data.
- Avoid including special-category data unless there is a clear legal justification.
-
Legal basis and DPIA
- Define the legal basis (public interest, mission fulfillment, limited consent) and carry out a DPIA specific to the model adaptation if there is a high risk to rights and freedoms.
- Document decisions: record processing activities as required by the GDPR.
-
Less risky alternatives
- Consider using synthetic data, strong anonymization, pseudonymization or augmentation techniques before using real data.
- Consider federated learning or local fine-tuning on municipal infrastructure to avoid moving data.
-
Contractual and procurement requirements
- If you hire a provider, require clauses ensuring GDPR and ENS compliance, model portability, training records and the right to audit. Remember that procurement follows Ley 9/2017.
Best practices during fine-tuning
-
Isolated and controlled environment
- Train in sandboxes with access control, encryption at rest and in transit, and detailed logging.
- Apply ENS controls for identity and key management.
-
Minimization and privacy techniques
- Limit the amount of personal data included.
- Implement techniques such as differential privacy, gradient clipping or noise injection to reduce memorization of individuals.
-
Versioning and logging
- Version datasets and models. Keep metadata: who, when, which hyperparameters and which data subsets were used.
- Produce model cards and data sheets documenting scope, limitations and residual risk.
-
Concurrent technical evaluation
- Validate with independent, unseen test sets.
- Run adversarial and extraction tests (red teaming) to measure data leakage risk.
Post-training controls and operational governance
- Quality and bias testing
- Evaluate accuracy, coverage and bias metrics across relevant subgroups (age, neighborhood, economic activity).
- Production monitoring
- Implement query logging, alerts for unusual behavior and pipelines for controlled retraining.
- Transparency and citizens' rights
- Update privacy notices and AI registries; ensure channels for citizens to exercise their GDPR rights.
- Emergency plan
- Define rollback and mitigation (disable model, revert to prior version) and operational responsibilities.
- Audit and documentation
- Keep evidence of the DPIA, contractual agreements, test results and lifecycle records for the model (the EU AI Act requires technical documentation for risk systems).
Summary checklist (minimum operational)
- Data inventory and classification
- DPIA completed and approved
- Alternatives assessed (synthetic/federated/anonymous)
- Contract with ENS, GDPR, portability and audit clauses
- Isolated, encrypted training environment
- Privacy techniques applied (if applicable)
- Versioning of data and models + model card
- Extraction, bias and adversarial tests
- Deployment plan, monitoring and rollback
- Updated notices and public records
Conclusion and recommended action
Fine-tuning can increase the usefulness of AI in local government, but only if combined with clear technical, legal and organizational controls. Recommended action: before starting any adaptation project, carry out a specific DPIA and run a pilot in an isolated environment following the checklist above. If you need a quick assessment of your AI project's governance and security posture, a diagnostic tool (for example, OptimGov Ready) can help prioritize controls and prepare procurement in line with Ley 9/2017 and ENS RD 311/2022.
Takeaway: Don’t fine-tune without a DPIA and a controlled sandbox — start with anonymized or synthetic data and an 11-step checklist to reduce legal and operational risk.
Related articles
Data transfer agreements between municipalities for AI projects
A practical guide to designing data-sharing agreements between public entities that comply with the GDPR and ENS and enable AI projects.
Red teaming for AI systems in local government
Practical guide to designing and running adversarial tests (red teaming) in municipal AI projects with legal and operational requirements.
AI in Municipal Emergency Management: A Practical Guide for Municipalities
How to apply AI to prevention, response, and recovery for local emergencies, with practical security and compliance requirements.