SKY-D225 · AI-code defects
Dependency version hallucination
A version hallucination is a pin to a release that was never published, such as flask==4.2.0 when Flask's newest major is 3. The package is real, the version is invented. SKY-D225 asks the registry whether each pinned version of a dependency exists.
- Languages
- Python (requirements.txt, pyproject.toml), JavaScript/TypeScript (package.json), Go modules, install commands in scripts, Dockerfiles, CI files and docs
- Turned on by
skylos . --ai-defects(or-a) with network access to PyPI, the npm registry and the Go module proxy- Quality gate
- counted toward the gate limits (full and diff scans). Counts toward
max_ai_defects. HIGH findings do not fail the gate on their own unlessblock_ai_defect_severitiesunder[tool.skylos.gate]lists"HIGH". The agent hook (skylos verify) blocks on it.skylos donelists it as advice unlessunknown_imports = "block"is set under[tool.skylos.done.checks]. - Finding type
- review
Why it matters
The install fails in CI or, worse, on the next fresh deploy, long after the change was merged. A coding agent that sees the failure often "fixes" it by removing the pin, so the project then installs whatever the newest release is.
What Skylos flags
flask==4.2.0gunicorn==23.0.0What Skylos leaves alone
flask==3.1.0gunicorn==23.0.0Why Skylos leaves it alone
Flask 3.1.0 is a published release, so PyPI answers for that version and nothing is reported. Skylos reports a pin only when the registry knows the package but not the version.
More languages
JSON
Flagged
{ "name": "checkout-api", "version": "1.0.0", "private": true, "dependencies": { "express": "6.2.0", "express-rate-limit": "7.4.0" }}Not flagged
{ "name": "checkout-api", "version": "1.0.0", "private": true, "dependencies": { "express": "4.21.2", "express-rate-limit": "7.4.0" }}Why Skylos leaves it alone
Express 4.21.2 exists in the npm registry. For npm, only exact versions are checked: a range such as ^6.2.0 is checked for the package name alone.
How Skylos decides
- Reads
requirements.txt,pyproject.toml,package.json,go.modand other manifests up to three folders deep, pluspip install name==1.0,npm install name@1.0andgo getlines in shell scripts, Dockerfiles,.github/workflowsfiles and shell blocks in Markdown. - Takes one version per entry: the
==pin, or the lower bound of~=and>=for Python; the exact version for npm; the required version for Go. Wildcard pins such as==1.2.*and npm ranges are not checked for a version. - Asks the registry for that version: the PyPI JSON API, the npm registry or the Go module proxy. When the version is missing but the package exists, reports SKY-D225 on the manifest line. When the package is missing too, the finding is SKY-D222 instead.
- Skips entries the registry cannot answer (network error, timeout), manifests that use a private index or registry (
--index-url,[[tool.poetry.source]], an.npmrcregistry,PIP_INDEX_URL=), and ecosystems without a checker, such as Cargo or Maven. Answers are cached in.skylos/cache/dependency_versions.json.
How to fix it
Pin a version the registry really has, normally the newest release of the major version your code was written for. Look it up with pip index versions flask or npm view express versions instead of trusting a suggested number.
flask==3.1.0gunicorn==23.0.0When it can be wrong
- A version published only to your own mirror or private index is reported when the manifest does not name that index. Add the
--index-urlline or.npmrcregistry Skylos can read. - A release that the maintainers deleted from the registry is reported as missing, which is usually right: a fresh install fails too.
- Without network access the registry check cannot answer and nothing is reported.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
[tool.skylos] ignore = ["SKY-D225"]turns the rule off for the project.