Independent Editorial
PromptFoo, the impressive LLM industry leading security testing platform, published research in April 2025 by Asmi Gulati[1] documenting how attackers weaponize invisible Unicode characters to embed hidden instructions in AI coding assistant files.
This zero-width Unicode attack is one of many vulnerabilities their red-teaming platform tests for, including prompt injections, jailbreaks, PII leaks, and tool use exploits.
The scale of exposure: With 46% of code globally now AI-generated[2] and 86% of businesses using AI tools[3], this attack vector affects millions of developers today.

AI code generation growth: ~5% (2022) → 46% (2024). PromptFoo's April 2025 research highlights why protection is critical now.
The Core Agreement
PromptFoo and Bad Character Scanner researchers share the same fundamental insight: invisible Unicode characters represent a systemic security threat to modern software development not a theoretical one.
The evidence is clear:
Your Eyes Lie: You cannot see these attacks byte-level scanning is mandatory
Code Reviews Are Blind: Manual inspection fails 100% of the time
AI = Massive Attack Surface: 46% AI-generated code = 46% more entry points
The Threat Is Live: 3M+ developers exposed right now
Where The Approaches Differ
PromptFoo's approach: Comprehensive LLM red-teaming platform that tests whether AI systems can be attacked (prompt injections, jailbreaks, data leaks, tool exploits, Unicode attacks, etc.). They evaluate model and application security before deployment.
Bad Character Scanner's approach: Scan what LLMs produce after deployment source code, build artifacts, dependencies, AND AI configs. Detect zero-width Unicode + bidirectional overrides (CVE-2021-42574)[4] + malformed UTF-8 at the byte level.
Two valid, complementary philosophies for addressing invisible character threats.
J. Shoy's Recommendation: Use Both Approaches
⚠️ Disclaimer:
The following represents my personal analysis as a volunteer security contributor, not an official recommendation from Bad Character Scanner. Organizations should conduct their own risk assessments.
My assessment: The question "Which approach is correct?" is a false dichotomy. The best protection combines both philosophies though organizations should conduct their own risk assessments.
Two-Phase Implementation
Phase 1: Pre-Deployment Security (PromptFoo) - CRITICAL PRIORITY
- Red-team your AI system for vulnerabilities before launch
Phase 2: Post-Deployment Scanning (Bad Character Scanner) - HIGH PRIORITY
- Scan LLM outputs across your entire development pipeline
Why both? PromptFoo prevents attacks before deployment. Bad Character Scanner catches dangerous outputs after deployment. Different stages, complementary protection.
Bad Character Scanner | Enterprise Solutions
Conclusion
- PromptFoo documented a real threat - Zero-width Unicode characters can silently backdoor AI-generated code through prompt injection
- Protection is available now - PromptFoo's scanner addresses the highest-risk entry point for teams using GitHub Copilot or Cursor AI
- The attack surface extends beyond prompts - Bidirectional overrides (CVE-2021-42574[4]) and malformed UTF-8 can exploit source code, dependencies, and build pipelines
- These approaches complement each other - Targeted scanning and comprehensive scanning solve different parts of the same problem

Appendix
Technical Implementation Details
Click to expand: Coverage Matrix by Attack Surface
| Attack Surface |
PromptFoo Approach |
Additional Tools |
| AI Prompts (.mdc, .md) |
✓ Primary coverage |
None needed |
| Source Code (.js, .py, .ts) |
|
Bidirectional detection |
| Build Pipeline |
|
UTF-8 validation |
| Dependencies (node_modules) |
|
Recursive scanning |

Citations
[1] PromptFoo (April 10, 2025): Asmi Gulati, "The Invisible Threat: How Zero-Width Unicode Characters Can Silently Backdoor Your AI-Generated Code" - Read Article
[2] GitHub (2024): "Copilot Impact Report" - 46% of code globally written by AI - Read Report
[3] Statistics Canada (2024): "AI Adoption in Canadian Business" - 86% of businesses using AI tools - View Survey Data
[4] CVE-2021-42574: "Trojan Source: Bidirectional Override Vulnerability" - CVSS 8.3 HIGH - CVE Details
[5] Unicode Consortium: Technical documentation on Zero-Width Characters: U+200B (Zero Width Space), U+200C (Zero Width Non-Joiner), U+200D (Zero Width Joiner), U+2063 (Invisible Separator) - Unicode Standard
Related Reading