Static review loses much of its value because the malicious behaviour happens at interpreter startup, before many logging, detection, and policy layers are active. In practice, the control that fails is pre-execution trust. Security teams need runtime monitoring, startup artefact inspection, and process-level containment to catch package behaviour that looks legitimate on disk but acts maliciously when loaded.
When pre-execution trust is the thing that breaks
The core failure is not just that a package is malicious, it is that security logic assumed it would have a chance to inspect, log, or block behaviour after startup. If code runs during interpreter initialisation, the window for reputation checks, policy hooks, and even basic observability can be too late. That makes the trust decision happen before the control plane is ready.
That is why startup-time package behaviour is so disruptive in dependency-heavy ecosystems: the artefact can look normal on disk, pass static review, and still execute side effects as soon as the runtime imports it.
The practical implication is that “safe to install” and “safe to load” are no longer the same question. A dependency review that focuses only on file contents or package metadata misses the execution path that matters most.
Why static review stops being enough
Static scanning still has value, but it cannot be the only gate when execution occurs before the normal stack is active. Behaviour that depends on interpreter startup, import side effects, or module initialisers can evade controls that assume the application is already fully up and instrumented.
That also changes how defenders interpret clean results. A package with no obvious malicious payload at rest may still be unsafe if its first meaningful action is to open network connections, alter environment state, or reach for secrets before logging and containment are in place.
For that reason, dependency review should distinguish between artefact inspection and execution-time assurance. They answer different questions, and in this failure mode the second one is the deciding one.
Supply-chain trust also matters because the execution path is often triggered through ordinary install or import workflows. NIST SP 800-53 Rev 5 Security and Privacy Controls remains relevant here because the issue spans code integrity, system monitoring, and controlled execution paths, not just package vetting. For open source dependency risk, the OpenSSF ecosystem is a useful reference point for supply-chain hardening, and the AI Supply Chain Security and AI-BOM Guide is a practical way to think about packages, tools, and credential containment together.
How to control code that can run before guardrails load
The control answer is to assume some untrusted code may execute earlier than your usual monitoring stack. That means the highest-value protections are those that operate at process start, not after the application has already begun trusted work.
Inspect startup artefacts, not just final binaries or source trees. Review import chains, initialisation logic, entry points, and any package that can execute code during installation or module load. Pair that with runtime monitoring that can see the process from first instruction onward, because post-launch telemetry may miss the earliest action entirely.
Containment matters as much as detection. Restrict file, network, and secret access at the process level so an imported dependency cannot immediately pivot from startup execution into data theft or persistence.
Where AI-related dependencies are involved, the supply-chain and runtime problem is the same even if the workload is “just a library.” The AI Security Posture Management (AI-SPM) Guide is useful for mapping exposed packages, identities, and attack paths, while the Analysis of Claude Code Security shows why code that runs through normal developer tooling can still create security impact before traditional controls engage.
Risk and Threat Considerations
When a dependency can execute before controls load, the main risk is a blind spot at the moment of first trust. An attacker only needs one early execution path to bypass logging, evade policy enforcement, or reach secrets before containment is active.
Failure mechanism: Import-time or startup-time code runs before security agents, audit hooks, and policy enforcement are fully active, so malicious actions can occur with little or no telemetry.
Impact: You can miss credential theft, network calls, environment probing, or persistence actions that happen before the application is fully instrumented, which makes compromise harder to prove and contain.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | SI-7 — Software, Firmware, and Information Integrity | Startup-time package abuse is an integrity problem for loaded code. |
| AU-2 — Event Logging | Early execution can evade normal logging unless launch-time events are captured. | |
| AC-6 — Least Privilege | If early code executes, privilege boundaries limit the damage it can do. | |
| Recommendation — Verify and monitor code integrity before trusting imported dependencies. Capture process-start and import events before application code runs. Restrict dependency processes to the minimum access needed at startup. | ||
| CIS Controls v8 | CIS-2 — Inventory and Control of Software Assets | Dependency-driven startup risk depends on knowing what code is present and used. |
| CIS-10 — Malware Defenses | Malicious dependency behaviour is a software-borne threat that needs defensive detection. | |
| Recommendation — Inventory packages and block unapproved software from execution paths. Scan and monitor software execution for malicious behaviour at launch. | ||
Practitioner Guidance
What to verify: Confirm whether your runtime, container, or host actually instruments the process from launch, not from application steady state. If it does not, treat any package with startup execution paths as a higher-risk dependency.
Decision rule: If a dependency can run code during install or import, require startup monitoring and process isolation before you rely on static review alone. If you cannot enforce that, treat the package as untrusted until it is contained.
What good looks like: The first execution path is observable, the process has minimal privileges, and secrets are not accessible to early startup code unless explicitly required.
Practitioner takeaway: The key judgement is not whether the package looks benign on disk, but whether you can still see and constrain it at the exact moment it first executes.
Related resources from NHI Mgmt Group
- What breaks when AI gateway controls are treated like ordinary API security?
- Should organisations evaluate AI agent security tools before or after identity controls are in place?
- How should security teams classify AI agents before writing controls?
- Should organisations buy dedicated AI security tools before redesigning controls?
Deepen Your Knowledge
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.
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