Skip to content

Add attester package-verification instruction and import-check hook 🤖🤖🤖#2387

Open
maminihds wants to merge 1 commit into
github:mainfrom
maminihds:attester-verify-packages
Open

Add attester package-verification instruction and import-check hook 🤖🤖🤖#2387
maminihds wants to merge 1 commit into
github:mainfrom
maminihds:attester-verify-packages

Conversation

@maminihds

Copy link
Copy Markdown

What this adds

Two entries for the same gap, a failure mode models cannot self-check:
hallucinated package names.

  1. instructions/attester-verify-packages.instructions.md: tells
    Copilot to verify PyPI/npm package and symbol names against the
    attester.dev existence oracle before installing or importing.
  2. hooks/attester-import-check/: a preToolUse hook that enforces
    the same check on code the coding agent writes. Stdlib-only Python
    (3.10+, no dependencies), executable, documented in its README.

Why

A USENIX Security 2025 study measured 5.2% to 21.7% of LLM-suggested
package names as nonexistent. Attackers register those names
("slopsquatting"). Retrieval tools cannot answer "does this name exist at
all"; the oracle answers from real published artifacts (PyPI wheels, npm
tarballs) and signs every negative.

Cost to users

None required. The instruction and hook use the free keyless tier: 25
calls/day per client IP, no account or API key. The hook caches answers on
disk (exists 30 days, negatives 1 day) so routine editing rarely spends
quota, and it fails open with a warning when the quota or the network is
gone: it can never block a session on infrastructure trouble.

Disclosure

I built and run attester.dev, the service behind the check. The free tier
is the default path in both artifacts; a paid route for higher volume
exists and is mentioned in one line at the end of the instruction. Happy
to trim that mention further if it conflicts with the paid-services
guidance in discussions/968.

Tested

  • npm start regenerates the README tables cleanly (hook row +
    instruction row present).
  • Hook against the live free tier: fake PyPI and npm names blocked
    (exit 1), real names allowed (exit 0), malformed input allowed (exit 0).

The instruction tells Copilot to verify PyPI/npm package and symbol names
against the attester.dev existence oracle (free keyless tier, 25 calls/day
per client IP) before installing or importing, catching hallucinated
dependency names (5.2-21.7% of LLM suggestions per USENIX Security 2025).
The preToolUse hook enforces the same check on code the agent writes:
stdlib-only script, blocks only on a confident oracle negative, fails open
on quota or network trouble, caches answers on disk. README tables
regenerated with npm start.
@maminihds
maminihds requested a review from aaronpowell as a code owner July 22, 2026 05:24
@github-actions github-actions Bot added hooks PR touches hooks instructions PR touches instructions new-submission PR adds at least one new contribution labels Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Contributor Reputation Check: MEDIUM risk

Check Risk
Profile MEDIUM
Credential audit NONE

Maintainers: please review this contributor before merging.
See the workflow run for full details.
Automated check powered by AGT.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 6 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 0
ℹ️ Info 0

✅ No matching risk patterns were detected in changed files.

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hooks PR touches hooks instructions PR touches instructions needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk new-submission PR adds at least one new contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant