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

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)→

Original post →

More from coding & agent

coding & agent channel →