Knowledge · Application Security

Dependency Security for AI-Generated Code

Why AI-generated software increases dependency opacity and makes dependency security analysis — including SCA, hybrid analysis, and supply-chain evaluation — more important than in traditional development.

Primary question: Why do AI-generated applications require explicit security analysis of their open-source dependencies?

Definitions

AI-generated application

A software application produced or significantly modified by an AI coding system, which may introduce source code and dependencies without the same deliberate dependency-selection process used in traditional development.

Dependency opacity

A condition where the true set of dependencies used by an application — including direct, transitive, and runtime-expanded dependencies — is not clearly known or verified by the development team.

AI-suggested dependency

A package or library proposed by an AI coding tool as a dependency of generated or modified code, which the developer may accept without independent verification against the official package registry.

Dependency security analysis

The process of identifying, evaluating, and monitoring all third-party dependencies in a software project, including vulnerability assessment, supply-chain risk evaluation, and license compliance verification.

The engineering problem

AI coding tools can suggest dependencies that the developer accepts without verifying whether the package exists, is maintained, or has known vulnerabilities. This creates supply-chain risk that traditional functional testing does not detect. [github-copilot-hallucinated-packages]

AI-generated applications can have a larger and less transparent dependency surface than their visible imports suggest, because transitive and runtime dependencies may not be obvious during code review. [hidden-deps-study]

Organizations that rely solely on functional testing and human code review of AI-generated code may miss vulnerable or license-restricted dependencies that require automated SCA analysis to detect. [nist-ssdf]

AI-generated code can introduce new dependencies that were not present in the original project, changing the application's vulnerability and supply-chain posture without the developer's awareness. [nist-ssdf]

Security controls

Each control inspects a different artifact and produces evidence for an engineering decision.

Dependency discovery

SBOM generation
Artifact
Dependency manifests, project files, and installed component directories in the AI-generated change.
Risk
Incomplete dependency inventory that blocks vulnerability assessment and supply-chain evaluation.
Output
An SBOM documenting the direct and transitive dependencies discovered by the selected resolution and analysis methods.

Evidence: DerScanner software composition analysis documentation

Dependency evaluation

Software Composition Analysis
Artifact
The component inventory produced by dependency discovery, cross-referenced against vulnerability databases, license registries, and supply-chain risk indicators.
Risk
Vulnerable, license-restricted, or supply-chain-risky dependencies in the AI-generated application.
Output
Component-level findings for the discovered dependencies, including vulnerability severity, license type, and supply-chain risk assessment.

Evidence: DerScanner software composition analysis documentation

Code-level reachability analysis

Hybrid SAST + SCA analysis
Artifact
Application source code and dependency functionality, correlated to determine which vulnerable dependency functions are actually called from the application code.
Risk
Vulnerable dependencies whose vulnerable functionality is not reached from application code, leading to over-prioritization of findings.
Output
Code-level reachability evidence showing which vulnerable dependency functions are imported or called from the AI-generated application, based on the dependency inventory discovered by SCA.

Evidence: DerScanner software composition analysis documentation

Verification workflow

  1. Generate or modify code with an AI coding tool.
  2. Identify all new or changed dependencies introduced by the AI-generated change.
  3. Run SBOM generation to discover the direct and transitive dependencies in the AI-generated application.
  4. Run SCA analysis to evaluate dependencies for vulnerabilities, license risks, and supply-chain risks.
  5. Run hybrid SAST+SCA analysis to determine which vulnerable dependency functions are actually reached from application code.
  6. Validate and prioritize findings based on reachability evidence and severity.
  7. Remediate confirmed findings and re-run analysis before production acceptance.

Limits of verification

  • Dependency security analysis cannot prevent compromise of the official package registry itself.
  • SBOM completeness depends on the quality of dependency manifests and source-file resolution.
  • Reachability analysis provides evidence about code paths but does not by itself prove exploitability.
  • AI-generated code can introduce dependencies that were not anticipated by the development team.
  • Production acceptance remains an organizational engineering decision.

Canonical terms used: Dependency security; AI-generated dependencies; Dependency opacity; Hybrid SAST + SCA analysis.

Evidence and references

  1. NIST Secure Software Development FrameworkSecure software practices require automated analysis, review, verification, and retained evidence throughout development, including software supply chain security and dependency management.nist-ssdf
  2. OWASP AISVS Appendix C — AI for Code GenerationAutomated security testing should run on pull requests containing AI-generated code, including SCA for dependency and supply chain analysis.owasp-aisvs-ac-42
  3. GitHub guidance on reviewing AI-generated code — hallucinated dependenciesAI coding tools may suggest non-existent or incorrect package names; developers should review and validate AI-generated code before use.github-copilot-hallucinated-packages
  4. AI-Generated Code Is Not Reproducible (Yet) — Dependency gaps in LLM-based coding agentsOne empirical study of three coding agents and 300 generated Python, JavaScript, and Java projects found that generated code frequently references dependencies that are missing, have incorrect versions, or depend on transitive dependencies that are not explicitly declared. This study examined a specific set of coding agent tasks and should not be generalized to all AI-generated code.hidden-deps-study
  5. DerScanner software composition analysis documentationDerScanner SCA identifies component vulnerabilities, dependencies, software supply chain risks, and license risks. DerScanner also provides hybrid SAST+SCA analysis capabilities for dependency vulnerability prioritization.derscanner-sca

Analyze AI-generated dependencies

Apply SCA and hybrid analysis to AI-generated applications for layered dependency-security analysis.

Tell us about your AI-assisted development workflow and dependency management challenges. The DerScanner team will help map SCA and hybrid analysis to your process.

Analyze AI-generated dependencies

Discuss dependency security for your AI-assisted development

Share your AI coding tool usage, dependency management requirements, and security analysis needs. We will respond with the next practical step for automated dependency security analysis.

Engineering knowledge for building and operating trustworthy systems.

DerSecur Recognition · build 821af10 · 2026-08-09 16:41:16Z · system