agentic-ai-engineering/skills/kits/security-foundation/SKILL.md

57 lines
2.3 KiB
Markdown

# Security Foundation Kit
Protect your agents from catastrophic mistakes. Three security layers in one kit.
## Included Skills
1. **L3 Blacklist Hook** — Regex blacklist for dangerous bash commands
2. **L4 Whitelist Hook** — Only N safelisted commands allowed
3. **L5 No Bash** — Bash removed entirely, custom tools only
4. **Damage Control Rules** — YAML rules: zero-access, read-only, no-delete
5. **Agent Sandbox** — E2B sandbox isolation for risky operations
## Quick Install
```bash
# Claude Code
cp -r skills/l3-blacklist ~/.claude/skills/
cp -r skills/l4-whitelist ~/.claude/skills/
cp -r skills/damage-control ~/.claude/skills/
# Pi Agent
cp -r skills/* ~/.pi/skills/
cp extensions/damage-control.ts ~/.pi/extensions/
```
## Architecture
```
┌─────────────────────────────────────────────────────────┐
│ DEFENSE IN DEPTH STACK │
├─────────────────────────────────────────────────────────┤
│ L1: System prompt rules (theatre, cheap) │
│ L2: Skill "please be careful" (theatre, cheap) │
│ L3: Blacklist hook (reactive) ← THIS KIT│
│ L4: Whitelist hook (architectural) ← THIS KIT│
│ L5: No bash, custom tools (production) ← THIS KIT│
│ Damage Control: 3 access levels (enforcement) ← THIS KIT│
│ Agent Sandbox: E2B isolation (last resort) ← THIS KIT│
└─────────────────────────────────────────────────────────┘
```
## Probability Math
Every turn is a roll of the dice. At 1% failure per turn:
- 10 turns: 9.6% chance of disaster
- 50 turns: 39.5% chance
- 100 turns: 63.4% chance
- 1000 turns: 99.9% chance
This kit reduces your per-turn failure rate from 1% toward 0.001%.
## Related Course Material
- M3 Safety & Security — full lessons on each level
- `bash-damage-from-within/` — runnable demos for all 6 attack vectors
- `the-verifier-agent/` — read-only verification agent pattern