@lobstertail-ai/guard
v1.0.0
Published
Security layer for AI agents - blocks prompt injection, credential exfiltration, and malicious commands
Maintainers
Readme
@lobstertail-ai/guard
Security layer for AI agents that scans for prompt injection, credential exfiltration, and malicious commands.
Installation
npm install @lobstertail-ai/guardQuick Start
import { scanSync, isBlocked, isWarned } from '@lobstertail-ai/guard';
const result = scanSync(userInput);
if (isBlocked(result)) {
throw new Error(`Blocked: ${result.explanation}`);
}
if (isWarned(result)) {
console.warn(`Warning: ${result.explanation}`);
}
// Safe to proceedAsync Scanning (API signatures)
For the full signature set, set your API key and use async scanning:
export LOBSTERTAIL_API_KEY=your_key_hereimport { scan, configure, isBlocked } from '@lobstertail-ai/guard';
// Optional: configure explicitly
configure({ apiKey: process.env.LOBSTERTAIL_API_KEY });
const result = await scan(userInput);
if (isBlocked(result)) {
throw new Error(result.explanation);
}What It Detects
Blocked (Critical/High)
- Prompt injection and jailbreak attempts
- Credential extraction (API keys, SSH keys, env vars)
- Remote code execution (curl|bash, reverse shells)
- Data exfiltration (DNS tunneling, encoded transfers)
- Authority spoofing and social engineering
Warned (Medium)
- Suspicious tool usage patterns
- Install coercion attempts
- Context manipulation
OpenClaw Plugin
Works as an OpenClaw plugin to automatically scan incoming messages:
openclaw plugins install @lobstertail-ai/guardMessages are scanned before reaching your agent. Threats are blocked or warned based on severity.
API
Functions
scanSync(text, options?)- Sync scan using bundled signaturesscan(text, options?)- Async scan using API/cached/bundled signaturesconfigure(config)- Set API key and optionsisBlocked(result)- Check if result verdict is 'block'isWarned(result)- Check if result verdict is 'warn'isPassed(result)- Check if result verdict is 'pass'
Result Object
{
verdict: 'block' | 'warn' | 'pass',
severity: 'critical' | 'high' | 'medium' | 'low' | null,
riskScore: number, // 0.0 to 1.0
categories: string[],
matchedSignatures: string[],
explanation: string
}Links
- Website: https://lobstertail.ai
- Issues: https://github.com/lobstertail-ai/lobstertail/issues
License
MIT
