aigp-server — AIGP Governance Engine
Reference governance server for the AIGP Runtime 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 Kanjani AI Research & Causum. All rights reserved.
Metadata
Release files for maigp-server 5.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| maigp_server-5.1.0.tar.gz | 57.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| maigp_server-5.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 127.7 kB
Release files / maigp_server-5.1.0.tar.gz
| Download URL | maigp_server-5.1.0.tar.gz |
|---|---|
| Size | 57.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f1cc107add288f6e12ff0392ca9fba63aa4f9f0c96567a4d575857ddc9f7064
|
|
BLAKE2b-256 checksum How to use checksums |
2583c1c60e0c5b67d414c90b360060f500f00157451bbeb1b326aa4cec25ce61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / maigp_server-5.1.0-py3-none-any.whl
| Download URL | maigp_server-5.1.0-py3-none-any.whl |
|---|---|
| Size | 70.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb06000ffb72cb669d96cb1a26aab431ffa6d427ed5dcfb81ed3320c251ce3da
|
|
BLAKE2b-256 checksum How to use checksums |
6b769bb2848e4411e997f72f3d9483005fc5c14faf7d99ea5eb950fceb6f3b05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|