Authensor's core packages (the policy engine, Aegis, and Sentinel) have zero runtime dependencies. This is a deliberate design choice, not an accident. For safety-critical code, every dependency is a risk.
Every dependency is an attack surface. A compromised dependency can inject malicious code into your safety layer. The 2024 xz backdoor and numerous npm supply chain attacks demonstrate that dependency compromise is a real threat.
When your safety layer has zero dependencies, the only code that runs is code you can audit. There is no transitive dependency tree to worry about. No node_modules directory full of unknown code.
Dependencies can introduce bugs, change behavior in minor versions, or become unmaintained. If your safety layer depends on a library that introduces a bug, your safety layer breaks.
With zero dependencies, the only code that can break is your own code. You control every line.
Zero-dependency code runs anywhere that has a JavaScript runtime. No native modules, no platform-specific builds, no compatibility issues. The policy engine runs in Node.js, Deno, Bun, Cloudflare Workers, and any other JavaScript runtime.
pnpm add @authensor/aegis installs one package. There is no dependency resolution, no lock file updates for transitive dependencies, no version conflict resolution. Installation takes milliseconds.
The policy engine is pure TypeScript. It parses YAML policies, matches rules against tool calls, and returns decisions. No I/O, no async operations, no side effects. It uses only JavaScript built-ins.
The content scanner uses regular expressions and string operations. Pattern matching, scoring, and threat detection all run with built-in JavaScript APIs. No external NLP library, no model inference, no HTTP calls.
The behavioral monitor uses basic statistics (moving averages, cumulative sums). These algorithms are simple enough to implement without a statistics library.
Not every Authensor package is zero-dependency. The control plane uses Hono (HTTP framework) and pg (PostgreSQL client). The SDK may use a YAML parser. These packages have dependencies because they perform I/O and need specific protocol implementations.
The principle is: the safety-critical evaluation path has zero dependencies. The infrastructure layer (HTTP server, database client) can have dependencies because it is not in the critical path of safety decisions.
Zero-dependency design means reimplementing functionality that libraries provide. The YAML parser in the engine is simpler than js-yaml. The pattern matching is more basic than a full regex engine. This is acceptable because:
Explore more guides on AI agent safety, prompt injection, and building secure systems.
View All Guides