Skip to main content

aigp-server — AIGP Governance Engine

Server-side governance engine for the AI Governance Protocol (AIGP). Provider-based architecture following OOP/SOLID principles.

Install

pip install aigp-server>=0.2.0

Quick Start (Config-Driven)

from aigp_server import ServerConfig, GovernanceEngine, AigpRouter

# Configure providers
config = ServerConfig(
    storage={"provider": "memory"},          # or "dynamodb"
    pii={"provider": "regex"},               # or "presidio", "comprehend"
    key_store={"provider": "local"},          # or "kms", "vault"
    mode="ENFORCE",
)
components = config.build()

# Wire up engine + router
engine = GovernanceEngine(components.store, components.scope_mgr, components.circuit_breaker, mode="ENFORCE")
router = AigpRouter(engine, hmac_secret="your-secret")

# Handle requests (framework-agnostic)
status, resp = await router.handle_tool_request(headers, body)

Provider Architecture

aigp_server/
├── providers/
│   ├── storage/         StorageProviderBase → memory, dynamodb
│   ├── scope/           ScopeEnvelopeManager, CircuitBreakerService
│   ├── enforcement/     EnforcementAdapterBase → bedrock, azure, gcp
│   ├── pii/             PiiDetectorBase → regex, presidio, comprehend
│   ├── key_store/       KeyStoreBase → local, kms, vault
│   └── consent/         ConsentEngine (tier-aware tokenization)
├── governance_engine.py
├── routes.py
├── config.py
└── hmac_auth.py

Adding a Provider

from aigp_server.providers.pii import PiiDetectorBase, register

@register("my_detector")
class MyPiiDetector(PiiDetectorBase):
    async def detect(self, text: str) -> list[PiiEntity]: ...
    async def supported_entities(self) -> list[str]: ...

Then use it: ServerConfig(pii={"provider": "my_detector", ...})

Tier Behavior
NONE Block if PII detected
ANONYMOUS Hash PII (irreversible)
REDACTED Tokenize PII (reversible with key)
STANDARD Pass through, store with access controls
FULL Pass through, no restrictions

Handlers

Handler RFC §15 Decision
handle_tool_request §15.6 ALLOW / DENY
handle_plan_submit §15.8 APPROVED / REJECTED
handle_step_complete — Budget decrement
handle_escalate §15.9 Creates pending task
handle_delegate §15.10 Scope narrowing
handle_memory_write §15.13 Classification check

License

Proprietary — © 2025-2026 Evan Erwee. All rights reserved.

Metadata

Release files for aigp-server 4.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for aigp-server 4.0.1
File Interpreter ABI Platform Actions
aigp_server-4.0.1-py3-none-any.whl Python 3 none any Details for aigp_server-4.0.1-py3-none-any.whl

Release files / aigp_server-4.0.1-py3-none-any.whl

Download URL aigp_server-4.0.1-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05692c43090e922574f468e019f1d815324f2967fab3e2668ad1531be627e3cb
BLAKE2b-256 checksum
How to use checksums
1ae01fe481b6af7fcff8594b6a3424977e04919e07cf94cbdd2103d968209614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Security for aigp-server 4.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page