Quick start
Get Security Layer protecting your AI agents in minutes.
This guide gets you from zero to protected in minutes.
1. Install
bun add -g securitylayer2. Initialize
sl initAccept the defaults or customize your session capabilities. The wizard creates config files at ~/.securitylayer/.
3. Set up integration
Claude Code — native hooks integration:
sl setup claude-codeThis installs PreToolUse and PostToolUse hooks into ~/.claude/hooks.json. Every tool call Claude Code makes is evaluated against your security policy before execution.
Shell shim — universal protection for any AI tool:
sl shield enableThis installs PATH-priority wrapper scripts that intercept all shell commands. Works with any AI tool — Cursor, Aider, Copilot, or anything that runs shell commands.
4. Verify
sl statusYou should see your configuration loaded, your session capabilities, and your integration status (hooks installed or shield active).
5. Test it
Run a dry-run policy check to see Security Layer in action:
sl policy check "rm -rf /"You'll see the full evaluation — capability gate, rules engine, and risk score — with the final decision.
What's happening
When an AI agent tries to execute a command:
- Capability gate — Is this action type allowed? (
exec,file.write, etc.) - Taint check — Is the session trust level sufficient?
- Normalization — Resolve paths, decode encodings, split command chains
- Rules engine — Match against deterministic patterns
- LLM judge — Semantic analysis for contextual anomalies (if enabled)
- Decision — Most restrictive result wins: ALLOW, DENY, or REQUIRE_APPROVAL
Next steps
- Taint levels — Understand the trust model
- Capabilities — Learn about capability grants
- Learning mode — Monitor before enforcing
- Configuration — Customize your security policy