Scanning in CI is a preventive control. It evaluates the model before release, while the artifact is still easy to block, replace, or remediate. Scanning after deployment is a detective control. It may still find issues, but the model may already have been consumed by downstream systems, which increases response cost and operational exposure.
Why CI scanning and post-deployment scanning are different controls
CI scanning is the better point to catch model issues that would be expensive or risky to ship, because the artifact is still under change control and can usually be blocked, replaced, or fixed before it reaches users. Post-deployment scanning still has value, but it is responding after the model may already have influenced applications, agents, workflows, or downstream decisioning. That shifts the control from prevention to detection and makes containment more important than simple identification.
The practical difference is not just timing. CI scanning helps teams gate release quality, compare results against a known build, and avoid distributing a bad artifact at scale. After deployment, the same finding may require rollback, redeployment, cache invalidation, downstream notification, and verification that no dependent system continued to trust the compromised model. When scanning is treated as a one-time approval step instead of an ongoing control, teams often discover exposure only after other systems have already inherited it.
For model-driven systems, that distinction matters because the model itself can become part of the trust boundary. In practice, many teams discover model risk only after downstream usage has already made the remediation path slower and more disruptive.
How it works in practice
CI scanning sits inside the build and release pipeline, where the model artifact, its metadata, and related dependencies can be checked before promotion. In practice, teams use it to look for issues such as unexpected content, embedded secrets, unsafe model packaging, tampered artifacts, or policy violations that should stop release. The main benefit is that the model is still replaceable without customer impact, so the security team can treat the result as a release decision rather than an incident response input.
That is why CI scanning is usually strongest when it is linked to a hard gate. If the scan fails, the pipeline should prevent promotion until the issue is reviewed and the artifact is corrected. A useful model is:
- scan the exact artifact that will be deployed, not a different training output;
- store the scan result with build metadata so release teams can prove what was checked;
- tie failures to a clear exception or remediation workflow;
- rescan after any material change to weights, prompts, adapters, packaging, or dependency set.
Post-deployment scanning works differently. It is useful for continuous assurance, especially when models can drift, be replaced, or be indirectly updated through pipelines, vendors, or runtime configuration. It can also detect exposure that was not visible at release time. But once the model is in production, a finding is no longer just a security defect, it is an operational event that may require rollback coordination, service-owner notification, and review of every system that consumed the model or cached its outputs. That is why post-deployment scanning is strongest as a monitoring and verification layer, not as the primary release gate. These controls tend to break down when model updates are frequent but release metadata is weak, because teams cannot reliably tell which deployed instance was actually scanned.
Common variations and edge cases
Tighter scanning often increases release friction, so organisations have to balance speed against confidence. The right balance depends on how much blast radius the model has if it is wrong, unsafe, or tampered with.
Some deployments blur the line between CI and production. For example, models may be retrained frequently, pulled from an external registry, or modified by prompt, adapter, or policy updates after the original build. In those cases, a “CI only” control is usually incomplete because the released object is not stable. A continuous scan or integrity check becomes more important when the deployed artifact can change outside the normal build pipeline.
There is also a difference between scanning the model itself and scanning the surrounding release package. A model can pass a content or policy scan while still being unsafe because of inherited dependencies, weak provenance, or a deployment path that allows substitution. Conversely, a post-deployment scan may flag a real issue that the build team could have caught earlier, but by then the response path is usually more expensive. The State of Secrets in AppSec is a useful reminder that delayed remediation is common when security defects are discovered late in the lifecycle.
Where the model is embedded in a regulated workflow, a production scan may also be needed to prove ongoing assurance, not just initial approval. The standard pattern is to use CI scanning to stop bad releases and post-deployment scanning to confirm that the live estate still matches what was approved.
Risk and Threat Considerations
The main risk is release-time blind spots turning into production exposure. If a model is scanned only after deployment, unsafe behavior, tampering, or policy violations can propagate into applications, agents, or downstream systems before anyone has a chance to stop them. That creates avoidable operational and governance risk, especially when the model influences customer-facing or automated decisions.
Failure mechanism: an unscanned or poorly validated model is promoted, consumed by one or more downstream systems, and then later found to contain a defect, malicious change, or policy breach. At that point the problem is no longer confined to the model artifact, because dependent systems may have cached it, embedded it in workflows, or based decisions on its output.
Impact: response costs rise sharply, rollback becomes harder, and the organisation may need to investigate every system that relied on the model. In the worst case, the issue becomes a trust and availability problem rather than a simple build defect, because production consumers may continue to operate on compromised or non-compliant output until the entire chain is corrected.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 address the attack surface, NIST AI RMF, CIS Controls v8 and NIST CSF 2.0 set the technical controls, and ISO/IEC 42001:2023 define the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | A1 — Agentic Access Control | CI and post-deployment scanning govern safe model release and runtime exposure. |
| Recommendation — Gate model promotion and runtime use on scan results tied to the deployed artifact. | ||
| NIST AI RMF | GOVERN — Govern | Compares preventive and detective controls across the AI lifecycle. |
| Recommendation — Establish lifecycle governance that separates pre-release approval from post-release monitoring. | ||
| ISO/IEC 42001:2023 | 8.1 — Operational planning and control | Scanning timing affects controlled AI deployment and ongoing operation. |
| Recommendation — Define operational controls that require pre-deployment checks and continual post-deployment assurance. | ||
| CIS Controls v8 | 16.5 — Application Software Security | Scanning before release and after deployment both support secure software delivery. |
| Recommendation — Embed artifact scanning into build and release workflows and verify production state continuously. | ||
| NIST CSF 2.0 | PR.DS — Data Security | Model integrity and protected release artifacts are central to this question. |
| Recommendation — Protect model artifacts and verify integrity before and after deployment. | ||
Practitioner Guidance
What to prioritise: use CI scanning as the release gate for the exact artifact you intend to deploy, and treat post-deployment scanning as continuous verification. If the same control is doing both jobs, it is usually doing neither well enough.
What to verify: confirm that scan results are tied to build identity, artifact hash, and deployment target so the team can prove what was approved. Without that linkage, a “passed scan” can drift away from the model that actually runs in production.
Decision rule: if the finding affects trust, provenance, embedded secrets, or policy compliance, block release in CI first; if the finding appears only after deployment, treat it as a live exposure and assess rollback, notification, and downstream dependency impact immediately.
Practitioner takeaway: the earlier the scan happens, the cheaper the failure is to contain, but the later the scan happens, the more likely it is to become an incident response problem instead of a quality-control problem.
Related resources from NHI Mgmt Group
- What is the difference between static model scanning and runtime AI red teaming?
- What is the difference between scanning in the developer workflow and scanning after deployment?
- What is the difference between governing AI agents by design and responding to issues after deployment?
- What is the difference between governing AI agents and simply monitoring their activity after deployment?