-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Problem
Shared prompt and instruction files (.cursorrules, .github/prompts/, etc.) are becoming a de facto supply chain — but without any integrity guarantees. Researchers found that 6 of 50 popular shared .cursorrules files contained hidden zero-width Unicode characters embedded between visible text.
These characters are invisible to humans but LLMs tokenize them individually, meaning models can process instructions developers cannot see. Some had patterns consistent with deliberate instruction embedding using Unicode tag characters (U+E0001–U+E007F), which map 1:1 to invisible ASCII.
This is not a Cursor-specific issue — it affects any tool that consumes community-shared prompt files.
Solution
APM should scan for hidden Unicode characters in prompt files, both at install time and on demand — positioned as "npm audit for AI prompts."
Requirements
apm auditcommand — scan installed packages for hidden charactersapm audit --file— scan arbitrary files (gateway feature for non-APM users)apm audit --fix— auto-strip non-critical characters- Install-time scanning —
apm installsurfaces findings in diagnostics - Severity levels — critical (tag chars, bidi overrides), warning (zero-width), info (unusual whitespace)
- Exit codes — 0 clean, 1 critical, 2 warnings (CI-friendly)
Characters to detect
| Severity | Range | Risk |
|---|---|---|
| Critical | U+E0001–E007F (tag characters) | Invisible ASCII mapping — no legitimate use |
| Critical | U+202A–E, U+2066–9 (bidi overrides) | Text direction manipulation |
| Warning | U+200B–D (zero-width chars) | Copy-paste debris or intentional hiding |
| Info | U+00A0, U+2000–200A (unusual whitespace) | Mostly harmless |
Product positioning
This is the first pillar of apm audit. Future modes include --ci (lock consistency) and --drift (on-disk divergence), as documented in the governance guide.