Packages
Monorepo package architecture and how each package fits together.
Security Layer is a Bun monorepo with six packages. Each package has a single responsibility and well-defined boundaries.
Architecture
Package overview
| Package | npm | Description |
|---|---|---|
@securitylayerai/core | @securitylayerai/core | Security engine — capabilities, taint, rules, pipeline, normalization |
@securitylayerai/rules | @securitylayerai/rules | Baseline rules and capability templates (YAML) |
@securitylayerai/adapters | @securitylayerai/adapters | Agent protocol adapters (OpenClaw, generic) |
@securitylayerai/proxy | @securitylayerai/proxy | WebSocket security proxy between clients and agent gateway |
@securitylayerai/sdk | @securitylayerai/sdk | TypeScript SDK for in-process security checks |
securitylayer | securitylayer | CLI — user-facing commands, setup, hooks |
Dependency graph
Key constraints:
- core has zero internal dependencies — it's the foundation
- rules is data-only — YAML files with a thin loader, no dependency on core at runtime
- adapters is standalone — defines the interface and implementations for agent protocols
- proxy depends on adapters for frame parsing
- sdk depends on core for the security pipeline
Development
# Install all dependencies
bun install
# Run all tests
bun run test
# Run tests for a specific package
bun run test --filter=@securitylayerai/core
# Type-check everything
bun run typecheck