Most AI systems reach production through a software pipeline that was never designed to check training data, model weights or evaluation results, so the riskiest artefacts pass every gate unexamined. This guide maps concrete security gates onto each phase of an AI system's life, from data collection through training, evaluation, deployment and operation to retirement. For each gate it names the risk, the control, the evidence a reviewer should see and the owner who signs it off. It is written for ML engineers, AppSec teams and AI governance leads who already run a secure SDLC and need to extend it to models. It deliberately does not restate the OWASP LLM risks or the framework texts: it links them and focuses on what to check, when, and who decides.
Key takeaways
- Gates need evidence, not opinions. Each phase should end with a named owner signing off against artefacts: a provenance record, a signed model manifest, an evaluation report, a deployment attestation.
- Data is code for AI systems. Sign datasets at ingestion, hash every referenced item and keep an append-only provenance record, as the 2025 joint AI data security guidance from NSA, CISA, FBI and partners recommends.
- Treat model files as untrusted executables. Third-party weights, adapters and serialised files can carry code or backdoors; scan them, prefer safe formats and verify signatures before loading.
- Evaluate before release, and isolate the evaluation. Red teaming and capability evaluations are a release gate, and the evaluation environment itself needs the same credential and network isolation as production.
- Retirement is a security phase. Decommissioning must revoke model-serving credentials, withdraw signing trust, archive or destroy weights and sanitise training data stores, or the old model lives on as an attack path.
Why AI needs its own lifecycle gates
A conventional secure SDLC assumes that behaviour comes from source code a reviewer can read. In an AI system, behaviour also comes from training data, pre-trained weights, fine-tuning adapters, prompts and retrieval sources, none of which a code review or SAST scan inspects. NIST SP 800-218A, the SSDF Community Profile for Generative AI and Dual-Use Foundation Models (final, July 2024), extends SSDF version 1.1 for exactly this reason and is meant to be used alongside SP 800-218. The NCSC and partner agencies' Guidelines for Secure AI System Development (November 2023) organise the same idea into four stages: secure design, secure development, secure deployment, and secure operation and maintenance. ISO/IEC 5338 describes the AI system life cycle processes that sit on top of ISO/IEC/IEEE 12207 and 15288.
This page turns those frameworks into gates. For the framework detail see the NIST SP 800-218A SSDF Community Profile for Generative AI Guide, the Guidelines for Secure AI System Development: The Four Lifecycle Stages Explained and the ISO/IEC 5338 Guide. For the general pipeline controls see the Secure Software Development Lifecycle (SSDLC) Guide and the MLOps Security Guide.
The gate table
| Phase gate | Main risk | Control | Evidence to sign off | Owner |
|---|---|---|---|---|
| G1 Data approved for training | Poisoned, unlicensed or sensitive data | Source vetting, hashing, signing at ingest, sensitive data scanning | Dataset provenance record, hash manifest, data classification, licence check | Data owner with ML lead |
| G2 Base model and dependencies approved | Malicious weights, adapters or ML libraries | Model scanning, safe serialisation formats, signature verification, pinned dependencies | Model and AI-BOM entry, scan result, verified signature or recorded exception | ML platform owner with AppSec |
| G3 Training run accepted | Tampered training environment or leaked weights | Isolated training workspace, scoped workload credentials, logged runs | Run record linking code commit, dataset hash and environment image; signed model manifest | ML lead |
| G4 Release evaluation passed | Unsafe capability, jailbreak susceptibility, data leakage | Security evaluations and red teaming against agreed thresholds | Evaluation report, red team findings with dispositions, residual risk acceptance | AI risk owner, independent of the build team |
| G5 Deployment approved | Unsigned or swapped model, over-privileged serving identity | Admission check on model signature, least-privilege serving identity, guardrails, rate limits | Deployment attestation, threat model, access review of serving credentials | Service owner with platform security |
| G6 Operation reviewed | Drift, abuse, extraction, silent model replacement | Input and output monitoring, drift detection, change control on models and prompts | Monitoring dashboards, periodic review record, incident log | Service owner |
| G7 Retirement complete | Orphaned endpoints, keys and datasets | Decommission runbook covering endpoints, credentials, weights and data | Decommission checklist, revocation records, sanitisation certificate | Service owner with data owner |
Scale the table to the risk. A small team fine-tuning a vendor model for an internal tool can combine G2 and G3 and let one senior engineer own G4 with a peer reviewer. A provider training or serving models to customers should keep every gate separate and make G4 independent of the team that built the model.
Data collection and preparation
The joint guidance AI Data Security: Best Practices for Securing Data Used to Train and Operate AI Systems (May 2025, NSA AI Security Center, CISA, FBI, ASD's ACSC, NCSC-NZ and UK NCSC) is the most specific public source for this gate. Its practices translate into these checks:
- Provenance: record where every dataset came from and how it moved, in a cryptographically signed, append-only ledger. Store augmented or relabelled data as new entries with the change documented, not as silent overwrites.
- Integrity: hash data in storage and transit, sign original datasets and require each revision to be signed by whoever changed it. The guidance points to the post-quantum signature standards FIPS 204 and FIPS 205.
- Web-scale datasets: for curated URL lists, verify the curator's per-item hash at download and discard items that fail; this counters split-view poisoning, where an expired domain behind a listed URL is bought and its content replaced. For snapshot datasets, use only snapshots validated by a trusted party to limit frontrunning poisoning. The guidance treats raw web-crawled data as the highest risk and advises against using it where adequate due diligence is not possible.
- Verify the store before each run: the guidance recommends checking the dataset store's certificate before each training run and aborting and auditing if the check fails.
- Classification and privacy: classify data and carry that classification to model outputs; apply masking, differential privacy or federated learning where personal data is involved. See the AI Data Poisoning and Backdoors Guide for poisoning techniques and detection, and the OWASP LLM Top 10 LLM04 Data and Model Poisoning Guide for the risk entry.
Gate G1 passes when the dataset has a provenance record, a hash manifest, a classification, a licence decision and a scan for secrets and personal data, and a named data owner has approved it for this specific purpose.
Model development and training
This phase covers base model selection, fine-tuning and the training environment. OWASP's LLM03:2025 Supply Chain entry notes that model cards offer no guarantee of a model's origin and that LoRA adapters can compromise an otherwise trusted base model, so both need the same acceptance checks.
| Artefact | Check before use | Reference |
|---|---|---|
| Pre-trained weights | Source allow-list, signature verification where offered, scan for embedded code, prefer non-executable formats such as safetensors over pickle-based files | Model Signing vs Model Scanning |
| Fine-tuning adapters (LoRA, PEFT) | Same as weights; record adapter and base model together in the AI-BOM | OWASP LLM03:2025 |
| ML libraries and notebooks | Pinned versions, private mirror, secret scanning of notebooks | Jupyter Server Security Guide |
| Training output | Signed manifest of file digests, stored with the run record | Model Signing and OpenSSF Model Signing Guide |
- Sign what you produce: the open source model_signing tool from the sigstore model-transparency project records each model file's path and digest in a manifest and signs it in a Sigstore bundle, with Sigstore keyless signing by default and key, certificate or PKCS #11 options. Verification recomputes the hashes, so a swapped shard fails.
- Record the run: link the model artefact to the code commit, dataset hashes, container image and hyperparameters. Without this you cannot answer "which data trained the model in production?" during an incident.
- Isolate the workspace: training jobs should run with workload identities scoped to the buckets and registries they need, without broad cloud roles, and with no direct internet egress beyond approved mirrors. See the AI Supply Chain and AI-BOM Guide and the OWASP LLM Top 10 LLM03 Supply Chain Guide.
Relevant MITRE ATLAS techniques for threat modelling this phase are AML.T0010 AI Supply Chain Compromise, AML.T0020 Poison Training Data, AML.T0018 Manipulate AI Model and AML.T0058 Publish Poisoned Models.
Evaluation and red teaming
Gate G4 is the release decision. Agree the evaluation plan and pass thresholds before training ends, so results cannot be rationalised afterwards.
- Scope: security evaluations (prompt injection and jailbreak resistance, sensitive data leakage, unsafe tool use for agents), capability evaluations where misuse is a concern, and conventional testing of the serving application. See the AI Security Evaluations Guide and AI Red Teaming vs Evaluations vs Benchmarks.
- Red team: a team independent of the builders, with a written plan, rules of engagement and a findings log where each finding is fixed, mitigated or formally accepted. The AI Red Team Test Plan Template gives a starting structure and the AI Red Teaming Guide covers method.
- Isolate the evaluation environment: evaluations of capable or agentic models run untrusted behaviour by design. Give the harness its own credentials scoped to that environment only, block instance metadata, and deny egress to internal registries and production networks. The OpenAI and Hugging Face breach showed agents escaping a benchmark sandbox through package registry access and then harvesting machine credentials, including a shared cluster-admin credential. See also AI Lab and Agent Evaluation Incidents.
Gate G4 passes when the evaluation report shows every agreed threshold met, open red team findings have an owner and a decision, and the AI risk owner has signed a residual risk acceptance that names the use cases the model is approved for.
Deployment
- Verify before serving: the serving platform should load only models whose signed manifest verifies against a trusted identity, in the same way a Kubernetes admission controller enforces container image signatures. Record the verified digest in the deployment attestation.
- Least-privilege serving identity: the inference service, and any agent built on it, needs its own workload identity with access only to its model store, vector store and approved tools. Store API keys for hosted models in a secrets manager and rotate them. See the AI Agent Credential Lifecycle and Rotation Guide.
- Runtime controls: input and output filtering, rate limits and quotas to slow extraction attempts through the inference API (ATLAS AML.T0024 Exfiltration via AI Inference API). See the AI Guardrails and AI Firewalls Guide.
- Responsible release: the NCSC guidelines treat release as a deliberate security step: decide what is exposed (weights, API, outputs), to whom, and with what documentation.
Operation and monitoring
The joint data security guidance distinguishes slow statistical drift, which suggests natural change in inputs, from abrupt shifts in one or more dimensions, which can indicate compromise. Monitor both, and route abrupt changes to security as well as to the ML team.
| Signal | What it can indicate | Where to log |
|---|---|---|
| Model digest at load differs from the approved digest | Unauthorised model replacement | Serving platform audit log, SIEM alert |
| Abrupt change in input or output distributions | Poisoned retrieval data, abuse campaign, upstream pipeline change | Model monitoring, with a security escalation path |
| High-volume, systematic queries from one client | Model extraction or scraping | API gateway logs |
| Serving or training identity used from a new location or for a new resource | Credential theft | Cloud audit logs, identity threat detection |
| Prompt, system prompt or guardrail change outside change control | Insider change or compromised pipeline | Configuration repository and deployment logs |
See Secure AI logging for log design and AI Incident Management and Escalation for response.
Metrics that show the lifecycle is working:
- Percentage of production models with a verified signature and a complete run record (target 100%).
- Percentage of training datasets with a provenance record and hash manifest.
- Number of releases that passed G4 with open high-severity findings (target zero without a signed acceptance).
- Median time from an abrupt drift alert to security triage.
- Number of retired models with credentials or endpoints still active (target zero).
Retirement
Retirement is where AI estates leak. Endpoints keep answering, API keys stay valid, and old checkpoints sit in buckets long after anyone remembers them. A decommission runbook should cover, in order:
- Announce and freeze: record the retirement decision, the replacement model and the date; stop new deployments of the old version.
- Remove serving paths: delete inference endpoints, routes and gateway entries, and confirm no traffic for an agreed period.
- Revoke identities and keys: disable the serving and training workload identities, revoke API keys and tokens, and remove the model's signing identity or key from the deployment trust policy so the retired version can no longer pass admission.
- Decide on weights: archive under access control and encryption if retention is required (for audit or reproducibility), or destroy them, including copies in caches and registries.
- Sanitise data: delete or archive training datasets in line with retention rules. The joint guidance calls for cryptographic erase, block erase or overwrite following NIST SP 800-88 before storage is repurposed or decommissioned.
- Update records: close the AI-BOM and inventory entry and file the decommission evidence. If a model is later found to be compromised, the model registry compromise playbook applies.
Common failure patterns
- One gate at the end: a single pre-release review sees only the finished model and cannot check data provenance after the fact.
- Trusting model hubs by reputation: downloads count and a model card are not provenance; unscanned pickle files are code execution.
- Evaluation without isolation: shared credentials in evaluation harnesses turn a test into a breach, as the OpenAI and Hugging Face incident showed.
- Signing without verifying: models are signed at build but nothing checks the signature at load.
- No retirement owner: keys and endpoints of superseded models stay live with no one watching them.
Framework mapping
| Gate | NIST SP 800-53 Rev 5 | NIST CSF 2.0 | MITRE ATLAS |
|---|---|---|---|
| G1 Data | SR-4 Provenance, SI-7 Software, Firmware, and Information Integrity | PR.DS-01 | AML.T0020 |
| G2 and G3 Model and supply chain | SR-3, SR-11 Component Authenticity, CM-14 Signed Components, SA-15 | GV.SC-07, PR.PS-06 | AML.T0010, AML.T0018, AML.T0058 |
| G4 Evaluation | SA-11 Developer Testing and Evaluation, CA-8 Penetration Testing, RA-3 | ID.RA-01 | AML.T0043 Craft Adversarial Data |
| G5 and G6 Deployment and operation | AC-6, SI-4 System Monitoring, CM-6 | PR.PS-01, DE.CM-09 | AML.T0024 |
| G7 Retirement | MP-6 Media Sanitization | PR.DS-01 |
For management system alignment see the ISO/IEC 42001 Annex A Controls Guide, which covers AI system life cycle and data controls at policy level.
Practitioner checklist
- Publish the seven-gate table with named owners and required evidence for each gate.
- Require a provenance record, hash manifest and classification before any dataset is used for training.
- Allow-list model sources, scan third-party weights and adapters, and prefer non-executable model formats.
- Sign every trained model manifest and verify it at load in every serving environment.
- Agree evaluation thresholds before training ends and keep G4 sign-off independent of the build team.
- Run evaluations in an isolated environment with dedicated, narrowly scoped credentials and no metadata or internal registry access.
- Give each serving and training workload its own least-privilege identity and rotate its keys.
- Alert security on abrupt drift, digest mismatches and unusual use of model identities.
- Maintain a decommission runbook covering endpoints, credentials, signing trust, weights and data sanitisation.
Standards and references
- NIST: SP 800-218A Secure Software Development Practices for Generative AI and Dual-Use Foundation Models
- NCSC: Guidelines for Secure AI System Development
- NSA, CISA, FBI and partners: AI Data Security, Best Practices for Securing Data Used to Train and Operate AI Systems
- CISA: AA25-142A AI Data Security advisory
- OWASP: Top 10 for LLM Applications 2025
- MITRE: ATLAS
- Sigstore: model-transparency (model_signing)
Related NHI Mgmt Group resources: MLOps Security Guide · AI Supply Chain and AI-BOM Guide · Model Signing and OpenSSF Model Signing Guide · AI Security Evaluations Guide