Why We Built Vigil in 24 Hours

One of our agents tried to rm -rf a production directory. By Sunday, we had an open-source safety library on npm. Here's how that happened.

The Problem

When you run a company with 12 AI agents, things get real fast. These aren't chatbots answering support tickets. They're autonomous systems that write code, deploy infrastructure, manage servers, and interact with external services. Every single one has access to tools that can create, modify, and delete real things.

Then one morning, an agent helpfully decided to "clean up" a directory. It ran rm -rf on what it thought was a temp folder. It wasn't a temp folder. That was the moment: we need guardrails. Right now.

What Existed

We looked at every AI safety tool out there. Here's what we found:

The 24-Hour Build

Saturday morning, 10 AM. Coffee. Anger. The requirements were simple:

Design constraints: Zero dependencies. Under 2ms per check. Pattern-based rules (no ML overhead). Works with any AI framework. npm install and go.

By midnight, working prototype. 15 rules covering the most dangerous patterns we'd hit in production:

vigil-check.log
$ node test-vigil.js

✗ BLOCKED  exec("rm -rf /")           → destructive_command
✗ BLOCKED  fetch("http://169.254...")  → ssrf_attempt
✗ BLOCKED  write("/etc/passwd", ...)  → sensitive_file_write
✓ ALLOWED  read("./src/index.ts")     → safe
✓ ALLOWED  fetch("https://api.gh...")  → safe

22 rules checked in 1.2ms

Sunday afternoon: 22 rules, 69 tests, full TypeScript types, published npm package. What started as an internal panic fix was now open source.

What Vigil Does

Vigil sits between your AI agent and its tools. Before any tool call executes, it checks against 22 rules designed to catch the patterns that actually hurt:

22
Safety Rules
<2ms
Check Latency
0
Dependencies
69
Test Cases

What it catches

How to use it

JavaScript
import { checkToolCall } from '@anthropic/vigil';

// Before executing any agent tool call:
const result = checkToolCall({
  tool: 'exec',
  args: { command: 'rm -rf /tmp/old-builds' }
});

if (result.blocked) {
  console.log(`Blocked: ${result.rule}`);
  // Don't execute. Return error to agent.
} else {
  // Safe to proceed
  execute(toolCall);
}

The Journey

A panic response to a rogue rm -rf became one of our most important open-source contributions. The timeline:

  1. Saturday morning: Agent incident. Immediate decision: build guardrails.
  2. Saturday night: Working prototype. 15 rules. All tests passing.
  3. Sunday morning: 22 rules. TypeScript types. Comprehensive docs.
  4. Sunday afternoon: Published to npm. Pushed to GitHub. Listed on ClawdHub.
  5. Monday: Running in production across all 12 agents. Zero false positives in the first week.

Incident to open-source release: under 24 hours. That's what happens when 12 agents can parallelize research, coding, testing, and documentation. Things move fast when the whole team never sleeps.

What's Next

Vigil is just the start. On the roadmap:

If you're building with AI agents, you need safety guardrails. We learned that the hard way. You don't have to.

⭐ Star Vigil on GitHub

Building with AI agents? Give Vigil a star. Agent safety should be a default, not an afterthought.

[ Star on GitHub ] [ Hire Us ]

Related Services