# The Agent-Added Dependency Read: Install, Substitute, Verify, or Reject

*Take one agent-added package in a pull request, score six evidence dimensions, and reach Install, Substitute, Verify, or Reject in about fifteen minutes.*

- Canonical URL: https://www.refolk.ai/guides/agent-added-dependency-read
- Pillar: Engineering and open source
- Format: Framework
- Published: 2026-11-26
- Last reviewed: 2026-11-26
- Reading time: 23 min
- Keywords: how to verify a package suggested by AI, slopsquatting check before npm install, is this pypi package legitimate, review new dependency added by coding agent, hallucinated package name detection, verify npm package matches github repo

## Key takeaways

- In a 16-model study, 440,445 of 2.23 million package references produced by coding models (19.7%) named packages that do not exist on PyPI or npm.
- 43% of hallucinated package names came back on all ten reruns of the same prompt, which lets an attacker register a predictable name in advance and wait.
- Release-age cooldowns in npm, pnpm, uv, and GitHub's package firewall gate how old a version is, not how old the name is, so a name squatted weeks earlier passes all of them.
- npm provenance becomes identity evidence only when the signing repository is checked against a repository pinned in advance; npm audit signatures does not compare the signer with any expected identity.
- Only 13.4% of hallucinated names sit within one or two characters of a real package, so name proximity has to be judged against the upstream project's own install instruction, not edit distance.
- In Refolk's index, 257 US profiles carry 'software supply chain security' in the headline against 15 in Germany, and 48% of a 25-profile US sample worked for vendors.

A coding agent has put a package name in the manifest that nobody on the team chose, and the pull request needs a decision before merge. This read is for the engineering managers, technical founders, developer-relations leads, and sourcers who review that decision or staff the people who make it. It scores one dependency on six evidence dimensions, turns the scores into one of four verdicts (Install, Substitute, Verify, Reject), and leaves a record that a second reviewer can replay to the same answer.

## Why does an agent-added dependency need an identity read?

An agent-added dependency needs an identity read because the main risk is not that the package is unsafe in general. The risk is that this exact name is not the project the agent meant. Generic intake checklists cover necessity, license, known vulnerabilities, and project health. They all assume the name is right and never test it.

The name is wrong often enough to matter. Spracklen et al. (USENIX Security 2025) tested 16 models. Their 576,000 code samples produced 2.23 million package references, and 440,445 of those references (19.7%) named packages that do not exist on PyPI or npm. Those references covered 205,474 distinct names. Some secondary write-ups describe 19.7% as the share of samples containing a hallucinated name. The primary-derived counts are references, so quote it that way.

#### From generated references to invented names

| Stage | Figure | Note |
| --- | --- | --- |
| Package references generated | 2,230,000 | from 576,000 code samples |
| References to non-existent packages | 440,445 | 19.7% of references |
| Distinct invented names | 205,474 | each one a name someone could register |

*One in five package references from 16 coding models named something that did not exist on PyPI or npm.*

Three findings turn this from a curiosity into an attack surface:

- **Hallucinations repeat.** When the prompts were rerun ten times, 43% of hallucinated names came back on all ten runs and 58% came back more than once. 39% never came back.
- **They repeat across models.** A five-model replication found 127 identical hallucinated names in all five: 109 on PyPI and 18 on npm.
- **They get claimed.** Raj and Sahu found that half the hallucinations their pipeline flagged were already registered on PyPI.

Rates differ by model class. The same research reports 21.7% for open-source models and 5.2% for commercial ones. Neither number is zero, so the read applies whichever agent wrote the PR.

**Slopsquatting**, a term Andrew Nesbitt coined with Seth Larson, means registering a name that models predictably invent, so that the next agent-driven install pulls the attacker's code. Because names recur, an attacker can register early and wait.

**43% - of hallucinated package names came back on all ten reruns of the same prompt**

A name that recurs this reliably can be registered in advance, so by the time an agent suggests it, it already exists.

Two terms used throughout. The **canonical package** is the name the upstream project's own documentation tells you to install. The **identity chain** is the series of links from those docs to the registry entry, then to the source repository, then to the build that produced the file you would install.

## The six evidence dimensions and what each proves

Each dimension answers one narrow question about identity, and each one has a known way of lying. The table is the reference. The notes below it say where to look.

| Dimension | What it proves | How it lies | Fast check |
|---|---|---|---|
| D1 Name existence and age | The name resolves, and since when | Squatted names exist too | First-publish date vs upstream's age |
| D2 Identity chain | Docs, registry, repo, and build agree | Repo field is free text without provenance | README names this package; pinned attestation |
| D3 Publisher history | The same hands publish each release | Staged publishing can show the approver | `_npmUser` or trusted publisher by version |
| D4 Real dependents | Other projects chose this name | Counts can be thin or unsourced | Named dependents, method recorded |
| D5 Name proximity | Whether it is the canonical name | Typo checks miss most hallucinations | Normalized compare to upstream install line |
| D6 Install-time behavior | What actually runs and ships | Clean repo, swapped tarball | Hooks list, tarball diff against tag |

**D1, name existence and registration age.** The date that matters is when the name was first published, not when the latest version was. npm exposes it as `time.created` in the registry document at `https://registry.npmjs.org/<pkg>`, with per-version dates in `time[<version>]`. On PyPI, use the upload time of the earliest release file. Release metadata lives at `https://pypi.org/pypi/<project>/<version>/json`.

**D2, identity chain.** On npm, follow the `repository` field, open that repo, check that its README names this exact package, then read the attestation linked from `dist.attestations.url`. On PyPI, provenance comes from the integrity API at `/integrity/<project>/<version>/<filename>/provenance`, which is linked from each file in the Simple JSON API. A PEP 740 attestation (PyPI's standard for signed upload attestations) proves that a specific file, identified by digest, was uploaded by a specific workflow in a specific repository. It does not prove that the repository is the one you meant.

**D3, publisher history.** The npm registry sets `versions[v]._npmUser` to the account or trusted publisher that performed the publish, so a package author cannot forge it. A trusted publisher is the CI identity the registry records as having done the publish. I have not established a PyPI JSON field for the uploader account. The Trusted Publisher identity inside the provenance object is the verified substitute.

**D4, real dependents.** Dependents show that other projects chose this name on purpose. I have no primary source for a stable dependents endpoint on either registry, so record the count, the named dependents, and exactly how you got them. A number without a method cannot be replayed.

**D5, name proximity.** Compare against the canonical name after PEP 503 normalization: lowercase the name, and collapse any run of `-`, `_` and `.` into a single `-`. Judge proximity by meaning, not by typo distance. Only 13.4% of hallucinated names were within one or two characters of a real package, while 38% were moderately similar. Also check the other ecosystem, because 8.7% of Python hallucinations were valid npm package names. Import names that differ from distribution names are a known source of mismatches. I have not verified a list of them, so check the upstream install line every time instead of trusting memory.

**D6, install-time behavior.** Lifecycle hooks (preinstall, install, and postinstall scripts that run on install) and files that appear in the published tarball but not in the tagged source are what actually executes on your machine. `npm view <pkg> scripts` shows the hooks without running them. `npm pack <pkg>@<ver>` followed by `diff -rq` against the tagged commit shows the files that exist only in the tarball.

#### What each evidence layer can and cannot fake

1. **Name on the registry** - Proves someone published; squatters pass this
2. **Registry metadata** - Declared repo and publisher; the repo field is free text
3. **Provenance attestation** - Which repo and workflow built the file; not whether it is the right repo
4. **Tarball contents and hooks** - What actually installs and runs; the only layer that shows swapped code

*Each layer can pass while the layer beneath it lies, so the read has to reach the tarball.*

## How to score each dimension and reach a verdict

Score each dimension Green, Yellow, or Red against the rubric below, then apply the four verdict rules in a fixed order: Substitute, then Reject, then Verify, then Install. The fixed order is what makes two reviewers agree.

**Agent-added dependency scoring rubric**

```
D1 NAME EXISTENCE AND AGE
  G  Exists; first-publish date fits the upstream project's public history
  Y  Exists and is recent, but the upstream project is also recent
  R  Does not exist, or first published long after the project the agent meant

D2 IDENTITY CHAIN
  G  Upstream docs -> registry -> repo -> README -> pinned attestation all agree
  Y  No attestation published; every other link agrees
  R  A link contradicts: README names another package, or attestation repo is not the pinned repo

D3 PUBLISHER HISTORY
  G  Same trusted publisher or accounts across versions
  Y  Change with a visible explanation (for example a staged-publishing approver)
  R  Unexplained switch, such as CI trusted publisher -> personal account

D4 REAL DEPENDENTS
  G  Named, recognisable dependents, with the method recorded
  Y  Few or unverifiable dependents
  R  None, on a name newer than the project it claims to be

D5 NAME PROXIMITY TO CANONICAL
  G  Matches the upstream install line after PEP 503 normalization
  Y  No upstream install instruction found to compare against
  R  A canonical name exists and differs (look-alike, import name, or other ecosystem)

D6 INSTALL-TIME BEHAVIOR
  G  No lifecycle hooks, or hooks present in upstream source; tarball matches tag
  Y  No matching tag found; nothing unexplained in the tarball
  R  A hook or file present only in the tarball
```

*Paste into the PR description or review comment; score each line G, Y, or R and keep the reason next to the score.*

Apply the verdict rules in this order and stop at the first one that fires:

1. **Substitute** when D5 is Red. A canonical package exists and the agent's name is not it. Swap in the canonical name, run the full read again on the canonical package, and record the agent's name as rejected.
2. **Reject** when D1, D2, D3, or D6 is Red. A name that does not exist, with no canonical found, also lands here.
3. **Verify** when nothing above fired but D4 is Red, D5 or D6 is Yellow, or two or more dimensions are Yellow. Hold the PR and send one written question to a named second reviewer.
4. **Install** when all six are Green, or when the only Yellow is on D1 through D4 and its reason is written down.

| Verdict | Fires when | What happens to the PR |
|---|---|---|
| Substitute | D5 Red: canonical name differs | Swap name, rerun read on canonical |
| Reject | Red on D1, D2, D3, or D6 | Remove dependency, log the name |
| Verify | D4 Red, D5 or D6 Yellow, or 2+ Yellows | Hold; one question to a named reviewer |
| Install | All Green, or one explained Yellow on D1 to D4 | Merge with the record attached |

Generic checklists have no Substitute verdict. Without it, a reviewer who spots a look-alike name can only reject, and the agent often suggests the same invented name again in the next session. Substitute fixes the PR and leaves a logged name the team can watch for.

A missing PyPI attestation is Yellow, not Red. When PEP 740 attestations launched, only 18 of the 360 most-downloaded PyPI packages had them, and pip and uv do not reject unattested packages by default. A missing attestation is normal. An attestation that points at the wrong repository is not.

#### Name match against identity evidence

Horizontal axis runs from Evidence has gaps or contradictions to Evidence agrees end to end. Vertical axis runs from Name differs from canonical to Name is the canonical name.

| Quadrant | What it means |
| --- | --- |
| Right name, bad evidence | Reject on any Red in D1, D2, D3, or D6; Verify if only gaps |
| Right name, clean evidence | Install and attach the record |
| Squatted or invented name | Substitute the canonical, log the agent's name as rejected |
| Real but different project | Substitute the canonical and rerun the read on it |

*The canonical-name question decides Substitute; the evidence question decides between Install, Verify, and Reject.*

> **Rule:** Pin the expected repository before you look at provenance
>
> Provenance counts as identity evidence only when you check it against a repository you wrote down from the upstream docs first. Use pypi-attestations verify pypi --repository on PyPI and cosign with --certificate-identity-regexp on npm, because npm audit signatures does not compare the signer with any expected identity.

On PyPI, a pinned check fails loudly when it should. One published demo shows the CLI rejecting a file with "provenance was signed by repository urllib3/urllib3, expected urllib3/urllib4". That is the error you want to see when the repository is wrong.

## Who settles a Verify verdict, and where to find them

A Verify verdict goes to one named second reviewer with one written yes-or-no question. The people qualified to answer registry and provenance questions are scarcer, and more concentrated at vendors, than a headline search suggests. Phrase the question so it can be answered without rerunning the whole read, for example: "Is urllib3/urllib3 the repository that should sign this file?"

Inside the team, the reviewer is whoever owns dependency intake. When nobody does, or when the question is about how a registry or tool behaves rather than about one package, you need someone from outside. That makes it a sourcing problem.

| Metric (Refolk's index) | United States | Germany |
|---|---|---|
| Profiles with the headline phrase | 257 | 15 |
| Sample analysed | 25 | 15 |
| Sales or GTM titles in sample | 5 (20%) | 3 (20%) |
| Vendor-employed in sample | 12 (48%) | 5 (33%) |

In Refolk's index of professional profiles, 257 US profiles carry "software supply chain security" in the headline, against 15 in Germany. That is a ratio of about 17.1 to 1. The headline count overstates the bench. In the 25-profile US sample, 12 (48%) worked for supply-chain security vendors, Chainguard alone accounted for 7 (28%), and 5 (20%) held sales or go-to-market titles. In Germany, the visible practitioners included the co-lead of OWASP Dependency-Track and several DevSecOps engineers. The title and employer classifications are Refolk's own, and the samples are small, so read the percentages as the shape of the market rather than precise measurements.

**257 - US profiles in Refolk's index with "software supply chain security" in the headline**

Germany has 15; in the US sample, nearly half work for vendors and a fifth hold sales titles.

How you phrase the search matters as much as the market. A US headline search for "sigstore SLSA provenance" returns 0 profiles in Refolk's index. The zero almost certainly comes from multi-term matching. It means no headline names all three terms, not that nobody does the work. The people who can settle a Verify question show their expertise in commits, release notes, and maintainer roles, not in headlines.

So search for the work, matched to the question:

- **Cooldown or install-gate behavior:** contributors to pnpm, uv, or npm/cli who worked on minimum release age features.
- **What a correct attestation should look like:** maintainers of top-1000 PyPI packages who publish with Trusted Publishing and PEP 740 attestations.
- **Whether a name is a known hallucination:** security researchers who have published on package hallucination or slopsquatting.
- **Intake policy, or a hire to own it:** engineering managers at US fintechs who own dependency intake or software supply chain policy.

A headline search cannot find these people, because their headlines rarely mention the work. [Refolk](/) takes each of these as a plain-English ask and searches GitHub, LinkedIn, and the open web for the evidence behind it, so the results are people whose work matches the question, whatever their titles say.

I ran this search: `Engineers in Germany who maintain OWASP Dependency-Track or CycloneDX tooling` - [see the full result list](https://www.refolk.ai/s/44sdfhej2n).

*Returns people matched on their maintainer and contributor work rather than headline keywords, with links to the evidence for each match.*

## Step-by-step: the fifteen-minute read

Run these eight steps in order on one dependency at a time, and fill in the record as you go. Most bad names fail by step 3, so the full budget is only spent on names that look right.

#### The agent-added dependency read

1. **Capture the claim** - Record the exact name, ecosystem, version, and the import or call site the agent wrote. Done is one line stating what the agent apparently meant the package to do.
2. **Check existence and registration age** - Read time.created on npm, or the upload time of the earliest release file on PyPI. Done is the date recorded, with a flag if the name is newer than the claimed project's public history.
3. **Look up the canonical name** - Find the upstream project's own install instruction and compare names after PEP 503 normalization. Done is the canonical name recorded as matching or not; a mismatch sends the read to Substitute or Reject.
4. **Walk the identity chain** - Follow the registry repository field to the repo, confirm its README names this exact package, then verify any attestation against a repository and workflow you pinned before looking. Done is every link agreeing, or the break written down.
5. **Check publisher history** - Compare _npmUser or the trusted publisher identity across versions. Done is one sentence on publisher continuity, with any switch from a CI publisher to a personal account flagged.
6. **Count real dependents** - Find who depends on this exact name and record the count, the named dependents, and how you obtained them. Done is a number another reviewer could reproduce by the same method.
7. **Inspect install-time behavior** - Run npm view on the package's scripts, then npm pack the version and diff -rq it against the tagged commit. Done is a list of lifecycle hooks and of files present only in the tarball.
8. **Record the verdict** - Apply the verdict rules in order (Substitute, Reject, Verify, Install) and write the verdict with evidence links. Done is a record a second reviewer can replay to the same verdict.

The time budget per step is about 1, 1, 3, 3, 2, 2, 3 to 5, and 1 minute. That adds up to 16 to 18 minutes if every step runs to the end. Fifteen is realistic because the read stops early on most bad names: a name that does not exist, or one that does not match the canonical install line, is decided by step 3.

Step 5 has a real case behind it. In the axios case, the publisher changed from GitHub Actions to a personal account. That switch is exactly what a D3 Red looks like.

Published audits disagree on order. One ten-minute audit runs metadata, then scripts, then the tarball. Another leads with the tarball and puts that check at about four minutes. Tim Schipper argues that checking existence first creates false comfort. I keep existence first because it is the cheapest exit, but I treat a pass there as worth nothing on its own (see failure mode 1 below).

> **Tip:** Exit at step 3 when the names differ
>
> If the upstream install line names a different package, stop, score D5 Red, and start a fresh read on the canonical name. Finishing steps 4 to 7 on the agent's name only documents a package you are not going to install.

**Verdict record for one agent-added dependency**

```
DEPENDENCY READ: <ecosystem> <name>@<version>    PR: <link>
Agent intent: <one line: what the agent meant this package to do>
Call site: <file:line of the import or call>

D1 Name age       first published: <date>   upstream history starts: <date>          score: _
D5 Canonical      upstream install line: <quote + link>   normalized match: yes/no   score: _
D2 Identity       registry repository: <url>   README names this package: yes/no
                  attestation repo + workflow: <value>   pinned expected: <value>
                  pinned check: pass / fail / no attestation                          score: _
D3 Publisher      publisher by version: <list>   continuity: yes/no, reason: <text>  score: _
D4 Dependents     count: <n>   named: <list>   method: <how obtained>                 score: _
D6 Install-time   hooks (npm view <pkg> scripts): <list or none>
                  tarball-only files (npm pack + diff -rq vs tag): <list or none>
                  matching tag found: yes/no                                          score: _

Verdict: Install / Substitute -> <canonical name> / Verify / Reject
If Verify: reviewer <name>, question: <one yes-or-no question>
Reviewer: <name>    Minutes spent: <n>
```

*Paste into the PR as a review comment; every field should hold a value or the word none, never a blank.*

## How this read goes wrong: failure modes and false positives

Most failures come from a check that passes for the wrong reason. Each control proves something narrower than it appears to. The list below gives each failure, what it looks like, and the check that catches it. The last two items are false positives, where a legitimate package looks suspicious.

1. **The existence check passes because the name was squatted.** Existence only proves that someone published. Raj and Sahu found that half the hallucinated names their pipeline flagged were already registered on PyPI. *Check:* compare the name's first-publish date with the age of the project the agent meant. A name a few weeks old that claims to be a long-established library is a D1 Red.

2. **The repository field points at a famous repo.** This is **starjacking**: a package's repository field names a well-known repo the package was not built from, to borrow its credibility. Without provenance, the field is free text the publisher typed. *Check:* the repo's README must name this exact package. If it names a different one, D2 is Red.

3. **Provenance is valid, but signed from the wrong repository.** npm verifies that the package's repository field matches the source repository in the signing certificate. So a squatter who builds from their own repo or a fork gets a valid badge, and a starjacked field cannot carry one. `npm audit signatures` passes either way, because it does not compare the signer with any expected identity. A documented attack pattern describes a valid attestation whose repository is `attacker/axios` instead of `axios/axios`. I have not found a public, named incident of this exact case, so treat it as a known pattern rather than a recorded attack. *Check:* pin the expected repository and enforce it with `--repository` or an identity regexp.

> A squatted name ages past any cooldown, and only a pinned repository turns a green badge into identity evidence.

4. **Provenance names the right repository, and the code was still swapped.** In the TanStack worm, the attested identity matched the real `release.yml@refs/heads/main` while the code underneath had been replaced. A correct signer does not mean the artifact is correct. *Check:* run the tarball diff against the tag and list the lifecycle hooks, whatever the attestation says.

5. **The repository looks clean because the attack never touched it.** In the case Red Canary documented, the repo's last legitimate commit came about ten weeks before the malicious npm versions, and the repo was never modified. keyv@6.0.0 added a preinstall script and two payload files while every file under `dist/` stayed byte-identical to the clean release candidate. @ctrl/deluge@7.2.2 added `"postinstall": "node bundle.js"` with code that is not in the upstream GitHub source. *Check:* audit the tarball, not the repo. The repo is the wrong artifact to inspect.

6. **The cooldown is satisfied.** A release-age cooldown measures how old a version is. A squatter registers the name once and waits, and with 43% of hallucinations recurring, they can register well before any agent suggests the name. *Check:* compare the name's age with the canonical project's age, not the version's age.

7. **The cooldown is configured but does nothing.** npm versions before 11.10 silently ignore `min-release-age`, and older uv versions drop the whole `[tool.uv]` block. The config file looks protected and nothing is enforced. *Check:* confirm `npm -v` is at least 11.10.0, and confirm the installed uv version reads the block you wrote.

8. **False positive: no matching tag.** Many legitimate packages do not keep tags in step with releases, so a missing tag is not evidence of tampering. *Check:* score D6 Yellow and send it to Verify, not Reject. The reviewer finds the commit the release was built from and reruns the diff.

9. **False positive: `_npmUser` changes under staged publishing.** When publishing is staged, `_npmUser` may name the approver rather than the original publish method, which can look like a publisher switch. *Check:* score D3 Yellow with the reason written down, and keep Red for unexplained switches like the CI-to-personal-account change in the axios case.

## What release-age cooldowns and package firewalls cover

Release-age cooldowns and package firewalls hold back versions that are too new. They do not check whether a name is new, so they protect against compromised releases of real packages, not against squatted names. Keep them, and do not count them as part of this read.

| Tool | Setting (unit) | Since | Default |
|---|---|---|---|
| npm | `min-release-age` (days) | 11.10.0 | None |
| pnpm | `minimumReleaseAge` (minutes) | 10.16 | 1440 from v11 |
| uv | `exclude-newer` (duration) | 0.9.17 | None |
| GitHub package firewall | Minimum package age (1 to 365 days) | Preview, npm only | 1 day |

> **Watch out:** A cooldown does not age-check the name
>
> Every control in this table gates how old a version is. A name squatted weeks before an agent suggests it passes all of them, and the firewall's own coverage notes that a release which escapes detection can simply outlast the cooldown.

Mechanism details that change what you can rely on:

- **pnpm counts in minutes.** 1440 is one day. Check the unit before copying a value from another tool.
- **uv checks the cutoff against file upload time, and Git dependencies are not gated.** An agent that writes a Git URL instead of a package name bypasses the cooldown completely.
- **The GitHub package firewall setting of 0 disables the age check.** The firewall is Enterprise Cloud only and npm only. It also blocks newly introduced install scripts and attestation downgrades, which covers part of D6 at install time, but only on npm.
- **The exclusion setting's arrival is disputed.** Sources disagree on when `min-release-age-exclude` arrived: npm 11.17.0 according to some, npm 12 according to another. Check the release notes for the npm version you actually run before you depend on it.

These are version numbers and defaults, and they move. Re-check them against each tool's documentation when you upgrade, rather than relying on this table.

## Keeping the read current

The read stays useful if the team keeps three things up to date: a log of names already rejected or substituted, a pinned expected repository for each dependency, and the tool versions that make cooldowns real. Hallucinated names recur, so the log pays off quickly. The same invented name tends to come back in the next agent session.

- **Name log.** For every Substitute or Reject, record the agent's name, the canonical name, and the date. When a name comes back, the read is already done.
- **Pinned repositories.** Store the expected repository and workflow next to each dependency, so that step 4 checks against a value written in calm conditions, not one copied from the package under review.
- **Tool versions.** Re-check `npm -v`, the uv version, and the firewall settings whenever the toolchain changes, because an inert cooldown looks the same as a working one.
- **Reviewer bench.** Keep the names of two or three outside people who can settle a Verify question, found by their work. Refolk reruns the same plain-English search when one of them moves on.

#### Before you call the read done

- [ ] The agent's exact name, ecosystem, version, and call site are in the record.
- [ ] The name's first-publish date and the upstream project's history start date are both written down.
- [ ] The canonical name is quoted from the upstream project's own install instruction, with a link.
- [ ] Any attestation was checked against a repository pinned before looking, or is recorded as absent.
- [ ] Publisher continuity across versions is stated, and any switch has a written reason.
- [ ] Lifecycle hooks and tarball-only files are listed, or recorded as none.
- [ ] The verdict follows the rule order: Substitute, then Reject, then Verify, then Install.
- [ ] For Substitute, the canonical package has its own completed read attached.
- [ ] For Verify, a named reviewer has one yes-or-no question in writing.
- [ ] Rejected and substituted agent names are added to the team's name log.

## Frequently asked questions

### How do I verify a package suggested by an AI coding agent?

Start from the upstream project, not the registry. Find the project's own install instruction, compare its package name to the agent's after normalization, then confirm that the registry entry's repository, the repo README, and any attestation all point at the same project. Finish by listing lifecycle hooks and diffing the tarball against the tagged source. If the names differ, substitute the canonical name and run the checks again on it.

### Is checking that the package exists enough to catch slopsquatting?

No. Existence only proves that someone published under that name, and squatters publish. One research pipeline found that half the hallucinated names it flagged were already registered on PyPI. Compare the name's first-publish date with the age of the project the agent meant: a name a few weeks old that claims to be an established library is a reject signal, not a pass.

### Does a valid npm provenance badge prove the package is legitimate?

It proves less than it looks like it does. npm checks that the package's repository field matches the repository in the signing certificate, so a squatter building from their own repo or a fork still gets a valid badge, and npm audit signatures passes. Provenance becomes identity evidence only when you check the signer against a repository you pinned in advance, for example with cosign's certificate identity regexp.

### Will a minimum release age setting protect me from hallucinated package names?

Not on its own. npm's min-release-age, pnpm's minimumReleaseAge, uv's exclude-newer, and the GitHub package firewall's minimum age all gate how old a version is, not how old the name is. A name registered weeks before an agent suggests it clears every one of them. Keep the cooldown for compromised releases of real packages, and check name age against the canonical project separately.

### Is a PyPI package suspicious if it has no attestations?

Not by itself. PEP 740 attestations are optional, and when they launched only 18 of the 360 most-downloaded PyPI packages had them. pip and uv do not reject unattested packages by default. Score a missing attestation Yellow on the identity chain, then lean harder on the README, publisher history, and tarball diff. A present attestation still has to be checked against the expected repository.

### What should I do when the repository has no tag matching the release?

Treat it as a yellow flag that sends the dependency to Verify, not as grounds to reject. Many legitimate packages do not keep tags in lockstep with releases. Ask the second reviewer to find the commit the release was built from, then rerun the tarball diff against it. Reject only if hooks or files show up in the tarball that exist nowhere in the source.

---

*From the Refolk guide library. I revise these guides rather than replacing them, so the current version is always at https://www.refolk.ai/guides/agent-added-dependency-read*
