Model and Dependency Supply Chain Security
When you deploy an AI system, you are assembling a supply chain of dependencies
The foundation is usually a large language model (GPT-4, Claude, Gemini or another) that you either host yourself or access via API. On top of the model, you build application code in Python, Node or another language.
That code depends on open-source libraries (transformers, LangChain, LlamaIndex, etc.). Each component in the chain could introduce security risk through vulnerabilities, malicious code, or misconfigurations. The larger and more complex your supply chain, the larger your attack surface and the more vendors whose security practices you depend on.
Supply chain attacks come in two main forms: counterfeit components and compromised components. A counterfeit component is a fake package uploaded to a package repository (like PyPI for Python) that mimics a legitimate package. If a developer mistypes the package name or an attacker has already registered the typo, installing the counterfeit package compromises the system.

A compromised component is a legitimate package whose maintainer account has been breached or whose source code has been corrupted. Popular packages with many dependents are high-value targets.
Defend against supply chain attacks by implementing several controls. The first is dependency pinning. Specify exact versions of all dependencies in your requirements.txt or package.json, not version ranges.
If you specify transformers==4.30.0, you always get that exact version. If you specify transformers>=4.28.0, you get whatever the latest version is, which might be a compromised version if the account was hacked. Pinned versions are more stable and secure.
The second control is dependency scanning. Use tools like Snyk, Dependabot, or OWASP Dependency Check to scan your dependencies for known security vulnerabilities. These tools maintain databases of vulnerabilities in popular packages.
If a package you depend on has a known vulnerability, the tool alerts you and recommends an update or workaround.
The third control is source code review. Before using a new open-source library, review the source code. Is the project actively maintained?
Do maintainers respond to issues? Is the code quality reasonable? Does the library do more than you need?
A library that parses JSON and also silently phones home to a telemetry server is a security risk. Review the code to understand what it actually does. For AI-specific libraries, this is especially important.
Some models and frameworks have behaviour that is not obvious from the documentation. A library that claims to anonymise data might still be logging intermediate values. A library that claims to run offline might have fallbacks that reach out to the internet if something goes wrong.
The fourth control is model provenance. Where did the model weights come from? If you use a model from Hugging Face or another model repository, verify that you are downloading from the official account, not a look-alike.
Verify checksums (SHA-256 hashes) if available. Some models are fine-tuned versions of other models; trace the chain of fine-tuning back to the original source.
The fifth control is container image security. If you deploy your system in Docker or Kubernetes, the container image itself is part of your supply chain. Use images from official registries (Docker Hub official images, AWS ECR public) rather than random repositories.
Scan container images for vulnerabilities before deploying. Tools like Trivy or Grype scan container layers and report vulnerable packages inside.
The sixth control is dependency updates. Do not let dependencies become stale. Old versions accumulate security vulnerabilities that attackers can exploit.
Establish a schedule for updating dependencies (weekly or monthly), run tests to make sure updates do not break functionality, and deploy updates promptly. Automation tools like Dependabot can automate the process of proposing updates. However, you still need to review updates, test them in CI, and decide when to deploy them.
A fully automated update process can be risky; human judgment should guide the schedule.
The seventh control is inventory. Maintain a software bill of materials (SBOM) that lists all dependencies, their versions, and their sources. This inventory is valuable for compliance, incident response and assurance.
When a vulnerability is announced in a package, you can immediately query your SBOM to see whether you are affected. Most organisations now require SBOMs from their software vendors as part of procurement. If you are selling AI systems or services, providing an SBOM to customers is table stakes.
An SBOM should be machine-readable (in a format like CycloneDX or SPDX) so that customers can automate vulnerability checks against their own security policies.
Enterprise AI Readiness & Maturity Assessment
Benchmark your organization's data infrastructure, AI governance posture, and high-ROI implementation pathways.
