A practical catalogue of controls for the safe release of trained AI/ML models from a TRE — drawn from the GRAIMATTER Green Paper's technical, legal and governance recommendations, organised by what each control actually does.
The GRAIMATTER Green Paper sets out 17 technical, 11 legal/ethics and several process recommendations for releasing trained ML models from a TRE without disclosing personal data. Rather than reading the report phase-by-phase, this page groups every control by what it actually does — so you can find the right mitigation for a specific risk quickly.
Controls are tagged by category: MDC reduces the risk that personal data is encoded in the model itself, MQC restricts access to the model after release, Legal covers contracts and licences, and Process covers governance and organisational steps. Most real projects combine controls from more than one category.
GRAIMATTER groups all mitigation into two families. Both are legitimate; the right choice depends on the project, the Data Controller's risk appetite, and how the model needs to be used.
The model itself is checked and, where necessary, modified until the TRE is confident it is anonymous — then it can be released openly.
The model may still contain personal data, but access is restricted (e.g. a secure web service) so end-users only ever see anonymous results.
Controls applied while the model is being trained, to reduce how much it can memorise about individual records.
Use a DP variant of the training algorithm where one exists (e.g. DP-SGD, DP-SVM). This gives a mathematical bound on how much any single record could have influenced the released model.
De-identify the training data first — e.g. by achieving k-anonymity through aggregating individuals or binning disclosive features — so no single row can be encoded in the model.
Generate synthetic data with a provably differentially private mechanism, then train the model on that instead of the real records. An instance-based model trained this way only ever "contains" synthetic points.
Regularisation, dropout, and data augmentation all reduce a model's tendency to memorise individual training records — closely linked to vulnerability to membership inference.
Tooling that catches risky choices automatically, before a researcher ever requests release.
Drop-in replacements for standard ML library classes (scikit-learn, TensorFlow) that
enforce safe hyperparameter ranges, snapshot the model to detect tampering between training and release,
and auto-generate a risk report when the researcher calls request_release().
Hold every "unsafe" hyperparameter combination in one human- and machine-readable file
(e.g. rules.json), with write access limited to TRE administrators, rather than relying on
researcher training materials that can go stale.
The checklist TRE staff run against a specific trained model before it's approved for egress.
Researchers describe a model's inputs, pre-processing, data splits and outputs in a standard format, so TRE staff can run automated inference-attack checks without reverse-engineering the pipeline.
Keep a slice of the data back from researchers entirely, so TRE staff have genuinely unseen data to run attack simulations against.
Compare the model's performance as reported by the researcher against its performance on the TRE's held-out data. A large gap suggests overfitting — and overfitting is a strong predictor of disclosure risk.
A trained model's file size should be orders of magnitude smaller than the training
data. A similarly-sized file is a strong signal the training data has been embedded — some libraries do
this by default for reproducibility (e.g. R's glm()).
TRE staff inspect the training code for accidental poor practice — such as storing raw data inside the model — and confirm the code matches what the researcher's report describes.
Only release models in open, inspectable formats (e.g. ONNX, or standard scikit-learn/TensorFlow/Keras exports). Reject proprietary "run-only" formats that can't be examined.
Run membership-inference and attribute-inference attacks against the model using the training data plus the held-out set, following the GRAIMATTER worst-case methodology (see Appendix G).
Don't rely solely on aggregate metrics like accuracy or AUC. Also check metrics that target the extremes of the model's confidence (e.g. true positive rate at a fixed, low false positive rate) — a model can look safe on average while still leaking a handful of records with very high confidence.
Some model architectures need handling that goes beyond the standard checklist.
Standard KNN, SVM, Gaussian Process and similar models directly embed training rows and are essentially never safe to release in their default form.
Check both the overall ensemble and every base model inside it — a safe ensemble can hide unsafe base models, and vice versa, so neither can be assumed safe from the other.
Test each site's local model for disclosure risk before it's aggregated — the central site never has access to any single site's raw data, so it can't test the final aggregated model directly. Release only once every site's local attack simulations pass.
A released synthetic data generator encodes a full joint distribution over the data, not just a conditional prediction — so its potential to leak information is higher, not lower, than an equivalent predictive model's, and it deserves the same scrutiny.
Rather than checking the model itself, these controls restrict what an end-user can do with it once it leaves the TRE.
Host the model behind an API that returns only predictions, never the model itself. Can restrict by IP address, log every query for anomaly detection, and cap the number of queries within a time period. Can be run by the TRE, a trusted third party, or the researcher's organisation.
Embed the model inside software — e.g. a medical device — that enforces who can query it and how often.
Have an external party test that query-limiting controls can't be circumvented — the same way TREs are already regularly penetration-tested for other purposes.
Controls that assign responsibility and constrain permitted use, on paper as well as technically.
Add explicit terms to the end-user licence: no attacking the model to extract personal data, no use outside the "permitted purpose", no transfer learning. These should apply whether the model is embedded in software, hosted as a web service, or shared as open source.
Where a model may contain pseudonymised personal data, put contractual agreements in place between the Data Controller, TRE and researcher covering responsibilities — especially if MQCs will be operated by a third party after release.
Researchers commit to: abiding by approved controls, recording the project on the data use register, notifying the TRE of downstream changes (e.g. commercialisation), and — where MDCs apply — supplying the data-to-variable transformation needed for attack simulation.
Record that a release is a trained model (not just a statistical output) — what it was trained to do, what controls were applied, and any regulatory approvals — making ML releases as auditable and publicly visible as any other TRE output.
Where researchers are reluctant to share training details for fear of exposing trade secrets, the TRE can offer a confidentiality agreement covering exactly what's needed to run attack simulations.
Where a model isn't shared openly, cap how long it can be used before the researcher must seek fresh approval — useful where the risk profile of a use case might change over time.
Controls that shape how a project is planned, staffed and documented — often cheaper than technical fixes if put in place early.
Agree at proposal stage which attributes count as personal, whether group disclosure is a concern (e.g. attributes linked to social factors such as sexuality or religion), and what the checking process will look like — before any training happens.
Scale the intensity of controls to genuine risk rather than applying the same checks to every project — see the risk-based approval matrix below for GRAIMATTER's worked example.
Store the exact code, data version and pipeline used to produce the approved model, so it can be reproduced if questions arise later — sometimes a regulatory requirement (e.g. 15 years for a certified medical device).
Researchers, TRE staff, and Data Governance/Ethics Committee members each need a different depth of training — from introductory awareness to hands-on attack-simulation skills.
GRAIMATTER's worked example of how release method and attack-simulation outcome combine to determine overall risk — useful as a starting template for a TRE's own risk appetite.
| Model openly available, shared openly | Model embedded in software with legal controls around hacking | Model embedded in software with legal controls + query limits | Model only accessible via a secure web-server with query & user limits | |
|---|---|---|---|---|
| Passes attack simulations & TRE checks | Caution | Safe | Safe | Safe |
| Passes attack simulations & TRE checks + Safe Wrappers used | Caution | Safe | Safe | Safe |
| Fails attack simulations / TRE checks | Unsafe | Unsafe | Unsafe | Safe |
| Differentially private instance-based model | Safe | Safe | Safe | Safe |
| Standard instance-based model (e.g. SVM) | Unsafe | Unsafe | Unsafe | Safe |
This page summarises practical controls from the GRAIMATTER Green Paper. Consult the original report for full experimental detail, worked examples and legal draft clauses.
Jefferson E, Reel S, et al. DARE UK Green Paper: Recommendations for disclosure control of trained Machine Learning (ML) models from Trusted Research Environments (TREs). GRAIMATTER, Zenodo, 2022.
Tooling referenced
GRAIMATTER was funded by UK Research & Innovation as part of Phase 1 of the DARE UK programme, delivered in partnership with HDR UK and ADR UK.