Without delete controls, an apply can remove production resources unexpectedly, especially when a planned update turns into a replacement. The usual failures are downtime, interrupted services, and recovery work that was never budgeted. The control gap is often procedural as much as technical, because teams assume the change will be non-destructive.
Why This Matters for Security Teams
Delete controls are the difference between a reversible deployment and an unplanned outage. In infrastructure pipelines, an apply step often has the authority to replace resources, not just update them, so missing delete safeguards can turn a normal change into data loss, service interruption, or an expensive recovery exercise. NIST’s SP 800-53 Rev 5 Security and Privacy Controls treats change control as a governance problem, not just a tooling problem, because destructive actions need explicit approval and traceability.
The risk is amplified when pipelines manage NHIs, secrets, and infrastructure in the same workflow. NHIMG research on CI/CD pipeline exploitation case study shows how quickly pipeline trust assumptions collapse once attackers or faulty automation can reach deployment logic. Teams often assume “apply” means additive drift correction, but real-world IaC engines may destroy and recreate resources to satisfy the desired state. In practice, many security teams encounter the blast radius only after a planned change has already taken a production dependency offline.
The problem is more common where release speed outruns review discipline. When deletion is implicit, operators lose the chance to distinguish a safe rollout from a destructive replacement, and incident response becomes the backstop for a control that should have existed in the pipeline.
How It Works in Practice
Delete controls should be treated as a separate authorization path inside the pipeline, not as a side effect of general deployment permission. The usual pattern is to require explicit confirmation, policy checks, or separate approvals before any resource destroy, replace, or prune action proceeds. That can be implemented through policy-as-code, protected change windows, and plan review gates that surface deletions before execution.
For infrastructure as code, the practical question is not only “who can deploy” but “who can remove.” Mature pipelines distinguish update operations from destructive ones, and they log those decisions with enough context to prove intent. A good control set usually combines:
- Pre-apply plan inspection that flags creates, updates, and deletes separately.
- Manual approval or break-glass review for destructive changes.
- Role separation so deployment permissions do not automatically include delete authority.
- Short-lived credentials for pipeline jobs so access ends when the change completes.
- Audit logs tied to change tickets, commit hashes, and runtime policy decisions.
This matters especially for NHIs because pipeline identities, cloud service accounts, and automation tokens often outlive the change they were meant to perform. The Guide to the Secret Sprawl Challenge and the Ultimate Guide to NHIs both underscore how long-lived credentials and poor revocation discipline expand the damage when a pipeline performs an unintended delete. Industry guidance is converging on stronger separation between provisioning and destruction, but there is no universal standard for this yet.
These controls tend to break down when teams use shared pipeline identities across environments because a single mis-scoped token can delete resources in production as easily as in test.
Common Variations and Edge Cases
Tighter delete controls often increase delivery overhead, requiring organisations to balance safety against release speed. That tradeoff becomes visible in environments that rely on ephemeral infrastructure, blue-green deployments, or aggressive resource replacement, where some deletion is expected and not inherently risky.
The edge case is not “all deletes are bad.” The edge case is when the pipeline cannot tell the difference between a planned teardown and an accidental replacement. Best practice is evolving toward context-aware approvals: delete access only for the resources, environments, and time windows that match the change intent. In some teams, that means temporary elevation for a specific run; in others, it means separate service accounts for provisioning and decommissioning.
Another common failure mode appears in multi-account or multi-subscription environments, where a pipeline has broad IAM privileges but weak environment isolation. If the same automation path can touch dev, staging, and prod, a bad plan can cascade across all three before anyone notices. The operational lesson is simple: if deletion is possible, it must be both visible and constrained. Without that, the “automation” layer becomes the fastest route from change request to outage.
For teams building governance around this problem, NIST’s security control model and NHIMG’s research on pipeline and secret exposure are the most practical references for turning deletion from an implicit side effect into an explicit, reviewable decision.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-05 | Delete gaps often stem from over-privileged pipeline identities. |
| OWASP Agentic AI Top 10 | A-04 | Autonomous pipelines can execute destructive actions without clear intent checks. |
| CSA MAESTRO | IAM-03 | MAESTRO emphasizes least privilege and task-scoped access for automated systems. |
| NIST CSF 2.0 | PR.AC-4 | Delete controls are a least-privilege and access governance issue. |
| NIST AI RMF | AI RMF helps govern autonomous change systems that can trigger destructive infra actions. |
Apply governance, accountability, and monitoring to any automation that can alter infrastructure.