For those of us building autonomous agents, the biggest headache isn't model performanceβ€”it's control. SAFi, a new open-source runtime governance tool, aims to solve this by treating AI agents like domain-controlled users rather than wild-west scripts. The project, hosted on GitHub, introduces a client-server architecture that enforces written policies in real time, sandboxing every tool call with OS-level mechanisms like Linux bubblewrap and macOS sandbox-exec.

Architecture: The Domain Controller Analogy

SAFi’s core philosophy is best understood through its own documentation: it acts as a domain controller for AI agents. The central server holds accounts, groups, and policies, while the agents run as thin clients in your terminal. This setup ensures that no agent can write outside its project workspace by default. Home directories, runtime sockets, and credential stores are hidden from all agents, except for the Sysadmin agent, which retains read-only host inspection access. This isolation prevents an errant agent from accidentally nuking your local environment or leaking secrets.

The Four Pillars of Runtime Governance

The system relies on four pillars: Controlled Execution, Model Independence, Built-In Threat Defense, and a Complete Audit Trail. Controlled Execution means the AI can only propose actions; they must pass policy rules and approvals before running. Model Independence ensures that your governance rules stay intact even if you swap from OpenAI to a local llama.cpp instance. Built-In Threat Defense screens prompts for injections and sensitive data exposure, while the audit trail uses a hash-chained log to provide tamper-evident proof of every decision. This architecture is formalized in a 'SAFi Math Specification,' appealing to those of us who want rigor, not just vibes.

Compliance and Sensitive Data Controls

SAFi isn't just for hobbyists; it’s designed with regulatory readiness in mind, mapping capabilities to frameworks like the EU AI Act, HIPAA, and SEC/FINRA standards. For sensitive data, it implements deterministic checks for payment cards (Luhn mod 10), IBANs (ISO 13616 mod-97), and US SSNs. These checks are off by default but can be enabled per identifier, blocking sensitive data from reaching the model. The system also enforces strict role-based access control (RBAC) with a deliberate separation of duties: editors can author agents but cannot perform supervisory review, a nod to financial compliance requirements like FINRA 3110.

Key Takeaways

  • SAFi uses OS-level sandboxing (bubblewrap/sandbox-exec) to isolate AI agents from the host system.
  • Governance is enforced via a client-server model where policies are immutable charters applied centrally.
  • The tool supports local and cloud LLMs, with a 'Model Independence' pillar that decouples governance from the underlying AI provider.
  • Compliance features include hash-chained audit logs and deterministic sensitive data detection (Luhn, ISO 13616, etc.).
  • Released under AGPL-3.0 with a Section 7 exception that keeps organizational policies and data private.

The Bottom Line

SAFi feels like the missing layer for enterprise-grade agent deployment. If you're tired of praying your agent doesn't rm -rf / or leak API keys, this OS-level governance model is the serious tooling we've been waiting for.