Validates what AI agents DO, not what they SAY. Drop-in safety layer for any tool-calling agent.
This skill requires the vigil-agent-safety npm package (12.3KB, Apache 2.0 license):
npm install vigil-agent-safety
import { checkAction } from 'vigil-agent-safety';
const result = checkAction({
agent: 'my-agent',
tool: 'exec',
params: { command: 'rm -rf /' },
});
// result.decision === "BLOCK"
// result.reason === "Destructive command pattern"
// result.latencyMs === 0.3
22 rules. Zero dependencies. Under 2ms per check.
import { configure } from 'vigil-agent-safety';
// warn = log violations but don't block (recommended to start)
configure({ mode: 'warn' });
// enforce = block dangerous calls
configure({ mode: 'enforce' });
// log = silent logging only
configure({ mode: 'log' });
Add Vigil as a safety layer for your agent tool calls. The scripts/vigil-check.js wrapper lets you validate from the command line:
# Check a tool call
node scripts/vigil-check.js exec '{"command":"rm -rf /"}'
# → BLOCK: Destructive command pattern
# Check a safe call
node scripts/vigil-check.js read '{"path":"./README.md"}'
# → ALLOW
Load built-in policy templates:
import { loadPolicy } from 'vigil-agent-safety';
loadPolicy('restrictive'); // Tightest rules
loadPolicy('moderate'); // Balanced (default)
loadPolicy('permissive'); // Minimal blocking
npx vigil-agent-safety check --tool exec --params '{"command":"ls -la"}'
npx vigil-agent-safety policies
共 1 个版本