Skip to main content

AIGP Governance Server — agentic governance engine (scope envelopes, circuit breakers, delegation)

Project description

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", ...})

Consent Tiers

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aigp_server-4.0.1-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file aigp_server-4.0.1-py3-none-any.whl.

File metadata

  • Download URL: aigp_server-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for aigp_server-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05692c43090e922574f468e019f1d815324f2967fab3e2668ad1531be627e3cb
MD5 eddd9ce43fdd8525a254da26df0c1dd0
BLAKE2b-256 1ae01fe481b6af7fcff8594b6a3424977e04919e07cf94cbdd2103d968209614

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page