Join our Newsletter — 33% off our NHI Course
Home› FAQ› Cyber Security› Should teams prioritise install-time enforcement or runtime detection…
Cyber Security

Should teams prioritise install-time enforcement or runtime detection first?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 23, 2026 Domain: Cyber Security

Install-time enforcement should come first when the compromise can trigger before the package manager returns control. Runtime detection still matters, but it is compensating control after execution has started. If the control boundary is the install step, prevention there reduces both secret exposure and downstream workflow poisoning.

Why install-time enforcement should lead

Install-time enforcement is the right first move when the dangerous action can happen before the package manager hands control back to the operator or automation. If a malicious package, installer script, or dependency can execute during installation, runtime-only controls arrive too late to stop the initial compromise. Prevention at the boundary also reduces the chance that secrets, tokens, or workflow state are exposed before detection can intervene.

The practical distinction is where the trust decision happens. Install-time controls decide whether the artefact is allowed to enter the environment at all, while runtime detection assumes execution is already underway and looks for signs of misuse. That makes install-time enforcement the stronger control when the package lifecycle itself is the attack path, especially in build systems, CI pipelines, and automated deployment flows.

When the question is really about blast radius, the earlier control usually has the better leverage. Blocking a malicious or tampered package before it is unpacked or executed can prevent environment poisoning, dependency substitution, and downstream build contamination. Runtime detection can still confirm suspicious behaviour later, but it is compensating control rather than the primary gate.

When runtime detection becomes the better complement

Runtime detection matters when the package is legitimate at install time but becomes dangerous through later behaviour, such as unexpected network calls, child process creation, credential use, or file-system tampering. It is also important where teams cannot fully trust upstream provenance or where adversaries can bypass static checks by delaying malicious activity until after install completes.

That is why the two controls are not substitutes. Install-time enforcement is the first line for stopping untrusted code from entering execution, and runtime detection is the ongoing guardrail for behaviour that only becomes visible once the software is active. If you only have budget for one control first, choose the one that intercepts the attack before it can run.

For teams building layered defences, the best pattern is to align the two controls to different failure points: install-time policy for admission, runtime telemetry for misuse. A package that passes the gate should still be observable once it is running, because detection is often the only way to catch latent abuse, post-install payloads, or compromised dependencies that were not obvious at ingestion time.

What this means for supply-chain and execution risk

The core decision is not “prevention or detection” in the abstract, but which point in the lifecycle gives the attacker the first meaningful opportunity. If execution can begin during install, then runtime-only detection leaves a window where the environment may already be altered. If the artefact is inert until later, runtime monitoring may be the more visible control, but it still should not replace admission control where installation risk exists.

Teams also need to think about what is exposed if the install step is the compromise boundary. Secrets mounted in the build agent, cached credentials, package manager tokens, and inherited workflow permissions can all be accessed before a security team sees suspicious behaviour. The earlier the control, the less likely you are to rely on cleanup after the fact.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while OWASP ASVS, CIS Controls v8, NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV13 — ConfigurationInstall-time enforcement depends on secure package and deployment configuration.
Recommendation — Enforce configuration rules that block untrusted packages before execution.
CIS Controls v8CIS-10 — Malware DefensesRuntime detection and blocking are central to catching malicious package behaviour.
Recommendation — Deploy malware and behaviour defenses that alert on post-install execution.
NIST SP 800-53 Rev 5SI-7 — Software, Firmware, and Information IntegrityThis question is about preventing malicious or tampered code from entering execution.
Recommendation — Verify software integrity before allowing installation or execution.
MITRE ATT&CKT1204 — User ExecutionInstaller-triggered code execution is a common initial access mechanism.
Recommendation — Map installer-driven execution paths and block them at admission.
NIST CSF 2.0PR.DS-08 — Integrity verificationInstall-time enforcement is fundamentally about verifying integrity before use.
Recommendation — Verify artefact integrity before deployment or installation.

Practitioner Guidance

What to prioritise: Put install-time enforcement first wherever the package or installer can execute code during admission. Use runtime detection as the second layer, especially for packages that are allowed in but still need behavioural monitoring.

Decision rule: If the compromise can happen before the installer returns control, treat prevention as the primary control. If the main concern is post-install behaviour, keep runtime detection, but do not assume it compensates for weak admission checks.

What to verify: Confirm that your policy actually blocks the dangerous path, not just the package name or checksum. The control should fail closed when provenance, signature, or installation behaviour is unacceptable, and your telemetry should prove that blocked events are visible for investigation.

Practitioner takeaway: The first control should stop execution at the earliest trustworthy boundary, because once a malicious package is running, detection is already behind the attacker’s first move.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 23, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org