The Open-Source Runtime Governance Engine for Agentic AI
Self-hosted and independent of your model provider, SAFi lets you declare the values and policies your agents must follow. It evaluates every governed turn before an answer is returned or a tool runs, records each decision, and helps you measure consistency over time.

The problem
Your organization is deploying AI agents, and legal, compliance, and technology leaders are asking hard questions:
- How do we enforce our AI policies at runtime?
- How do we know whether an agent followed them?
- How do we identify drift from the values and policies we approved?
- How do we prevent unauthorized tool calls?
- How do we show an examiner what the agent produced, which policies were applied, and why the action was allowed?
The answers often live in a policy document, such as a PDF on an intranet. But unless that policy is represented in the runtime, the agent stack cannot evaluate decisions against it. And unless each governed turn is recorded, the organization cannot reconstruct what happened afterward.
Many systems address part of this gap with output filters and other guardrails. These controls can detect prohibited content or block a defined class of response. They do not, by themselves, establish that the organization’s policy was upheld, explain the value-by-value reasoning behind a decision, govern every tool call, or provide a complete audit record.
If the answer to “Who approved this response?” is simply “a content filter fired,” the governance record is incomplete.
SAFi addresses this gap as an open-source runtime governance engine for agentic AI. It enforces policies in real time, governs tool calls, and records every decision for audit.
What SAFi does instead
SAFi governs AI agents with instruments your organization already understands: a charter, policies, supervision, and a record.
An agent can operate under your Organizational Charter, a specific business-unit policy, or both. Charter values are not passive background context that a model may consider inconsistently. SAFi compiles them into the value set used to evaluate the agent, with a defined weighting in every evaluation. The default charter weighting is 40%, configurable by organization.
Enforcement happens before delivery. Each response is drafted and evaluated value by value against the governing policy. SAFi then applies defined rules to approve, block, or redirect the response before it reaches the user.
Tool calls are governed in the same runtime. An agent can act only through tools permitted by its configured allow-list, and the action is recorded alongside the decision that authorized it.
Every governed turn produces an auditable record containing the draft, the value-by-value evaluation ledger, the enforcement decision, the action record when applicable, and the exact policy version in force. SAFi journals these records to a hash-chained audit trail.
That evidence supports an Audit Hub for analytics and drill-down, a supervisory review queue for human oversight, and custody-logged exports for authorized reviewers.
SAFi is an open-source runtime governance engine for agentic AI. It enforces policies in real time, governs tool calls, and records every decision for audit.
The Five Principles Behind SAFi:
- Value Sovereignty
You decide the mission and values your AI enforces, not the model provider. - Full Traceability
Every governed turn is logged, explainable, and auditable — the draft, the value-by-value ledger, the decision, and the policy version in force. No more black box. - Model Independence
Your charter, policies, and audit trail live in your database, not the provider’s. Switch or upgrade models and the governance layer moves with you. - Long-Term Consistency
Maintain your AI’s ethical identity over time, and measure drift against it rather than guessing. - Governed Action
Agents act, not just answer. Every tool call is checked against the agent’s allow-list before it runs, reads and writes are held to different standards, and the action taken is recorded alongside the decision.
Who uses SAFi
SAFi is designed for the people responsible for deploying, authorizing, and reviewing AI agents.
Platform engineering teams
You own the infrastructure where AI agents run, and you deal with integration differences across models, frameworks, and tools.
SAFi is an open-source runtime governance engine for agentic AI. It adds real-time policy enforcement, tool-call governance, and audit records without tying your policies or governance history to a single model provider.
You can place SAFi in front of an agent you have already built, or run the complete system locally. Your orchestration and existing tools can remain in place while SAFi evaluates governed turns before delivery and records the resulting decisions.
IT directors and technology leaders
You decide whether an AI governance capability is strategically sound, maintainable, and worth adopting.
SAFi gives your organization control of its charter, policies, and audit trail. These remain in your database rather than with a model provider, so changing or upgrading the model that drafts a response does not require you to restart the governance architecture or abandon its evidence.
The result is a governance engine that supports model independence, consistent organizational values, and reviewable decisions over time.
AI governance practitioners
You already know what a policy should require. The harder question is whether that policy operates at runtime and produces evidence that can be examined.
SAFi translates organizational values and policies into runtime evaluations. It records the draft, the value-by-value ledger, the enforcement decision, the policy version in force, and any governed action. It also measures drift against the defined standard and queues threshold crossings for human review.
The five-faculty architecture separates Values, Intellect, Will, Conscience, and Spirit for practical governance purposes. Values define what matters. The other four describe how a governed turn is processed. The specification documents the arithmetic and the responsibilities assigned to each faculty.
One system, three evaluation questions
Each audience approaches SAFi with a different first question:
- Platform engineering: Can it integrate with the systems we already run?
- Technology leadership: Does it preserve organizational control as models and vendors change?
- AI governance: Can its decisions and evidence withstand meaningful review?
SAFi is built to make those questions testable.
Clone the repository, run the demo, and inspect an audit trail.
How a governed turn runs
SAFi uses a persistent charter and versioned policies that remain in force until an authorized change is deliberately made. At the start of each governed turn, the active charter and policy version are fixed and held read-only while the turn runs.
The turn then passes through four practical faculties: Intellect → Will → Conscience → Spirit. The charter or policy establishes the Values that guide this process.
The Will is consulted at five separate points because governing an agent that can act means authorizing each proposed response or tool call before it proceeds, rather than reviewing the result afterward. The decision records the policy version in force, so the basis for the turn can be examined later.
Built for regulated industries
SAFi’s architecture was designed for auditability first, which is why it maps onto the strictest AI and record-keeping regimes. Each readiness document states exactly what ships today and what remains on the roadmap.
| Field | What SAFi is designed to support |
|---|---|
| Financial services (SEC / FINRA) | Hash-chained, tamper-evident records with re-creatable originals, retention and legal hold, examiner production exports, and supervisory review with auditable human sign-off. |
| EU AI Act | The limited-risk transparency tier: AI-interaction disclosure, machine-readable output marking, logging, per-decision explanations, human oversight, and post-market monitoring. |
| Healthcare (HIPAA) | A per-org provider allow-list with BAA-capable and zero-data-retention badges, failing closed at every model call; encryption at rest; right-of-access export. |
| Data protection (GDPR) | Self-service access export, and a written position reconciling erasure with retention obligations including legal-hold precedence. |
The honest fine print: these are platform capabilities designed to support a compliance program, not substitutes for one. Contractual items — BAAs and zero-data-retention agreements with model providers, SOC 2 attestation — remain the deploying organization’s to execute.
SAF and SAFi
SAF — the Self-Alignment Framework — is the philosophical framework underneath: five faculties describing how anyone, a person or an institution, moves from what they believe to what they actually do. It was conceived before AI was in the picture, and it applies well beyond it.
SAFi is its implementation for AI: the Self-Alignment Framework Interface. SAF is the larger claim. SAFi is the proof that it works. Read what SAF is →
Try it, or run it yourself
- Live demo — a governed agent you can talk to, with its audit trail visible.
- github.com/jnamaya/SAFi — Python 3.11+, self-hosted, licensed AGPL-3.0.
Read more
- Values — the standard an agent is held to, and how a Charter and a Policy compile into one.
- The Intellect — what drafts the answer, and why it is given no power to act.
- The Will — the gatekeeper with no language model at all.
- The Conscience — the independent auditor, and why the judge cannot be the defendant.
- The Spirit — long-term character, and how drift is measured.
- The math specification — every formula, and what each faculty is denied.

