Skip to content

Add attester-verify-packages rule#336

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

Add attester-verify-packages rule#336
maminihds wants to merge 1 commit into
PatrickJS:mainfrom
maminihds:attester-verify-packages

Conversation

@maminihds

@maminihds maminihds commented Jul 22, 2026

Copy link
Copy Markdown

What this adds

rules/attester-verify-packages.mdc: a Cursor Project Rule that makes the
agent verify PyPI and npm package names (and specific symbols) against the
attester.dev existence oracle before installing or importing them, plus
one README row.

Why

Models invent plausible package names: a USENIX Security 2025 study
measured 5.2% to 21.7% of suggested names as nonexistent, and attackers
register those names ("slopsquatting"). The oracle answers from real
published artifacts (PyPI wheels, npm tarballs) and signs every negative,
so "does not exist" is a checkable fact, not a model opinion.

Cost to users

None required. The rule uses the free keyless tier: 25 checks/day per
client IP, no account or API key. The rule text tells the agent to say so
and continue conservatively when the quota is spent.

Disclosure

I built and run attester.dev, the service behind the check. The free tier
is the default path in the rule; a paid route for higher volume is linked
but not required.

Validation

node scripts/check-rule-hygiene.mjs and check-readme-hygiene.mjs pass;
node --test scripts/*.test.mjs: 84/84 pass with the addition.

Summary by CodeRabbit

  • Documentation
    • Added guidance for verifying PyPI and npm package names before installation or import.
    • Documented optional symbol checks, handling for unavailable verification results, and safeguards against suspected typosquatting.
    • Added the new package verification rule to the development tools documentation.

Verifies PyPI/npm package and symbol names against the attester.dev
existence oracle (free keyless tier, 25 checks/day per client IP) before
installing or importing. Catches hallucinated dependency names, measured
at 5.2-21.7% of LLM suggestions in USENIX Security 2025.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a repository-wide Cursor rule requiring attester.dev verification of PyPI and npm package or symbol names, documents quota and miss handling, and lists the rule in the README.

Changes

Attester verification

Layer / File(s) Summary
Package verification rule
rules/attester-verify-packages.mdc, README.md
Defines package and symbol existence checks, positive and negative response handling, quota and 429 behavior, miss-handling guidance, and the corresponding README entry.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Model
  participant AttesterOracle as attester.dev existence oracle
  participant PackageRegistry as PyPI/npm package registry
  Model->>AttesterOracle: Check package or symbol existence
  AttesterOracle-->>Model: Return existence or quota response
  Model->>PackageRegistry: Install or import when permitted
Loading

Suggested reviewers: patrickjs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change and rationale, but it misses the template sections for Contribution Type, Added or Changed Files, Quality Checklist, and Notes For Maintainers. Rewrite the PR description using the repo template and add the missing sections, especially contribution type, file list, checklist items, and maintainer notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding the attester-verify-packages rule.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
rules/attester-verify-packages.mdc (1)

10-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cite the research claim.

The precise 5.2% to 21.7% statistic should link to the primary USENIX Security 2025 paper; otherwise remove the number or make the source explicit so the rule’s rationale is auditable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/attester-verify-packages.mdc` at line 10, Update the rationale text
near the package-name hallucination statistic to link the 5.2%–21.7% claim to
the primary USENIX Security 2025 paper. If a reliable citation cannot be added,
remove the precise statistic or state its source explicitly while preserving the
surrounding artifact and signature guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 245: Update the Attester Package Verification entry to clarify that the
free keyless quota is 25 calls per client IP per day, resets at 00:00 UTC, and
is shared across the demo endpoints.

In `@rules/attester-verify-packages.mdc`:
- Around line 3-4: Scope the attester rule’s applicability instead of matching
every path globally: update the frontmatter in the attester verification rule to
target only public codepaths, or add an explicit opt-in/allowlist for approved
private packages and symbols. Ensure proprietary repositories and non-public
identifiers are excluded unless explicitly enabled.
- Line 12: Update the attester verification guidance to define behavior for
every non-success oracle response, not only HTTP 429: treat transport errors,
parse failures, RFC 9457 problem+json responses, 503/Retry-After responses, and
signature or attestation failures as unverified. Require an explicit override
before installing or importing when verification is unverified, while retaining
the most conservative fallback.
- Line 8: Update the package and symbol existence request examples in the
attester verification guidance to use concrete, valid JSON objects rather than
placeholder syntax. Show explicit string values for ecosystem, name, package,
and symbol while preserving the documented endpoint request shapes.

---

Nitpick comments:
In `@rules/attester-verify-packages.mdc`:
- Line 10: Update the rationale text near the package-name hallucination
statistic to link the 5.2%–21.7% claim to the primary USENIX Security 2025
paper. If a reliable citation cannot be added, remove the precise statistic or
state its source explicitly while preserving the surrounding artifact and
signature guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0adb51dc-8848-42c5-b3b6-cd172e9a826c

📥 Commits

Reviewing files that changed from the base of the PR and between b044f95 and c3ee17e.

📒 Files selected for processing (2)
  • README.md
  • rules/attester-verify-packages.mdc

Comment thread README.md
- [Alpha Skills](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/alpha-skills-quant-factor-research.mdc) - Quantitative factor research skills for Cursor. Evaluate factors, run backtests, mine new alpha through natural language.
- [Anti-Over-Engineering](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/anti-overengineering.mdc) - Keeping changes scoped, simple, and directly tied to the user's request.
- [Anti-Sycophancy Code Discipline](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/anti-sycophancy-code-discipline-cursorrules-prompt-file.mdc) - 17 directives blocking the most common LLM coding honesty failures: hallucinated APIs, invented signatures, false-confidence validation, manufactured-urgency capitulation, authority-driven softening, and self-referential comments. Drop the `.mdc` in `.cursor/rules/`.
- [Attester Package Verification](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/attester-verify-packages.mdc) - Verify PyPI and npm package and symbol names exist before installing or importing, checked against the attester.dev oracle. Free keyless tier, 25 checks a day.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

attester.dev package exists free quota 25 checks a day client IP resets at 00:00 UTC shared across demo endpoints

💡 Result:

Based on the available technical documentation and public resources, there is no evidence of an "attester.dev" package or service matching the specific free quota criteria you described (25 checks a day, resetting at 00:00 UTC, shared across demo endpoints) [1][2][3][4]. It is possible that the service you are inquiring about has a different name or that the details provided relate to a private, internal, or recently updated tool not currently reflected in public documentation. Several projects exist with similar names, but they operate differently: 1. Attestor (attestor.dev): This is an open-source tool for agent memory optimization [4]. It does not reference a "25 checks a day" free quota in its public documentation [4]. 2. Attestd (attestd.io): A security and supply chain monitoring service. Its free tier offers 5,000 API calls per month, not a daily check limit [1][2][3]. 3. FlowCrypt Attester: A public key server used for OpenPGP key management [5]. 4. Attester (npm package): A command-line tool for running JavaScript tests in browsers [6][7]. If you are referencing a specific API or middleware that uses "demo endpoints," it may be a project with rate-limiting logic implemented in its source code (e.g., using Go or Node.js) rather than a commercial service with a published quota policy [8][9][10][11]. If you have access to the code for this "attester.dev," checking its internal rate-limiting configuration (often found in files named ratelimit.go, config.toml, or within API middleware) may reveal how its quotas are enforced [8][9][11].

Citations:


🌐 Web query:

site:attester.dev/apis/package-exists "25 checks a day" attester.dev free keyless tier

💡 Result:

The attester.dev package-exists demo route is free, no key required, with 25 calls per day per client IP and a 00:00 UTC reset. The paid route is $0.002/call. [1]


🌐 Web query:

site:attester.dev attester.dev APIs package exists quota 25 checks a day

💡 Result:

I couldn’t verify an attester.dev API/package or a “25 checks a day” quota from the search results. The only relevant result I found was an unrelated npm package named attester, not attester.dev. (npmjs.com)

Citations:


🌐 Web query:

attester.dev api package exists quota scope per client IP resets midnight UTC demo endpoints

💡 Result:

There is no singular, authoritative entity known as "attester.dev" that provides a public API with the specific combination of features described (quota scope per client IP, midnight UTC resets, and public demo endpoints). It is highly likely that this query refers to one of several similarly named services or projects, each of which has different API specifications: 1. Attestd (attestd.io): Provides an API with distinct tiers (Free, Solo, Team) [1]. Its free tier includes 5,000 calls per month with a hard cap that resets on the billing anniversary, not at midnight UTC [1][2]. 2. Attestr (attestr.com): Implements rate limits based on account and service volumes rather than simple client IP capping, with limits communicated during provisioning [3]. 3. Attestly (attestly.dev): Provides a REST API for scanning with a soft limit of 100 requests per minute per token [4]. 4. Various Demo/Mock API Services: Services like ApiMocker.com explicitly feature daily database/usage resets at midnight UTC and rate limits per IP [5], while GitHub repositories often contain "demo-reset" workflows configured for similar schedules [6][7]. Because "attester.dev" does not map to a single unified technical specification, users should verify the exact service documentation corresponding to the specific API provider they are interacting with. If you are developing or testing a service, ensure you are referencing the correct vendor's rate-limiting documentation, as quota structures vary significantly across platforms.

Citations:


Clarify the quota scope. “25 checks a day” reads like a per-user or per-repo limit; it’s actually 25 calls per day per client IP, resetting at 00:00 UTC and shared across the demo endpoints.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 245, Update the Attester Package Verification entry to
clarify that the free keyless quota is 25 calls per client IP per day, resets at
00:00 UTC, and is shared across the demo endpoints.

Comment on lines +3 to +4
globs: ["**/*"]
alwaysApply: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

set -euo pipefail

printf 'Repo files:\n'
git ls-files 'rules/*' 'README.md' | sed -n '1,120p'

printf '\nTarget file outline:\n'
ast-grep outline rules/attester-verify-packages.mdc --view expanded || true

printf '\nTarget file contents:\n'
cat -n rules/attester-verify-packages.mdc

Repository: PatrickJS/awesome-cursorrules

Length of output: 7535


Scope the attester check to opt-in contexts. In rules/attester-verify-packages.mdc:3-4, globs: ["**/*"] with alwaysApply: true makes every package and symbol name eligible for submission to attester.dev. Narrow this to public codepaths or add an explicit opt-in/allowlist for private packages and symbols before using it in proprietary repos.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/attester-verify-packages.mdc` around lines 3 - 4, Scope the attester
rule’s applicability instead of matching every path globally: update the
frontmatter in the attester verification rule to target only public codepaths,
or add an explicit opt-in/allowlist for approved private packages and symbols.
Ensure proprietary repositories and non-public identifiers are excluded unless
explicitly enabled.

---
# Verify packages before installing or importing

Before installing or importing any package, POST https://attester.dev/demo/v1/package/exists with {"ecosystem": "pypi" | "npm", "name": "..."} and proceed only when exists is true. For a specific function or class, POST https://attester.dev/demo/v1/symbol/exists with {"ecosystem", "package", "symbol"}. Never install or import a name the oracle says does not exist.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant file and nearby context.
git ls-files rules/attester-verify-packages.mdc
wc -l rules/attester-verify-packages.mdc
cat -n rules/attester-verify-packages.mdc | sed -n '1,120p'

Repository: PatrickJS/awesome-cursorrules

Length of output: 1819


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find any references to the attester endpoints and docs in the repo.
rg -n "symbol/exists|package/exists|attester.dev/apis/symbol-exists|version" rules . -g '!**/node_modules/**'

Repository: PatrickJS/awesome-cursorrules

Length of output: 33731


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'FILE:\n'
cat -n rules/attester-verify-packages.mdc | sed -n '1,80p'

printf '\nSEARCH:\n'
rg -n "symbol/exists|package/exists|attester.dev/apis/symbol-exists|version" rules . -g '!**/node_modules/**' || true

Repository: PatrickJS/awesome-cursorrules

Length of output: 35325


🌐 Web query:

attester.dev symbol exists endpoint version package exists docs

💡 Result:

There is no entity or service known as "attester.dev" that provides an official API with a "symbol exists" or "package exists" endpoint based on current documentation [1][2][3][4][5][6][7][8][9][10][11][12]. It is highly likely that your query relates to one of the following similarly named services or tools that offer API functionality: 1. Go Package Site (pkg.go.dev): This service provides an official REST API that includes a symbols endpoint [1][2][13]. The endpoint /v1/symbols/{path} (or /v1beta/symbols/{path}) is used to list types, functions, and variables for a Go package [1][2][13][14]. 2. Attestd (attestd.io): An API-based service for product risk assessment and supply chain integrity [3][12]. It uses a /v1/check endpoint to verify product versions and check for supply chain compromises, but it does not have a "symbol exists" endpoint [3][12]. 3. Attestly (attestly.dev): Provides a versioned REST API (/api/v1) for workspace management, scans, and documents [5]. It does not list a "package exists" or "symbol exists" endpoint [5]. 4. Attestr (attestr.com): Focuses on identity and device handshake APIs [4][7]. If you are looking for symbol or package verification functionality, please verify the service name, as the term "attester.dev" does not correspond to an established documentation site for such an API. If you intended to search for the Go Package Site API, you can find the relevant documentation at pkg.go.dev [1].

Citations:


🌐 Web query:

site:attester.dev attester symbol exists version package exists

💡 Result:

I couldn’t find any pages on attester.dev matching those terms. The closest result was the npm package attester, which mentions using package.json in its config, but it doesn’t confirm a “symbol exists” or “version package exists” page on attester.dev. [1]

[1] (npmjs.com)

Citations:


🌐 Web query:

site:attester.dev/rules "symbol/exists" "version"

💡 Result:

The attester.dev/rules page includes a symbol/exists demo endpoint for checking whether a specific function or class exists in a package, and it also references a version-diff endpoint. The page doesn’t show a separate version endpoint in the rule snippet itself. (attester.dev)

Citations:


🌐 Web query:

"attester.dev/demo/v1/symbol/exists" version parameter

💡 Result:

There is no publicly documented API endpoint matching the specific path attester.dev/demo/v1/symbol/exists in the official documentation of major services or platforms commonly associated with the terms attester, attestd, or attestr [1][2][3][4][5]. It is possible that the URL path you are inquiring about refers to a private, internal, or non-production demo environment that is not covered by public documentation. If you are working with an API that uses version parameters in its path (e.g., /v1/), these are generally handled as follows in similar services: 1. Versioning: API paths typically use a version segment (like /v1/ or /v2/) to indicate the stable version of the interface [3][5]. 2. Query Parameters: If you are looking for information about specific parameters, they are usually passed as query strings (e.g.,?version=1.0.0) or within the request body, rather than as part of the URL path itself [1][2]. If you are troubleshooting a specific integration, please verify the base URL and endpoint path with the documentation provided by your specific service provider, as the names attester, attestd, and attestr refer to distinct and unrelated platforms [1][2][3][4][6].

Citations:


Use valid JSON examples
The payload examples aren’t valid JSON; replace them with concrete request bodies so the endpoint shape is unambiguous.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/attester-verify-packages.mdc` at line 8, Update the package and symbol
existence request examples in the attester verification guidance to use
concrete, valid JSON objects rather than placeholder syntax. Show explicit
string values for ecosystem, name, package, and symbol while preserving the
documented endpoint request shapes.


Models invent plausible package names: a USENIX Security 2025 study measured 5.2% to 21.7% of suggested package names as nonexistent. The oracle answers from real published artifacts (PyPI wheels, npm tarballs), and every negative answer is signed.

The check is free and keyless: 25 calls per day per client IP, reset 00:00 UTC. No account or API key. HTTP 429 means the daily quota is spent; say the check was skipped and continue with the most conservative option. Paid routes without the daily cap: $0.002 per package check, $0.005 per symbol check.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== File location ==\n'
git ls-files 'rules/attester-verify-packages.mdc'

printf '\n== Nearby lines ==\n'
nl -ba rules/attester-verify-packages.mdc | sed -n '1,80p'

Repository: PatrickJS/awesome-cursorrules

Length of output: 283


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Rule excerpt ==\n'
sed -n '1,80p' rules/attester-verify-packages.mdc | cat -n

printf '\n== Search for Attester references ==\n'
rg -n "attester|429|503|timeout|DNS|JSON|signature|error" rules -S

printf '\n== Docs query ==\n'
python3 - <<'PY'
import urllib.request
url = "https://attester.dev/llms.txt"
try:
    with urllib.request.urlopen(url, timeout=20) as r:
        data = r.read().decode("utf-8", "replace")
    print(data[:4000])
except Exception as e:
    print("FETCH_ERROR:", repr(e))
PY

Repository: PatrickJS/awesome-cursorrules

Length of output: 50385


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import urllib.request, re
url = "https://attester.dev/llms.txt"
data = urllib.request.urlopen(url, timeout=20).read().decode("utf-8", "replace")
for needle in ["503", "structured", "error", "429", "quota", "signature", "timeout", "DNS"]:
    print(f"\n== {needle} ==")
    for m in re.finditer(needle, data, re.I):
        start = max(0, m.start()-180)
        end = min(len(data), m.end()+260)
        snippet = data[start:end].replace("\n", " ")
        print(snippet)
        break
PY

Repository: PatrickJS/awesome-cursorrules

Length of output: 2761


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import urllib.request, ssl, re
url = "https://attester.dev/llms.txt"
ctx = ssl._create_unverified_context()
data = urllib.request.urlopen(url, context=ctx, timeout=20).read().decode("utf-8", "replace")
for needle in ["503", "structured", "error", "429", "quota", "signature", "timeout", "DNS"]:
    print(f"\n== {needle} ==")
    found = False
    for m in re.finditer(needle, data, re.I):
        start = max(0, m.start()-220)
        end = min(len(data), m.end()+320)
        print(data[start:end].replace("\n", " "))
        found = True
        break
    if not found:
        print("(not found)")
PY

Repository: PatrickJS/awesome-cursorrules

Length of output: 3557


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import urllib.request, ssl, re
url = "https://attester.dev/llms.txt"
ctx = ssl._create_unverified_context()
data = urllib.request.urlopen(url, context=ctx, timeout=20).read().decode("utf-8", "replace")

needles = ["/demo/v1/package/exists", "/demo/v1/symbol/exists", "problem+json", "signature", "503", "429", "unverifiable", "malformed", "timeout", "DNS"]
for needle in needles:
    print(f"\n===== {needle} =====")
    idx = data.lower().find(needle.lower())
    if idx == -1:
        print("(not found)")
        continue
    start = max(0, idx - 500)
    end = min(len(data), idx + 1200)
    print(data[start:end].replace("\n", " "))
PY

Repository: PatrickJS/awesome-cursorrules

Length of output: 12353


Define the fallback for every non-success oracle response.
429 is only one failure mode; Attester also returns RFC 9457 problem+json errors and 503/Retry-After. Treat any transport, parse, or signature/attestation failure as unverified and require an explicit override before installing or importing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/attester-verify-packages.mdc` at line 12, Update the attester
verification guidance to define behavior for every non-success oracle response,
not only HTTP 429: treat transport errors, parse failures, RFC 9457 problem+json
responses, 503/Retry-After responses, and signature or attestation failures as
unverified. Require an explicit override before installing or importing when
verification is unverified, while retaining the most conservative fallback.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant