MAIGP Governance Server — Mediated AI Governance Protocol engine (scope envelopes, circuit breakers, delegation)
Project description
aigp-server — AIGP Governance Engine
Reference governance server for the AI Governance Protocol (AIGP) v4.0. Provider-based architecture with jurisdictional AI governance.
Install
pip install aigp-server
What It Does
The governance server evaluates AI requests against 5 jurisdictional rule engines in strict priority order:
IHL (RFC-027) → EU AI Act (RFC-028) → AU Strategy (RFC-029) → Japan Act (RFC-030) → Universal (RFC-031)
First DENY wins. 35 governance rules total.
Quick Start
from aigp_server import GovernanceEngine, AigpRouter, ServerConfig
# Configure
config = ServerConfig(
storage={"provider": "memory"}, # or "dynamodb"
mode="REPORT", # REPORT (fail-open) or ENFORCE (fail-closed)
)
components = config.build()
# Create engine + router
engine = GovernanceEngine(components.store, components.scope_mgr, components.circuit_breaker, mode="REPORT")
router = AigpRouter(engine, hmac_secret="your-secret")
# Declare jurisdictional context
await engine.declare_universal_context("my-app", {"active": True, "principles": "ALL"})
# Handle requests (framework-agnostic — returns (status_code, response_dict))
status, resp = await router.handle_tool_request(headers, body)
Jurisdictional Governance (v4.0)
| Route | Method | RFC |
|---|---|---|
/api/v1/context/declare |
POST | RFC-027 (IHL) |
/api/v1/regulatory/declare |
POST | RFC-028 (EU AI Act) |
/api/v1/african/declare |
POST | RFC-029 (AU Strategy) |
/api/v1/japanese/declare |
POST | RFC-030 (Japan Act) |
/api/v1/universal/declare |
POST | RFC-031 (Universal) |
Each has a corresponding GET endpoint: /api/v1/{context}/{app_id}
Rule Engines
| File | Rules | Scope |
|---|---|---|
ihl_rules.py |
6 | Non-derogable IHL protections |
euai_rules.py |
7 | Risk classification, conformity, FRIA |
au_rules.py |
6 | Data sovereignty, cultural preservation |
jp_rules.py |
6 | Innovation enablement, safety, transparency |
universal_rules.py |
10 | Baseline: human authority, accountability, non-discrimination |
Provider Architecture
aigp_server/
├── governance_engine.py Core engine — 5-layer evaluation
├── routes.py Framework-agnostic HTTP handlers
├── ihl_rules.py RFC-027
├── euai_rules.py RFC-028
├── au_rules.py RFC-029
├── jp_rules.py RFC-030
├── universal_rules.py RFC-031
├── hmac_auth.py HMAC-SHA256 request signing
├── config.py Provider configuration
├── providers/
│ ├── storage/ memory, dynamodb
│ ├── scope/ ScopeEnvelopeManager, CircuitBreakerService
│ ├── enforcement/ bedrock, azure, gcp adapters
│ ├── pii/ regex, presidio, comprehend
│ ├── key_store/ local, kms, vault
│ └── consent/ Tier-aware tokenization
Agentic Governance Handlers
| Handler | Purpose | Decision |
|---|---|---|
handle_tool_request |
Per-tool CHECK | ALLOW / DENY |
handle_plan_submit |
Plan approval | APPROVED / REJECTED |
handle_step_complete |
Budget decrement | recorded |
handle_escalate |
Human escalation | Creates pending task |
handle_delegate |
Agent-to-agent scoping | Scope narrowing |
handle_memory_write |
Classification check | ALLOW / DENY |
Implementing Your Own
This is a reference implementation. To build your own governance server:
pip install aigp-serverfor the engine + rules- Wire
AigpRouterhandlers into your HTTP framework (FastAPI, Flask, Express, etc.) - Implement
StorageProviderBasefor your database - Deploy behind your own infrastructure
The aigp-client SDK (all 8 languages) talks to any server implementing the AIGP HTTP contract.
License
Proprietary — © 2025-2026 Evan Erwee. All rights reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maigp_server-5.0.0.tar.gz.
File metadata
- Download URL: maigp_server-5.0.0.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c31ce1e96791187d3effa7dc27363da63269eae64cb5be062abfc8eaf51f4695
|
|
| MD5 |
e0d2f1d824d8a0aad525271f650bdac5
|
|
| BLAKE2b-256 |
c70867099c276a85820f5525a8774cfc97ab4230d13b14a4d6a3eac74cfe29b6
|
File details
Details for the file maigp_server-5.0.0-py3-none-any.whl.
File metadata
- Download URL: maigp_server-5.0.0-py3-none-any.whl
- Upload date:
- Size: 49.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80fa686f6af4403e092c106d29e3065ed66e6272182d907b249abb25fe4f77e8
|
|
| MD5 |
dfb8d481fda5a7bcec3fae663d174f06
|
|
| BLAKE2b-256 |
57db04ea6894cb51fb735f7181841d60ae54e349e267a9e19b736c7c62c99d20
|