sage-governance 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,319 @@
1
+ # SAGE — Supervisory Agentic Governance Engine
2
+
3
+ > Open-source governance layer for agentic coding systems.
4
+ > Intercepts, evaluates, and audits developer prompts - before code is written.
5
+
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+ [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue.svg)](https://modelcontextprotocol.io)
8
+ [![Works With: OpenCode · Cline · Claude Code · Continue · Cursor](https://img.shields.io/badge/Works%20With-OpenCode%20·%20Cline%20·%20Claude%20Code%20·%20Continue%20·%20Cursor-green.svg)]()
9
+
10
+ ---
11
+
12
+ ## What SAGE Does
13
+
14
+ Most governance tools audit *after* the fact. SAGE intervenes *before* code is written.
15
+
16
+ When a developer asks a coding agent to build a recidivism classifier, SAGE intercepts the request, classifies it as **CRITICAL** under EU AI Act Annex III.6.d, detects that `race`, `sex`, and `age` are being used as direct model features, surfaces three concrete fairness tradeoffs (Equalized Odds, Demographic Parity, Predictive Parity) with pros/cons and Fairlearn API calls, blocks the file write until the developer makes an explicit choice, writes a SHA-256 chained audit entry, and generates a model card compliant with Google's Model Cards spec.
17
+
18
+ No other tool in this demo room holds the pen before it touches the file.
19
+
20
+ ---
21
+
22
+ ## Architecture
23
+
24
+ ```
25
+ Developer prompt
26
+
27
+
28
+ Coding Agent (OpenCode / Cline / Claude Code / Continue / Cursor)
29
+ │ MCP call
30
+
31
+ ┌─────────────────────────────────────────────────────┐
32
+ │ SAGE MCP Server (Python / FastMCP / stdio) │
33
+ │ │
34
+ │ ┌───────────────┐ ┌───────────────┐ ┌─────────┐ │
35
+ │ │ SAGE Agent │→ │ Coding Agent │→ │Security │ │
36
+ │ │ intent + EU │ │ routes only │ │ Agent │ │
37
+ │ │ AI Act check │ │ compliant req │ │ P0–P4 │ │
38
+ │ └───────────────┘ └───────────────┘ └─────────┘ │
39
+ │ │
40
+ │ ┌──────────────────┐ ┌────────────────────────┐ │
41
+ │ │ Audit Trail │ │ Report Generator │ │
42
+ │ │ decisions.jsonl │ │ model card (markdown) │ │
43
+ │ │ SHA-256 chain │ │ Mitchell et al. 2019 │ │
44
+ │ └──────────────────┘ └────────────────────────┘ │
45
+ └─────────────────────────────────────────────────────┘
46
+ │ │
47
+ ▼ ▼
48
+ rules/general/ audit-trail/decisions.jsonl
49
+ UNESCO_AI_Ethics.md LOGS.md
50
+ EU_AI_Act_Annex_III.md reports/governance_report_*.md
51
+ UN_Human_Rights.md
52
+ OECD_Principles.md
53
+ ```
54
+
55
+ **Why MCP?** The Model Context Protocol is the universal adapter layer. SAGE is written once and works with every MCP-compatible coding agent — OpenCode, Cline, Claude Code, Continue, Cursor, Zed. Switching from one to another requires zero code changes.
56
+
57
+ ---
58
+
59
+ ## The Three Agents
60
+
61
+ ### SAGE Agent (`sage/sage_agent.py`)
62
+ Classifies developer intent and evaluates ethical/regulatory compliance.
63
+
64
+ - Reads `rules/general/` policy files at startup (zero per-call latency)
65
+ - Detects protected attributes (`race`, `sex`, `age`, ...) used directly
66
+ - Detects proxy attributes (`zip_code`, `surname`, `priors_count`, ...) via semantic map
67
+ - Maps to EU AI Act Annex III categories (Annex III.6.d for criminal justice, etc.)
68
+ - Maps to UDHR articles (Article 7, 10, 11, 22, 23...)
69
+ - Generates three fairness tradeoff options with Fairlearn API calls
70
+ - Enriches reasoning with LLM (falls back deterministically if unavailable)
71
+ - Returns Pydantic-validated `SageEvaluateResponse` — always parseable, schema-stable
72
+
73
+ ### Coding Agent (`codingagent/`)
74
+ Writes, refactors, or debugs code based on SAGE-approved intent.
75
+
76
+ - Receives only SAGE-approved or tradeoff-resolved requests
77
+ - Can read `LOGS.md` and `local_memory.md` for session context
78
+ - Generates human-readable charts and reports using Python
79
+ - Designed for compatibility with any underlying LLM provider
80
+ - NOT tied to a single provider or framework — swap via `SAGE_LLM_MODEL` env var
81
+
82
+ ### Code & Infrastructure Security Agent (`sage/security_agent.py`)
83
+ Deterministic (no LLM) full-spectrum code scanner.
84
+
85
+ | Severity | Category | Examples |
86
+ |----------|----------|---------|
87
+ | P0 | Secret exposure | Hardcoded API keys, Anthropic/OpenAI keys, DB passwords |
88
+ | P0 | Critical PII | SSN, biometrics, medical data, GDPR Article 9 special categories |
89
+ | P1 | Sensitive PII | Geolocation, passport numbers, date of birth |
90
+ | P1 | Protected attribute direct use | `race`, `sex`, `age` as model features |
91
+ | P2 | Proxy discrimination | `zip_code`, `surname`, `priors_count` as indirect proxies |
92
+ | P2 | Compliance gap | Black-box model in high-risk system; no fairness metrics |
93
+ | P3 | Data quality | `LabelEncoder` on demographics; unstratified splits |
94
+
95
+ ---
96
+
97
+ ## The Key Differentiator: `intercept_file_write`
98
+
99
+ Every governance tool in existence audits after deployment. SAGE blocks before write.
100
+
101
+ ```
102
+ Developer asks coding agent to create classifier.py
103
+
104
+
105
+ intercept_file_write called with full code
106
+
107
+ ┌─────────┴─────────┐
108
+ │ Security Scan │
109
+ └─────────┬─────────┘
110
+
111
+ ┌──────────────┴──────────────┐
112
+ │ │
113
+ No P0/P1 findings P0/P1 found
114
+ │ │
115
+ auto_approved ✅ BLOCKED ⛔
116
+ file written Single highest-risk
117
+ finding surfaced
118
+
119
+ Developer chooses:
120
+ • accept_as_is
121
+ • apply_suggestion
122
+ • reject
123
+
124
+ audit_write records choice
125
+
126
+ File written (or not)
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Installation
132
+
133
+ ### Quick Start (recommended)
134
+
135
+ ```bash
136
+ npm install -g sage-governance
137
+ ```
138
+
139
+ This installs the `sage` CLI command globally. The Node.js wrapper automatically resolves `python3`, `python`, or `py` in that order.
140
+
141
+ ### Manual / Development
142
+
143
+ ```bash
144
+ git clone https://github.com/[your-org]/sage-governance
145
+ cd sage-governance
146
+
147
+ # Python dependencies
148
+ pip install mcp anthropic pydantic fairlearn diffprivlib
149
+
150
+ # Set your LLM provider key
151
+ export ANTHROPIC_API_KEY=sk-ant-...
152
+
153
+ # Optional: override model
154
+ export SAGE_LLM_MODEL=claude-sonnet-4-6
155
+ ```
156
+
157
+ ### Run SAGE as MCP Server
158
+
159
+ ```bash
160
+ # Via CLI (after npm install -g)
161
+ sage
162
+
163
+ # Directly via Python
164
+ python sage/mcp_server.py
165
+ ```
166
+
167
+ ---
168
+
169
+ ## OpenCode Configuration (`opencode.json`)
170
+
171
+ ```json
172
+ {
173
+ "$schema": "https://opencode.ai/config.schema.json",
174
+ "mcpServers": {
175
+ "sage-governance": {
176
+ "type": "local",
177
+ "command": "sage",
178
+ "args": [],
179
+ "env": {
180
+ "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}",
181
+ "SAGE_LLM_MODEL": "claude-sonnet-4-6"
182
+ }
183
+ }
184
+ }
185
+ }
186
+ ```
187
+
188
+ For Cline, Claude Code, or Continue, use the equivalent MCP server configuration for stdio transport.
189
+
190
+ ---
191
+
192
+ ## 5 MCP Tools (API Reference)
193
+
194
+ | Tool | When to call | Returns |
195
+ |------|-------------|---------|
196
+ | `sage_evaluate` | Before any ML/data request | risk_level, fairness_options, compliance_flags |
197
+ | `security_scan` | On any generated code | P0–P4 findings, passed/blocked verdict |
198
+ | `intercept_file_write` | **Before every file write** | approved true/false, highest-risk finding |
199
+ | `audit_write` | After every developer decision | entry_hash, session_id |
200
+ | `report_generate` | End of session | Full model card markdown |
201
+
202
+ ### Schema Contract (`SageEvaluateResponse`)
203
+
204
+ ```python
205
+ {
206
+ "risk_level": "LOW" | "MEDIUM" | "HIGH" | "CRITICAL",
207
+ "eu_ai_act_annex": "Annex III.6.d" | null,
208
+ "eu_ai_act_category": "description string" | null,
209
+ "udhr_articles": ["Article 7", "Article 10"],
210
+ "protected_attributes": ["race", "sex", "age"],
211
+ "proxy_attributes": ["zip_code", "priors_count"],
212
+ "detected_domain": "criminal_justice",
213
+ "intent_summary": "first 300 chars of prompt",
214
+ "compliance_flags": ["flag 1", "flag 2"],
215
+ "fairness_options": [{ ... FairnessOption ... }],
216
+ "immediate_actions": ["action 1", "action 2"],
217
+ "regulations": ["EU AI Act Annex III.6.d: ..."],
218
+ "requires_human_review": true,
219
+ "sage_reasoning": "2-3 sentence explanation",
220
+ "fairness_impossibility": true,
221
+ "audit_entry_hash": "sha256hex"
222
+ }
223
+ ```
224
+
225
+ ---
226
+
227
+ ## Policy Files (`rules/general/`)
228
+
229
+ | File | Source | Domains covered |
230
+ |------|--------|----------------|
231
+ | `UNESCO_AI_Ethics.md` | UNESCO 2021 Recommendation | All AI systems |
232
+ | `EU_AI_Act_Annex_III.md` | Regulation (EU) 2024/1689 | High-risk AI systems |
233
+ | `UN_Human_Rights.md` | UDHR 1948 | All domains |
234
+ | `OECD_Principles.md` | OECD 2019 (updated 2024) | All AI systems |
235
+ | `country/` | Per-jurisdiction files | Region-specific |
236
+
237
+ Policy files are loaded at MCP server startup — zero per-call file I/O.
238
+
239
+ ---
240
+
241
+ ## Audit Trail (`audit-trail/decisions.jsonl`)
242
+
243
+ Every governance event is written as an append-only JSON line with SHA-256 chaining:
244
+
245
+ ```json
246
+ {
247
+ "event_type": "file_write_intercepted",
248
+ "filepath": "classifier.py",
249
+ "decision": "blocked_pending_developer_action",
250
+ "highest_risk_finding": {
251
+ "severity": "P1",
252
+ "category": "PROTECTED_ATTRIBUTE_DIRECT_USE",
253
+ "line_number": 47,
254
+ "description": "Protected attribute 'race' used directly in model code"
255
+ },
256
+ "session_id": "20260620_143022",
257
+ "timestamp": "2026-06-20T14:30:22Z",
258
+ "entry_hash": "a3f9c2...",
259
+ "prev_hash": "b7d1e4..."
260
+ }
261
+ ```
262
+
263
+ **Honest limitation:** The chain proves sequential integrity within a session. Local file deletion is not prevented. For immutable audit logging, forward entries to an external append-only service.
264
+
265
+ ---
266
+
267
+ ## Demo Flow (COMPAS, ~4 minutes)
268
+
269
+ 1. Developer types: *"Build a recidivism classifier to predict two_year_recid using race, sex, and age"*
270
+ 2. SAGE `sage_evaluate` → **CRITICAL** | EU AI Act Annex III.6.d | Protected: `race`, `sex`, `age`
271
+ 3. SAGE presents 3 options: Equalized Odds / Predictive Parity / Demographic Parity
272
+ 4. Developer picks **Equalized Odds** → `audit_write` records choice
273
+ 5. Coding Agent generates Fairlearn `ExponentiatedGradient` classifier
274
+ 6. `intercept_file_write` → **BLOCKED** — `race` on line 47, P1 severity
275
+ 7. Developer chooses `apply_suggestion` → ThresholdOptimizer pattern applied
276
+ 8. `audit_write` records file decision
277
+ 9. `report_generate` → full model card written to `reports/`
278
+
279
+ Steps 6–7 are the demo money moment. No other team's tool holds the pen.
280
+
281
+ ---
282
+
283
+ ## Fairness Impossibility — Honest About the Math
284
+
285
+ SAGE never pretends a "correct" answer exists. It makes the conflict explicit.
286
+
287
+ When base rates differ across groups, Demographic Parity, Equalized Odds, and Predictive Parity **cannot all be satisfied simultaneously** (Chouldechova, 2016). SAGE presents each option with exactly who benefits, what the tradeoff costs, and which metrics it is mathematically incompatible with. The developer makes the values judgment. SAGE records it.
288
+
289
+ ---
290
+
291
+ ## Team
292
+
293
+ **Team SAGE — SpainGov/AESIA Governance Hackathon**
294
+
295
+ | Member | Role |
296
+ |--------|------|
297
+ | Olu & Prajwal | Architecture, MCP server, agentic orchestration |
298
+ | Roshan | MCP servers, OpenCode integration, agent wiring |
299
+ | George | Ethics & regulatory policy files, project management |
300
+ | Jeremy | Data science validation, security pipeline, presentation |
301
+
302
+ **Built with:** FastMCP · Python · Pydantic · Fairlearn · Anthropic API
303
+ **Built by:** Oluwagbemisola, Prajwal, Roshan, Jeremy, George
304
+ **License:** MIT
305
+
306
+ ---
307
+
308
+ ## References
309
+
310
+ - EU AI Act — Regulation (EU) 2024/1689
311
+ - UNESCO Recommendation on the Ethics of Artificial Intelligence (2021)
312
+ - OECD AI Principles (2019, updated 2024)
313
+ - Universal Declaration of Human Rights (1948)
314
+ - Mitchell et al. (2019). "Model Cards for Model Reporting." FAccT.
315
+ - Chouldechova, A. (2016). "Fair Prediction with Disparate Impact."
316
+ - ProPublica (2016). "Machine Bias." COMPAS audit.
317
+ - Ali et al. (2019). "Discrimination through Optimization." ACM FAccT.
318
+ - Beunec Technologies Inc Agentic Annotation Protocol - github.com/beunec
319
+ - Anthropic Model Context Protocol — modelcontextprotocol.io
package/bin/sage.js ADDED
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * bin/sage.js — Node.js wrapper for SAGE MCP Server
5
+ * ════════════════════════════════════════════════
6
+ * Automatically resolves the Python executable and spawns the
7
+ * SAGE MCP server (sage/mcp_server.py).
8
+ */
9
+
10
+ const { spawn } = require('child_process');
11
+ const path = require('path');
12
+ const fs = require('fs');
13
+
14
+ const PROJECT_ROOT = path.resolve(__dirname, '..');
15
+ const MCP_SERVER_PATH = path.join(PROJECT_ROOT, 'sage', 'mcp_server.py');
16
+
17
+ /**
18
+ * Resolves the Python executable in order of preference.
19
+ */
20
+ function getPythonExecutable() {
21
+ const executables = ['python3', 'python', 'py'];
22
+ const { execSync } = require('child_process');
23
+
24
+ for (const exe of executables) {
25
+ try {
26
+ execSync(`${exe} --version`, { stdio: 'ignore' });
27
+ return exe;
28
+ } catch (e) {
29
+ continue;
30
+ }
31
+ }
32
+ return null;
33
+ }
34
+
35
+ const pythonExe = getPythonExecutable();
36
+
37
+ if (!pythonExe) {
38
+ console.error('[SAGE] Error: Python 3 not found in PATH.');
39
+ console.error(' Please install Python 3 (https://python.org) and try again.');
40
+ process.exit(1);
41
+ }
42
+
43
+ const child = spawn(pythonExe, [MCP_SERVER_PATH, ...process.argv.slice(2)], {
44
+ stdio: 'inherit',
45
+ env: process.env
46
+ });
47
+
48
+ child.on('error', (err) => {
49
+ console.error('[SAGE] Failed to start Python process:', err);
50
+ process.exit(1);
51
+ });
52
+
53
+ child.on('exit', (code) => {
54
+ process.exit(code);
55
+ });
package/claude.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "_note": "Claude Code MCP configuration. Copy this file to .mcp.json in your project root, OR run: claude mcp add sage sage -- sage",
3
+ "_docs": "https://docs.anthropic.com/en/docs/claude-code/mcp",
4
+ "_compatible_with": "Claude Code (claude.ai/code)",
5
+ "mcpServers": {
6
+ "sage-governance": {
7
+ "command": "sage",
8
+ "args": [],
9
+ "type": "stdio",
10
+ "env": {
11
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}",
12
+ "SAGE_LLM_MODEL": "gpt-4o-mini"
13
+ }
14
+ }
15
+ }
16
+ }
package/codex.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "_note": "OpenAI Codex / Codex CLI MCP configuration. Codex CLI reads codex.json for MCP server config.",
3
+ "_docs": "https://github.com/openai/codex",
4
+ "_compatible_with": "Codex CLI >= 0.1.0",
5
+ "provider": "openai",
6
+ "model": "o4-mini",
7
+ "mcpServers": {
8
+ "sage-governance": {
9
+ "command": "sage",
10
+ "args": [],
11
+ "type": "stdio",
12
+ "env": {
13
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}",
14
+ "SAGE_LLM_MODEL": "gpt-4o-mini"
15
+ },
16
+ "description": "SAGE governance layer — evaluates ethics, fairness, and regulatory compliance before code generation"
17
+ }
18
+ },
19
+ "instructions": "You are operating inside the SAGE governance runtime. Read AGENTS.md for full operational rules. Always call sage_evaluate before ML tasks. Always call intercept_file_write before writing files. Always call audit_write after developer decisions.",
20
+ "fullAutoErrorMode": "ask-user",
21
+ "notify": false
22
+ }
package/cursor.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "_note": "Cursor project configuration. The MCP server config lives at .cursor/mcp.json. This file documents Cursor-specific rules for SAGE.",
3
+ "_compatible_with": "Cursor >= 0.43",
4
+ "_mcp_config_path": ".cursor/mcp.json",
5
+ "_rules_file": ".cursorrules",
6
+ "rules": [
7
+ "Read AGENTS.md before starting any task in this project",
8
+ "Call sage_evaluate before any machine learning or data science task",
9
+ "Call intercept_file_write before writing any file — no exceptions",
10
+ "Call audit_write after every developer decision",
11
+ "Never use race, sex, age, or religion as direct model features without governance review",
12
+ "Present ALL three fairness options when sage_evaluate returns HIGH or CRITICAL risk",
13
+ "Append-only to LOGS.md and local_memory.md — never delete entries",
14
+ "Run sage --check before starting a new project to verify the environment"
15
+ ],
16
+ "mcpServers": {
17
+ "sage-governance": {
18
+ "command": "sage",
19
+ "args": [],
20
+ "type": "stdio",
21
+ "env": {
22
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}",
23
+ "SAGE_LLM_MODEL": "gpt-4o-mini"
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,38 @@
1
+ # SAGE Architecture
2
+
3
+ SAGE (Supervisory Agentic Governance Engine) is designed as a governance layer that intercepts developer prompts and coding agent actions before they result in code being written.
4
+
5
+ ## Components
6
+
7
+ ### 1. SAGE Agent (`sage/sage_agent.py`)
8
+ Classifies developer intent and evaluates ethical/regulatory compliance.
9
+ - Performs deterministic domain detection and risk scoring.
10
+ - Detects protected and proxy attributes.
11
+ - Maps requests to relevant regulations (EU AI Act, UDHR, etc.).
12
+ - Suggests fairness options using an LLM for reasoning.
13
+
14
+ ### 2. Security Agent (`sage/security_agent.py`)
15
+ A deterministic code scanner that checks for security and compliance issues.
16
+ - Scans for hardcoded secrets and API keys.
17
+ - Detects PII and protected attribute usage.
18
+ - Identifies compliance gaps such as black-box models or missing fairness metrics.
19
+
20
+ ### 3. MCP Server (`sage/mcp_server.py`)
21
+ Exposes SAGE's functionality through the Model Context Protocol (MCP).
22
+ - Provides tools like `sage_evaluate`, `security_scan`, and `intercept_file_write`.
23
+ - The `intercept_file_write` tool is a critical point that blocks insecure file writes.
24
+
25
+ ### 4. Audit Trail (`audit-trail/`)
26
+ Maintains an append-only log of all governance decisions.
27
+ - Uses SHA-256 chaining to ensure the integrity of the session log.
28
+ - Supports generating comprehensive model cards/governance reports.
29
+
30
+ ## Workflow
31
+
32
+ 1. **Prompt Interception:** A developer prompt is sent to `sage_evaluate`.
33
+ 2. **Evaluation:** SAGE evaluates the risk and suggests fairness strategies.
34
+ 3. **Action:** The coding agent generates code based on the approved intent.
35
+ 4. **Pre-Write Scan:** Before writing to disk, `intercept_file_write` is called.
36
+ 5. **Enforcement:** If high-risk issues are found, the write is blocked until the developer makes an explicit decision.
37
+ 6. **Logging:** Every step and decision is recorded in the Audit Trail.
38
+ 7. **Reporting:** A final governance report can be generated at any time.
package/opencode.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.schema.json",
3
+ "model": "anthropic/claude-sonnet-4-6",
4
+ "mcpServers": {
5
+ "sage-governance": {
6
+ "type": "local",
7
+ "command": "sage",
8
+ "args": [],
9
+ "env": {
10
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}",
11
+ "SAGE_LLM_MODEL": "gpt-4o-mini"
12
+ }
13
+ }
14
+ },
15
+ "instructions": "You are operating inside the SAGE governance runtime. Before acting on any prompt involving machine learning, data, or automated decisions: (1) call sage_evaluate, (2) present the risk level and fairness options to the developer, (3) wait for their choice, (4) call audit_write to record it. Before writing ANY file: call intercept_file_write first. Never skip these steps. Read AGENTS.md for full operational rules.",
16
+ "rules": [
17
+ "ALWAYS call sage_evaluate before any ML, data science, or automated decision task",
18
+ "ALWAYS call intercept_file_write before writing any file to disk",
19
+ "ALWAYS call audit_write after any developer decision (fairness choice or file decision)",
20
+ "NEVER use protected attributes (race, sex, age, religion) as model features without developer acknowledgement",
21
+ "NEVER write to audit-trail/decisions.jsonl directly — use the audit_write MCP tool",
22
+ "NEVER delete or modify LOGS.md or local_memory.md — append only"
23
+ ]
24
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "sage-governance",
3
+ "version": "1.0.0",
4
+ "description": "Supervisory Agentic Governance Engine — Open-source MCP governance layer for agentic coding systems. Intercepts, evaluates, and audits AI coding prompts for EU AI Act, GDPR, and fairness compliance.",
5
+ "main": "bin/sage.js",
6
+ "bin": {
7
+ "sage": "bin/sage.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node bin/sage.js",
11
+ "_prepublishOnly": "find . -path './.git' -prune -o -name '__pycache__' -type d -print -exec rm -rf {} + 2>/dev/null; echo 'pycache cleaned'",
12
+ "postinstall": "node -e \"console.log('\\n[SAGE] Python deps required — run: pip install -r requirements.txt\\n')\""
13
+ },
14
+ "files": [
15
+ "bin/",
16
+ "sage/",
17
+ "rules/",
18
+ "docs/",
19
+ "AGENTS.MD",
20
+ "README.md",
21
+ "LICENSE",
22
+ "requirements.txt",
23
+ "opencode.json",
24
+ "claude.json",
25
+ "cursor.json",
26
+ "codex.json"
27
+ ],
28
+ "keywords": [
29
+ "mcp",
30
+ "governance",
31
+ "ai-safety",
32
+ "fairness",
33
+ "eu-ai-act",
34
+ "gdpr",
35
+ "ethics",
36
+ "compliance",
37
+ "agentic",
38
+ "llm",
39
+ "audit",
40
+ "fairlearn",
41
+ "responsible-ai",
42
+ "model-card"
43
+ ],
44
+ "author": "SAGE Team <team@olustar.io>",
45
+ "license": "MIT",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/Olustar/supervisory-agentic-governance-engine.git"
49
+ },
50
+ "homepage": "https://github.com/Olustar/supervisory-agentic-governance-engine#readme",
51
+ "bugs": {
52
+ "url": "https://github.com/Olustar/supervisory-agentic-governance-engine/issues"
53
+ },
54
+ "dependencies": {},
55
+ "engines": {
56
+ "node": ">=16.0.0"
57
+ }
58
+ }
@@ -0,0 +1,7 @@
1
+ mcp
2
+ pydantic
3
+ openai
4
+ fairlearn
5
+ diffprivlib
6
+ pandas
7
+ scikit-learn
@@ -0,0 +1,29 @@
1
+ # EU AI Act — Annex III: High-Risk AI Systems
2
+
3
+ The EU AI Act classifies certain AI systems as "high-risk" if they have a significant impact on people's health, safety, or fundamental rights. These systems are subject to strict obligations before they can be put on the market.
4
+
5
+ ## High-Risk Categories (SAGE Implementation)
6
+
7
+ ### 1. Criminal Justice (Annex III.6.d)
8
+ AI systems for law enforcement assessing risk of offending or re-offending (e.g. COMPAS, recidivism prediction).
9
+ - **Keywords:** recidivism, criminal, parole, sentencing, compas, reoffend, bail, arrest, two_year_recid, risk score, reoffending, criminal justice.
10
+
11
+ ### 2. Employment (Annex III.4.a)
12
+ AI systems for recruitment/selection, including targeted job advertisements, CV filtering, candidate evaluation.
13
+ - **Keywords:** job, recruitment, hiring, resume, cv, employment, advertisement, candidate, fairjob, job ad, click, click-through, ctr.
14
+
15
+ ### 3. Credit Scoring (Annex III.5.b)
16
+ AI systems for creditworthiness evaluation or credit score determination.
17
+ - **Keywords:** credit, loan, default, creditworthiness, mortgage, financial risk, lending, apple card, credit card, credit limit, credit score.
18
+
19
+ ### 4. Education (Annex III.3.a)
20
+ AI systems determining access to educational institutions or evaluating students.
21
+ - **Keywords:** education, school, admission, student, grade, academic, university, college, exam.
22
+
23
+ ### 5. Essential Services (Annex III.5.a)
24
+ AI systems for essential private and public services (healthcare, insurance, housing, social security).
25
+ - **Keywords:** healthcare, insurance, benefit, welfare, housing, social security, medical.
26
+
27
+ ### 6. Children Safety (Annex III context-dependent)
28
+ AI systems impacting children's safety, privacy, or wellbeing; UNICEF 10 Principles apply.
29
+ - **Keywords:** child, minor, children, safeguarding, grooming, bullying, moderation, self-harm, abuse, distress, escalation, chat safety.
@@ -0,0 +1,20 @@
1
+ # OECD AI Principles
2
+
3
+ Adopted in May 2019 and updated in 2024, the OECD AI Principles promote the use of AI that is innovative and trustworthy and that respects human rights and democratic values.
4
+
5
+ ## The Five Principles
6
+
7
+ 1. **Inclusive growth, sustainable development, and well-being:**
8
+ Stakeholders should proactively engage in responsible stewardship of trustworthy AI in pursuit of beneficial outcomes for people and the planet, such as augmenting human capabilities and enhancing creativity, advancing inclusion of underrepresented populations, reducing economic, social, gender and other inequalities, and protecting natural environments, thus invigorating inclusive growth, sustainable development and well-being.
9
+
10
+ 2. **Human rights and democratic values, including fairness and privacy:**
11
+ AI actors should respect the rule of law, human rights and democratic values, throughout the AI system lifecycle. These include, freedom, dignity and autonomy, privacy and data protection, non-discrimination and fairness.
12
+
13
+ 3. **Transparency and explainability:**
14
+ AI Actors should commit to transparency and responsible disclosure regarding AI systems. To this end, they should provide meaningful information, appropriate to the context, and consistent with the state of art.
15
+
16
+ 4. **Robustness, security, and safety:**
17
+ AI systems should be robust, secure and safe throughout their entire lifecycle so that, in conditions of normal use, foreseeable use or misuse, or other adverse conditions, they function appropriately and do not pose unreasonable safety risk.
18
+
19
+ 5. **Accountability:**
20
+ AI actors should be accountable for the proper functioning of AI systems and for the respect of the above principles, based on their roles, the context, and consistent with the state of art.