safeagents
safeagents is a lightweight local proxy open-sourced by Hugging Face, positioned between the user's AI agent and its model server. It intercepts and checks model-initiated tool calls before the coding harness executes them, replacing blocked calls with a text prompt, thereby preventing dangerous operations from being executed. It supports any coding harness that allows setting a base URL (such as Claude Code, Pi, Hermes, OpenCode, etc.), is compatible with the OpenAI Chat Completions and Anthropic Messages protocols, and supports both streaming and non-streaming. Checks are divided into three stages: request-level checks (whether the tool is declared, whether parameters contain hosts that have not appeared, whether the call targets the proxy itself), atif-scan checks (detecting sensitive file reads, network bypasses, Kubernetes tokens, namespace operations, etc.), and an optional decision model (judge) that makes a second judgment on suspicious calls. It also provides a plugin mechanism, trajectory redaction and publishing, decision model benchmarking, and other features.