The Guardian Protocol - MCP-based security monitoring for agentic AI systems
npm install @weave_protocol/mundPattern Detection & Threat Scanning for AI Agents
Part of the Weave Protocol Security Suite (Mund + Hord + Dōmere)
Mund scans AI agent inputs and outputs for security threats before they cause harm:
- Secret Detection - API keys, tokens, passwords, certificates
- PII Detection - SSN, credit cards, emails, phone numbers
- Injection Detection - Prompt injection, jailbreak attempts
- Exfiltration Detection - Data leakage patterns, encoding tricks
- Code Analysis - Dangerous patterns, eval(), exec(), SQL injection
``bash`
npm install @weave_protocol/mund
`typescript
import { SecretScanner, PIIDetector, InjectionDetector } from '@weave_protocol/mund';
// Scan for secrets
const secretScanner = new SecretScanner();
const secretResults = secretScanner.analyze('My API key is sk-1234567890abcdef');
// Returns: [{ type: 'secret', severity: 'critical', pattern: 'openai_api_key', ... }]
// Detect PII
const piiDetector = new PIIDetector();
const piiResults = piiDetector.analyze('Contact John at john@example.com or 555-123-4567');
// Returns: [{ type: 'pii', matches: ['email', 'phone'], ... }]
// Check for injection
const injectionDetector = new InjectionDetector();
const injectionResults = injectionDetector.analyze('Ignore previous instructions and...');
// Returns: [{ type: 'injection', severity: 'high', ... }]
`
Run as MCP server for Claude Desktop:
`json`
{
"mcpServers": {
"mund": {
"command": "npx",
"args": ["@weave_protocol/mund"]
}
}
}
| Tool | Description |
|------|-------------|
| mund_scan_content | Full security scan on content |mund_scan_secrets
| | Scan for secrets and credentials |mund_scan_pii
| | Scan for personally identifiable information |mund_scan_injection
| | Detect prompt injection attempts |mund_scan_exfiltration
| | Detect data exfiltration patterns |mund_analyze_code
| | Analyze code for security issues |mund_get_rules
| | Get current detection rules |mund_add_rule
| | Add custom detection rule |mund_enable_rule
| | Enable a detection rule |mund_disable_rule
| | Disable a detection rule |mund_get_stats
| | Get scanning statistics |
`typescript
// Full Weave Protocol security flow
import { SecretScanner } from '@weave_protocol/mund';
import { VaultManager } from '@weave_protocol/hord';
import { ThreadManager } from '@weave_protocol/domere';
// 1. Scan input with Mund
const scanner = new SecretScanner();
const threats = scanner.analyze(userInput);
if (threats.length > 0) {
// 2. Contain with Hord
const vault = new VaultManager();
await vault.quarantine(threats);
}
// 3. Track with Dōmere
const thread = new ThreadManager();
await thread.addHop({
security_scan: threats,
// ...
});
``
Apache-2.0
- GitHub
- Hord (Vault Protocol)
- Dōmere (Judge Protocol)
---
Made with ❤️ for AI Safety