Source Code
HiveFence v1.0.0
๐ When one is attacked, all become immune.
Collective prompt injection defense network for AI agents.
What is HiveFence?
HiveFence extends prompt-guard with a distributed immunity system:
- Detect โ Your agent scans incoming prompts against 15+ attack patterns
- Report โ New attack patterns are hashed and submitted to the network
- Immunize โ Community validates the pattern, then every connected agent gets the update
Features
- ๐ Real-time Detection โ Pattern matching + semantic analysis in <50ms
- ๐ Multi-language โ EN, KO, JA, ZH attack detection
- ๐ณ๏ธ Community Governance โ Democratic voting on new patterns
- ๐ Privacy-preserving โ Only SHA-256 hashes shared, not raw content
- ๐ Severity Scoring โ Risk-based prioritization (0-100)
- โก Edge-first โ Cloudflare Workers at 300+ locations
Installation
# Via ClawdHub
npx clawhub install hivefence
# Or via npm
npm install hivefence
Quick Start
import { protect, reportThreat } from 'hivefence'
// Scan incoming prompt
const result = await protect(userInput)
if (result.blocked) {
console.log(`Threat blocked: ${result.category}`)
// Pattern automatically reported to network
}
Security Stack Recommendation
For maximum protection, use HiveFence with:
- ACIP โ Advanced Cognitive Inoculation Prompt (behavioral boundaries)
- HiveFence โ Pattern detection + collective immunity
- SkillGuard โ Audit skills before installation
As recommended in @VittoStack's Security Guide (34K+ views)
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/threats/report |
Submit new threat pattern |
| GET | /api/v1/threats/pending |
Get patterns awaiting votes |
| POST | /api/v1/threats/:id/vote |
Vote on a pattern |
| GET | /api/v1/threats/latest |
Fetch approved patterns |
| GET | /api/v1/stats |
Network statistics |
Base URL: https://hivefence-api.seojoon-kim.workers.dev
Why HiveFence?
Without protection:
- 91% injection attack success rate
- 84% data extraction success rate
- System prompts leaked on turn 1
(Source: ZeroLeaks Security Assessment)
With HiveFence:
- Real-time pattern blocking
- Collective immunity from the network
- Community-validated patterns (zero false positives)
Links
- Website: https://hivefence.com
- GitHub: https://github.com/seojoonkim/hivefence
- API Docs: https://hivefence.com/docs
License
MIT ยฉ 2026 Simon Kim (@seojoonkim)