Look for package install records, layer build logs, and runtime artefacts that show AWS_LAMBDA_RUNTIME_API or calls to the Lambda Runtime API. Also inspect whether invocation events were missing, truncated, or diverted during the installation window, because that is the strongest sign of runtime interception.
Why This Matters for Security Teams
A suspicious package in a Lambda environment is not just a supply chain event. It can be a direct path to runtime interception, secret theft, or invocation manipulation inside ephemeral infrastructure that leaves little time for manual review. Security teams need to distinguish ordinary package installation from a package that modified execution flow, because the blast radius may include every function version, layer, or deployment artifact that reused the same build chain.
This is why software composition checks alone are not enough. Runtime evidence, build provenance, and control-plane logs must be correlated against the installation window and the function’s behavior. NIST’s NIST SP 800-53 Rev 5 Security and Privacy Controls is relevant here because it frames logging, integrity monitoring, and configuration management as operational requirements, not optional hardening.
NHIMG research shows how often visibility fails in practice: in The State of Non-Human Identity Security, only 1.5 out of 10 organisations report high confidence in securing NHIs, which is exactly the kind of confidence gap that lets suspicious package activity blend into normal deployment noise. In practice, many security teams discover package tampering only after a function starts behaving oddly or secrets have already been exposed.
How It Works in Practice
The investigation starts with build-time evidence. Security teams should review package install records, dependency lockfiles, layer assembly logs, CI/CD provenance, and artifact hashes to determine whether the package was expected, modified, or substituted. If the function uses Lambda layers, inspect layer version creation times and compare them to deployment windows and source control history. For runtime compromise, look for indicators that the package touched execution flow, such as calls to the Lambda Runtime API, unexpected access to LiteLLM PyPI package breach-style dependency paths, or artifacts that reference AWS_LAMBDA_RUNTIME_API.
Next, correlate runtime behavior. AWS Lambda normally emits invocations and execution telemetry in a predictable pattern. If invocation events were missing, delayed, truncated, or diverted during the install window, that is strong evidence of interception or instrumentation. Teams should compare CloudTrail, CloudWatch Logs, function metrics, ECR or S3 artifact events, and package manager logs to establish whether the package changed the handler, injected a wrapper, or altered the runtime bootstrap.
- Confirm whether the package came from an approved registry and whether the checksum matches the trusted build output.
- Check for modified handler files, wrapper scripts, unusual environment variables, or injected dependency hooks.
- Review whether the function had permission to fetch or decode secrets during the same period.
- Validate whether the package introduced outbound calls, especially to unknown domains or metadata-like endpoints.
This is where many detections fail: serverless workloads are short-lived, logs are fragmented across services, and a malicious package can execute before the first alert lands.
Common Variations and Edge Cases
Tighter package validation often increases release friction, requiring organisations to balance deployment speed against integrity assurance. The standard answer also changes depending on how the Lambda was built. Zip-based functions, container-image functions, and layer-heavy deployments leave different evidence trails, and there is no universal standard for this yet.
For example, a package that only adds telemetry may not touch the Runtime API directly, yet still expose secrets or reshape logs. Conversely, a benign observability agent may legitimately reference runtime interfaces, so investigators need context-aware comparison against known-good baselines. Current guidance suggests treating sudden changes in invocation shape, handler path, or dependency tree as higher-risk than a single suspicious file.
Teams should also remember that an attacker may not need persistent access if the package runs during build or cold start. That means a clean production snapshot does not prove the environment was never touched. The strongest evidence often comes from overlapping signals across build logs, package provenance, and runtime artifacts, not from any single log source alone.
These controls tend to break down in heavily automated CI/CD environments because ephemeral builds, shared layers, and incomplete telemetry make it difficult to prove exactly when the package first executed.
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 AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 | Suspicious package activity often exposes or abuses non-human identity secrets. |
| OWASP Agentic AI Top 10 | A-03 | Runtime interception by packages mirrors unsafe tool and execution control in autonomous systems. |
| CSA MAESTRO | M1 | MAESTRO addresses supply chain and runtime trust for autonomous workloads. |
| NIST AI RMF | AI RMF supports governance of unpredictable software behavior and operational monitoring. | |
| NIST CSF 2.0 | DE.CM-1 | Continuous monitoring is needed to spot package-driven runtime interception. |
Use AI RMF-style governance to require traceability, monitoring, and incident response for runtime anomalies.