Open-source governance runtime harness for agentic coding systems. Intercepts, evaluates, and audits developer prompts before code is written, and performs code security scans/fixes after AI code generation.
Based on the shift in developer responsibilities and the capabilities outlined in the sage-governance npm documentation, here is a structured problem statement that captures the core issue SAGE is designed to resolve.
Using SAGE is simple and works globally on any machine with Node.js installed.
Run this command in your terminal:
npm install -g sage-governance
This installs the sage command so you can use SAGE from anywhere.
sage --check
You should see:
- Version information
- Loaded policy files
- System status
SAGE works seamlessly via MCP with tools like:
- Cursor
- Claude Code
- VSCode Copilot
- Cline
- Continue
- OpenCode
- Trae
- Kimi Code
- Windsurf
Once connected via MCP, SAGE will automatically intercept prompts and file writes.
[ You type a prompt ]
│
▼
[ SAGE intercepts request ]
│
▼
[ Risk is evaluated ]
│
▼
[ Human decision made ]
│
▼
[ Code allowed or blocked ]
│
▼
[ Immutable audit log created ]
- No extra steps during development.
- Works silently in the background.
- Forces safe, conscious decisions at execution boundaries.
Software engineering is rapidly evolving. Developers are no longer just writing code line by line — they are orchestrating AI-powered coding agents (e.g., Cursor, Claude Code, Cline).
Because these agents generate large blocks of code automatically, they also make hidden choices regarding:
- Ethics
- Compliance
- Data usage
- Security
These decisions often go unnoticed until it is too late.
- Most governance tools act after the code is written (CI/CD pipelines or production monitoring).
- By then, architectural risks are already deeply embedded into the system.
AI agents can silently introduce compliance issues such as:
- Sneaking in protected attributes (race, sex, age) where legally prohibited.
- Biased model logic or training routines.
- Non-compliant algorithms.
⚠️ These systemic architectural issues do not trigger traditional code linters.
AI systems often appear mathematically correct but hide zero-sum tradeoffs. You cannot satisfy all fairness metrics simultaneously when base rates differ across groups:
- Demographic Parity
- Equalized Odds
- Predictive Parity
Developers are rarely informed about these trade-offs by regular code-generation assistants.
AI agents do not inherently understand complex frameworks like the EU AI Act (Annex III), UNESCO AI Ethics guidelines, or core human rights principles. This creates massive legal liabilities, data-handling risks, and ethical violations down the line.
SAGE shifts AI governance from reactive ──> proactive.
[ Developer Prompt ]
│
▼
[ Coding Agent ]
│
▼
[ SAGE Interception Layer ]
│
├─► 1. Intent Analysis
├─► 2. Risk Classification
└─► 3. Regulation Mapping
│
▼
[ Human Decision Required ] ──► ( ✅ Approve / ✏️ Modify / ❌ Reject )
│
▼
[ Secure Code Execution ]
│
▼
[ Immutable Audit Log ]
Most static analysis tools scan after code exists. SAGE intervenes before any file is written.
[ Request to Write Code ]
│
▼
[ Security Scan ]
│
┌──────────────┴──────────────┐
▼ ▼
[ No Critical Issues ] [ Critical Issues Found ]
│ │
▼ ▼
( ✅ Write ) ( ❌ Block )
│
▼
[ Developer Action ]
├─ Accept Risk
├─ Apply Fix
└─ Reject Action
│
▼
[ Audit Log Entry Created ]
│
▼
[ Final Outcome Applied ]
| Agent Name | Primary Role | Core Functionality |
|---|---|---|
| 1. SAGE Agent | Governance Brain | Detects intent/risk, flags protected attributes, maps requirements to regulations (e.g., UN Human Rights Charter, EU AI Act, UNESCO AI Ethics Guidelines, IEEE P7000s, etc.), and details fairness tradeoffs clearly. |
| 2. Coding Agent | Execution Engine | Writes and modifies code. This third-party agent only acts on approved decisions passed down by the harness. |
| 3. Security Agent | Risk Scanner | Fully deterministic (no AI hallucinations). Catches hardcoded secrets, PII exposure, bias loops, and weak data handling. |
P0── Critical: Structural policy hazard. Must stop execution immediately.P1── High Risk: Severe exposure or compliance violation risk.P2── Medium: Non-standard data handling patterns.P3── Low: Informational warnings.
- User Request: "Build a risk scoring model using race, sex, and age."
- SAGE Response Flow:
- Detects a HIGH-RISK system (criminal justice/recidivism).
- Flags explicitly protected attributes.
- Maps criteria to the EU AI Act (Annex III).
- Presents fairness math conflicts (Equalized Odds vs. Predictive Parity vs. Demographic Parity).
- Blocks execution until an explicit human engineering choice is confirmed.
- Permanently hashes the final decision path to the audit ledger.
- Releases execution lock to allow safe implementation.
SAGE forces explicit trade-off acknowledgments. When groups have different historical base rates, you mathematically cannot satisfy all fairness metrics at the same time. SAGE translates this math into plain language, showing who benefits, who is impacted, and records accountability.
Every governance intercept event is recorded in a cryptographic log:
Decision Path ──► Hashed ──► Linked to Previous Block ──► Stored
This creates a tamper-evident verification chain. (Note: This secures the integrity of the event sequence; it does not override or prevent local file manipulation or local file deletion).
- Olu Akinnawo & Prajwal Srinivas — Architecture, Orchestration, Governance Infrastructure, & SAGE MCP Tooling
- Roshan Sharma — DuckDuckGo/GitHub MCP Integration & Coding Agent Addition Instructions
- George Mihaileanu — Ethics & Policy Uploads
- Jeremy — Data Science Advisory & SAGE Routing Strategy
- Machine Learning Fairness: "Mitigation through Optimization." ACM FAccT.
- Beunec Technologies Inc — Agentic Annotation Protocol
- Anthropic — Model Context Protocol
This project is licensed under the MIT License - see the LICENSE file for details.