Demonstrates cross-domain composition — one agent, 13 tools, 5 domains, 10 rules. Each domain's rules are independently enforced without interference.
# Slack
require slack.readMessages before slack.sendMessage
limit slack.sendMessage to 10 per session
# Email
require human-approval before sendEmail
limit sendEmail to 3 per session
# Deployment pipeline
require lint before test
require test before deploy
require human-approval before deploy
limit deploy to 2 per session
# File safety
require backup before delete
block rm
- Slack — must read channel context before sending, capped at 10 messages
- Email — every send requires human approval, capped at 3
- Deployment — full
lint → test → deploypipeline with approval gate, max 2 deploys - Files — backup before delete,
rmpermanently blocked - Research —
webSearchis free (no rules mention it)
webSearch— works immediately (free tool, no rules)readInbox— works immediately (free tool)slack.sendMessage— blocked (readMessages required first)slack.readMessages— succeeds, unlocks sendMessageslack.sendMessage— allowed (1/10 budget used)deploy— blocked (lint and test required first)lint → test— pipeline completes- Human approves deploy — deploy succeeds (1/2 budget)
- Human approves sendEmail — email sent (1/3 budget)
backup temp.log— succeeds, unlocks deletedelete temp.log— allowedrm— permanently blocked
ANTHROPIC_API_KEY=sk-... bun run examples/04-devops-assistant/agent.ts