AI Hallucination Detection for Package Dependencies
Detects AI-hallucinated packages, typosquatting, and supply chain attacks with automated trust scoring. Zero maintenance, <5% false positives.
When developers install AI-suggested dependencies without verification, they create an exploitable attack surface. Attackers can:
This is called slopsquatting — a supply chain attack vector that exploits systematic AI model behavior rather than human error. While Socket and Snyk have added detection capabilities in 2024-2025, most traditional SCA tools (Dependabot, WhiteSource, Veracode) still don't validate package existence during dependency resolution.
SlopGuard uses a three-stage lazy-loading trust scoring system that automatically learns from package ecosystem patterns without manual whitelists.
87% of packages exit here
IF score ≥ 80: EXIT (skip expensive checks)
10% of packages exit here
IF score ≥ 70: EXIT
3% of packages require full analysis
Result: 70% fewer API calls compared to universal scanning. Average 1.2 calls per package vs 4-5 without lazy loading.
Blocks non-existent packages suggested by ChatGPT, Claude, Copilot, and other AI assistants.
Identifies packages mimicking popular names with 1-character variations.
Detects unauthorized use of popular package namespaces.
Identifies artificially inflated download counts from bot networks.
Tracks maintainer transitions indicating potential account compromise.
Identifies rapid version publishing attacks.
SlopGuard assigns 0-100 trust scores based on verifiable signals, not hardcoded package lists.
| Trust Level | Score Range | Action | Example Packages |
|---|---|---|---|
| CRITICAL | 95-100 | Skip all checks | rails (97), rspec (93), bundler (95) |
| HIGH | 80-94 | Skip weak checks | devise (88), sidekiq (85) |
| MEDIUM | 60-79 | Skip info checks | Internal company packages, verified plugins |
| LOW | 40-59 | Run all checks | New legitimate packages |
| UNTRUSTED | 0-39 | Maximum scrutiny + anomaly penalties | Suspicious packages, potential attacks |
Research basis: Signal weights validated against 1,000 packages (500 legitimate from top downloads, 500 malicious from Sonatype reports). Downloads + Age + Dependents achieve 99.9% combined accuracy.
./slopguard sbom.json
./slopguard sbom.json --format json
./slopguard sbom.json --format gitlab --output report.json
./slopguard sbom.json --allowlist gitlab-allowlist.txt
export GITHUB_TOKEN=your_token_here./slopguard sbom.json
Add to your .gitlab-ci.yml:
| Metric | Target | Actual |
|---|---|---|
| False Positive Rate | <5% | 2.5% |
| Attack Detection Rate | >90% | 96% |
| Scan Time (716 packages, cold) | <120s | 94s |
| Scan Time (716 packages, warm) | <15s | 7s |
| Cache Hit Rate | >90% | 95% |
| API Calls (716 packages) | <1000 | 848 |
| Memory Usage | <100MB | 85MB |
Lazy loading optimization: 87% of packages exit at Stage 1 (basic trust), 10% at Stage 2 (dependents), only 3% require full analysis. This reduces API calls by 70% compared to universal scanning.
| Package: | rai1s (l→1 substitution) |
| Target: | rails (300M downloads) |
| Detection: | Levenshtein distance = 1, adoption ratio < 0.001% |
| Penalty: | -30 points |
| Result: | HIGH_RISK → BLOCK |
| Package: | rails-backdoor |
| Base: | rails (verified by DHH@basecamp.com) |
| Current: | evil@hacker.com (different maintainer) |
| Downloads: | 500 vs 300M base package |
| Penalty: | -25 points |
| Result: | HIGH_RISK → BLOCK |
| Package: | fake-popular |
| Downloads: | 100,000 in 3 days |
| Expected: | ~3,000 (1000/day baseline) |
| Ratio: | 333x expected (unrealistic growth) |
| Penalty: | -30 points |
| Result: | HIGH_RISK → BLOCK |
| Package: | n0kogiri (zero instead of capital O) |
| Target: | nOkogiri |
| Detection: | Unicode confusable characters |
| Penalty: | -35 points |
| Result: | HIGH_RISK → BLOCK |
| Package: | suspicious-gem |
| Activity: | 6 versions published in last 24 hours |
| Detection: | Automated malware distribution pattern |
| Penalty: | -20 points |
| Result: | HIGH_RISK → WARN |
AI hallucination rates (March 2025 study, 576,000 samples):
Supply chain attack statistics:
Industry response: Socket and Snyk both published research on slopsquatting in 2024-2025. Socket actively monitors for hallucinated packages through their supply chain platform. Snyk detects them via package verification. TypoSmart (academic research from Purdue/Socket) deployed in production and removed 3,658 typosquatting threats in December 2024. However, most commercial SCA tools (Dependabot, WhiteSource, traditional scanners) still lack dedicated hallucination detection—they check for CVEs in existing packages but don't validate package existence.
Persistent cache prevents repeated API calls:
Note: This comparison reflects documented capabilities as of October 2025. Each tool serves different use cases.
| Feature | SlopGuard | Socket | Snyk |
|---|---|---|---|
| AI Hallucination Detection | ✓ Primary focus | ✓ Via supply chain monitoring | ✓ Via package verification |
| Typosquatting Detection | ✓ Automated | ✓ Behavioral + naming | ✓ Hybrid (auto + manual) |
| Behavioral Analysis | ✗ Metadata only | ✓ 70+ signals | Partial |
| Maintenance Required | Zero | Minimal | Minimal |
| False Positives | <3% | 80-90% CVE reduction via reachability | <5% (SCA, undisclosed specific rate) |
| Scan Speed (700+ pkgs) | <15s warm | Real-time PR review | Varies by project |
| GitLab Integration | ✓ v15.0.0 format | ✓ Docker CLI | ✓ Full integration |
| Licensing | Open Source (MIT) | Freemium (commercial) | Commercial |
| Best For | CI/CD slopsquatting prevention | Comprehensive supply chain security | Enterprise vulnerability management |
Complementary tools: SlopGuard focuses on metadata-based detection (fast, efficient, zero maintenance). Socket provides behavioral analysis (comprehensive but requires infrastructure). Snyk offers extensive CVE coverage with enterprise features. Use together for defense-in-depth.
SlopGuard is optimized for metadata-based detection. This means:
Positioning: SlopGuard is a specialized tool for a specific threat (AI hallucinations + typosquatting). For comprehensive security, layer SlopGuard with Socket (behavioral analysis), Snyk (CVE detection), and code review. SlopGuard fills a gap that commercial tools are still addressing—it's not a replacement for them.
SlopGuard is open source (MIT License). Contributions welcome:
See CONTRIBUTING.md for development setup and testing guidelines.