Open-source SAFi gateway classifies agent tool calls into R0-R4 risk tiers
forevergeeks · reddit · 2026-12-06
A Reddit post introduces SAFi, an open-source governance gateway that classifies every proposed agent tool call into a risk class before execution. Core thesis: risk is a property of the action, not the model.
The five classes
- R0: read-only inspection (grep, ls, git status) — always allowed
- R1: reversible local modifications (writes, git commit/push, builds)
- R2: destructive local actions (rm, truncation, sysadmin config writes) — where most damage happens
- R3: external actions (sendemail, webhooks, API calls), detected by prefix
- R4: always hard-blocked (secrets, mkfs, curl | bash), regardless of policy ceiling
Implementation details: classification is deterministic pattern matching done pre-execution with no model judgment; compound commands are split and classified per segment; each agent policy sets a maxtoolriskclass ceiling; forbidden-path and payload checks run first.
The scheme composes well — an engineering agent runs at R3 while an intern-facing research agent is capped at R0 — and every decision is logged for audit. Limitation: pattern matching is conservative, so unknown commands default to R1. Repo: github.com/RunSAFi/SAFi
Related event: Open-source SAFi gateway rates agent tool calls on five risk levels(2 posts)→
More from coding & agent
- KiCad MCP Pro: open-source MCP server turns AI agents into KiCad PCB design assistants — Promptmethus · 2026-12-06
- Open-source skill turns manga images into clean vector strokes with AI judging only line quality — Promptmethus · 2026-12-06
- Andrew Ng open-sources OpenWorker: a local desktop AI coworker with 21.1k GitHub stars — songguoxiansen · 2026-12-06
- Anything raised $19.5M at $100M valuation, shuts down 15 months later as vibe coding gets brutal — thisiskp_ · 2026-12-06
- Generating Log footage with AI, then color grading it with Claude — TinfoilTricorn · 2026-12-06
- $15 ToF sensor + Claude Code gives Android phones Apple's $1,199 LiDAR scanning — TinfoilTricorn · 2026-12-06