The Governance-First Framework for Agentic AI, Enterprise Middleware & OCI Supply Chain Gating
Project description
govAgent (v3.0.2)
The Governance-First Control Plane for AI Agents & Swarms
govAgent is a lightweight, asynchronous enterprise control plane that hooks natively into multi-agent systems to inject safety, accountability, observability, and deterministic fiscal control into autonomous workflows.
Most agent frameworks prioritize speed and raw capability paths. govAgent focuses on running them predictably, securely, and safely under corporate guardrails, fully aligned with strict global regulatory mandates like the EU AI Act (Regulation 2024/1689).
Why govAgent?
In an enterprise application cluster, raw autonomous agent loops introduce severe execution risks: unmonitored API token cost escalation, accidental PII data leakage, and un-auditable "black box" decisions. govAgent acts as an inline, token-free governance proxy layer to mitigate these friction vectors seamlessly before workloads ever touch production computing environments.
Ideal for:
- Production AI Frameworks: Elevating experimental sandbox scripthooks into resilient, IT-compliant enterprise runtimes.
- Regulated Verticals: Providing verifiable compliance out-of-the-box for Fintech, Supply Chain, Healthcare, Heavy Industry, and Legal infrastructure.
- Sovereign Infrastructure Operations: Powering local Small Language Models (SLMs) and private inference nodes safely alongside or entirely independent of cloud providers.
๐๏ธ Video Walkthrough
โถ๏ธ Click the image above to watch the demo
โจ Key Features
- ๐ก๏ธ Multi-Layer Circuit Breakers - Cascade request evaluations across Stage 0 (Local Privacy Redaction via Microsoft Presidio), Stage 1 (Sentence-Transformer Embedding Intent Alignment), and Stage 2 (Fiscal Cost Boundaries).
- ๐ข Pluggable Enterprise Middleware - Native out-of-band connectors for IBM watsonx & Business Orchestration Bus (BOB) to secure Model Context Protocol (MCP) workflows with zero external token overhead.
- ๐ Centralized Tool Legislation - Enforce explicit tool authorization singletons mapped dynamically against corporate registry endpoints. If a tool isn't explicitly legislated and cryptographically verified in your active policy, it cannot execute.
- ๐ธ Thread-Safe Recursive TCO Tracking - Maintain penny-accurate cost ceilings across complex async parallel delegation domains via immutable state snapshots.
- โ๏ธ Federated Multi-Sig Judiciary - Pause compromised agent loops in real-time, routing out-of-band alerts to Slack via interactive Socket Mode clients for role-weighted quorum votes.
- ๐ Self-Healing Policy Tuning - The MetaGovernor monitors execution friction logs to propose optimized policy adjustments automatically.
- ๐ Article 12 Forensic Telemetry - Stream audit-grade session metrics to cloud SOC sinks (AWS CloudWatch / Azure Log Analytics) with an automated local Dead-Letter Queue (DLQ) for network failover continuity.
๐ก System Architecture
๐ก Full-Stack Sandbox Architecture
govAgent decouples its governance evaluation runtime from its user-facing operational views:
- FastAPI Gateway (
api/server.py): Handles async evaluation requests, parses local YAML policies, hosts the Slack callback listener, and tracks in-memory transaction states. - Next.js Web Interface (
src/app/page.tsx): A clean, single-page dashboard featuring a Live Audit Matrix to watch execution status (SUCCESS,PENDING,BLOCKED), a Legislative Rules Inspector, and a live Forensic Engine Log Stream that updates via long-polling.
๐ Ecosystem Extensions
1. IBM Bob & watsonx Compliance Proxy
Secure multi-agent orchestration fabrics managed via IBM Bob or watsonx Orchestrate out-of-the-box. Intercept tool execution payloads out-of-band using local model architectures without requiring cloud platform tokens or API keys:
from govagent.extensions.ibm.bob_mcp_proxy import BobMCPProxyGateway
from govagent.guards.semantic import SemanticGuard
# Initialize localized token-free vector perimeter checks
semantic_guard = SemanticGuard(
mission="Ensure compliance in corporate ledger systems.",
prohibited=["routing capital to unvetted offshore tax havens"],
threshold=0.60
)
# Bind the proxy plane to intercept incoming orchestrator requests
proxy = BobMCPProxyGateway(semantic_guard=semantic_guard)
def sensitive_payout_tool(amount: float, destination: str):
return f"Payout of ${amount} to {destination} processed."
# Wrap tool definitions dynamicallyโexecution routes through govAgent circuit breakers first
governed_tool = proxy.govern_mcp_tool("authorize_payout", sensitive_payout_tool)
2. CrewAI Middleware Adapter
Instantly elevate experimental CrewAI swarms into enterprise-grade production runtimes using our single-line wrapper:
from crewai import Crew, Agent, Task
from govagent.extensions.crewai.enforcer import GovAgentEnforcer
# Setup your native orchestration layer
analyst_agent = Agent(role="Auditor", goal="Review tables", backstory="Enterprise auditor.")
financial_task = Task(description="Analyze payroll.", expected_output="Report", agent=analyst_agent)
crew = Crew(agents=[analyst_agent], tasks=[financial_task])
# Inject out-of-band routing, Stage 0-2 filters, and absolute tool gating
enforced_crew = GovAgentEnforcer(crew, policy_path="policies/sample_crewai_policy.yaml")
โก 60-Second Quickstart: Institutional Sovereignty
Achieve Article 12 and 14 compliance in three commands. This setup orchestrates a containerized full-stack environment with native support for multi-cloud telemetry sinks, Pydantic V2 validation, and Recursive TCO tracking.
1. Configure the Environment
Ensure your .env file is created in your root workspace directory and contains your API keys alongside your out-of-band Slack webhook credentials:
OPENAI_API_KEY=sk-proj-...
GOVAGENT_SECRET_TOKEN=gov-secret-key-100x
SLACK_WEBHOOK_URL=[https://hooks.slack.com/services/T.../B.../X](https://hooks.slack.com/services/T.../B.../X)...
# For Slack Socket Mode Fallbacks
SLACK_BOT_TOKEN=xoxb-your-token
SLACK_APP_TOKEN=xapp-your-token
SLACK_CHANNEL_ID=C12345678
2. Initialize the Control Plane
Clone the repository and launch your governed infrastructure container mesh directly:
# Clone the Sovereign Repository
git clone [https://github.com/thekakodkar/govagent.git](https://github.com/thekakodkar/govagent.git)
cd govagent
# Launch the Governed Container Stack
docker-compose up -d
3. Verify the Governance Loop
Execute the full-stack evaluation suite within your active container network to witness real-time privacy redaction, semantic checks, and fiscal gating:
docker-compose exec govagent-api poetry run python examples/basic_demo.py
Navigate to http://localhost:3000 to monitor the execution inside your interactive web panel.
๐ป Local Development Setup (Alternative) If you prefer to run the stack natively outside of Docker containers using Poetry, execute the following command path:
# Install core dependencies with the LangChain bundle
poetry install --extras "langchain"
# Download the core NLP model for the local privacy redaction engine
python -m spacy download en_core_web_sm
# Start the services manually in separate terminals
uvicorn api.server:app --host 127.0.0.1 --port 8000
npm run dev
๐๏ธ Core Pillars: The v3.0.2 Sovereign Architecture
GovAgent utilizes a highly modular package structure to enforce a strict "Separation of Duties" across any enterprise application vertical:
govagent.context (The State): Manages thread-safe session isolation, asynchronous parent-to-child trace propagation, and live cumulative Total Cost of Operation (TCO) calculation matrices across decentralized agent swarms.
govagent.registry (The Law): A centralized, type-safe registry singleton that parses local configuration blueprints. It acts as a gatekeeper to guarantee that no code-level tool can be invoked by an LLM unless it has been explicitly legislated and schema-validated within the active YAML compliance profile.
govagent.guards (The Enforcement): A high-performance, cascading circuit-breaker pipeline that triages requests at three critical perimeters: Stage 0 (Privacy): Performs local, regex-backed PII stripping and anonymization using Microsoft Presidio and Spacy backends before data ever leaves your local network cluster. Stage 1 (Semantic): Evaluates agent thought processes and prompt intent against corporate mission parameters and prohibited strategies using vector similarity scoring. Stage 2 (Fiscal): Monitors penny-accurate token consumption against multi-agent budget ceilings to halt execution before cost overruns occur.
govagent.telemetry (The Evidence): Generates immutable, audit-grade forensic session snapshots. If primary multi-cloud security operations center (SOC) ingestion sinks (AWS CloudWatch or Azure Log Analytics) experience network interruptions, the layer automatically drops telemetry payloads into a localized, self-healing Dead-Letter Queue (DLQ) to ensure continuous regulatory traceability.
govagent.governance.meta (The Optimization): Hosts the MetaGovernor engine, an automated self-healing policy loop. It continuously scrapes friction logs and repeated circuit-breaker events (such as successive budget rejections) to autonomously compile non-hallucinated, data-backed POLICY_AMENDMENT_PROPOSALS for review.
govagent.api & govagent.hitl (The Gateway & Judiciary): Powers the stateless REST communication network. It exposes an async FastAPI gateway that integrates seamlessly with a Next.js long-polling frontend dashboard, while routing out-of-band policy breaches to corporate Slack workspaces via firewall-resilient webhooks to enforce role-weighted, multi-signature human consensus.
๐ Code Implementations
Decorate a Legislated Tool
from govagent.registry.manager import tool
@tool(
name="execute_financial_transaction",
risk_level="high",
oci_repository="bizzteq/finance-utils",
artifact_digest="sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
)
async def process_payment(amount: float, reference_id: str):
"""Executes a disbursement following corporate policy and OCI container validation."""
return f"SUCCESS: Transacted ${amount} for Ref: {reference_id}"
Bootstrap an Executive Agent (v3.0.2 Pluggable Router Pattern)
import asyncio
from govagent.agent import ExecutiveAgent
from govagent.llm.router import PolicyBasedRouter, RouterConfig, RoutingMode
from govagent.llm.ollama import OllamaClient
async def main():
# v3.0.2 Routing Setup: Configure the dynamic path fabric
router_cfg = RouterConfig(
routing_mode=RoutingMode.LOCAL_PREFERRED,
default_provider="local_ollama"
)
clients = {
"local_ollama": OllamaClient(config={"base_url": "http://localhost:11434", "model": "llama3"})
}
router = PolicyBasedRouter(clients=clients, config=router_cfg)
# Bootstrap automatically binds local YAML policies to your router client
agent = ExecutiveAgent(
persona="Director",
policy_path="policies/finance_policy.yaml",
router=router
)
# Execution paths automatically evaluate Privacy, Semantic, Fiscal, and Registry guards
task = "Approve an urgent, immediate transaction of $8,500 to buy compute nodes."
result = await agent.execute(task)
print(f"Status: {result.status.upper()}")
print(f"Trace Identifier: {result.trace_id}")
๐ Forensic Telemetry: Article 12 Readiness
Every session generates an immutable snapshot routed directly to external cloud SOC sinks, local repositories, or isolated cross-org tenants.
{
"timestamp": "2026-05-22T13:00:00Z",
"trace_id": "TR-INFRA-882A99",
"parent_trace_id": "director-main-771",
"organization_id": "ENTERPRISE_WEB_UI",
"agent_id": "SovereignControlAgent",
"task_input": "Approve an urgent, immediate transaction of $8,500 to buy compute nodes.",
"status": "SUCCESS: TRANSACTION FINALIZED",
"guards_evaluated": ["privacy", "semantic", "fiscal", "registry", "judiciary"],
"middleware_bus": "IBM_BOB_MCP",
"harbor_verification": {
"status": "VERIFIED",
"image_digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"vulnerabilities_found": 0
},
"metrics": {
"tokens": 850,
"individual_cost_usd": 0.012,
"recursive_tco_usd": 0.045
},
"judiciary_audit": {
"compiled_signatures": [
{"voter_id": "U111", "voter_role": "Director", "decision": "APPROVED"},
{"voter_id": "U222", "voter_role": "Lead", "decision": "APPROVED"}
],
"final_status": "โ
QUORUM MET: Authorized at a weight of 3.0/2.5"
}
}
โ๏ธ Comparative Analysis: Governance Superiority
In an institutional setting, "State Management" is insufficient; you require Sovereignty. GovAgent v1.0.0 is engineered horizontally to transform "Black Box" multi-agent workflows into transparent, compliance-vetted execution lifecycles across all commercial sectors.
| Feature | GovAgent v3.0.2 | LangGraph | Standard Orchestrators |
|---|---|---|---|
| Architectural Scope | โ Modular Control Plane | โ ๏ธ Local State Graph | โ Ad-Hoc Swarm Execution |
| State Management | โ Isolated Fiscal Ledger | โ ๏ธ Shared Thread State | โ Global context |
| Tool Legislation | โ Global Registry Singleton | โ ๏ธ Function Decorators | โ String-based Tools |
| Forensic Audit | โ Federated Cross-Org Trails | โ Per-run only | โ Console Prints |
| Policy Calibration | โ Self-Healing Optimization | โ Hardcoded Boundaries | โ Manual Intervention |
| Regulatory Status | โ EU AI Act Regulation Ready | โ Experimental | โ Experimental |
| Native Swarm Extension | โ Built-In crewAI Middleware Adapter | โ Custom Rigging Required | โ None |
| Middleware Connectors | โ Native IBM Bob MCP & watsonx extension | โ None | โ None |
| Supply Chain gating | โ Harbor OCI Registry Verifier | โ None | โ None |
Strategic Directive: While traditional frameworks focus heavily on graph-based execution paths or simple task delegation, GovAgent v1.0.0 operates as the Sovereign Governance Infrastructure. It ensures that every action across an autonomous network is centrally legislated, evaluated by isolated quantitative guards, and forensically recorded for cross-enterprise auditing.
โ๏ธ Regulatory Compliance: EU AI Act (Regulation 2024/1689)
GovAgent satisfies key mandates for High-Risk AI Systems:
- Article 9: Risk Management & Privacy: Automated Stage 0 PII redaction and proactive semantic intent interception.
- Article 12: Record-Keeping & Traceability: Immutable Forensic Telemetry with local failover (DLQ) for 100% audit continuity.
- Article 14: Human Oversight: Physical gating of high-risk actions through Federated M-of-N Consensus.
๐บ๏ธ Future Strategic Roadmap
๐ The Decentralized Mesh (Next)
- Autonomous Cross-Swarm Delegation: Secure handshakes between entirely disconnected agent meshes.
- Zero-Knowledge Privacy Guards: Advanced cryptographic parsing for Stage 0 inputs.
"Governance is not a constraint; it is the catalyst for enterprise AI adoption."
๐ Project Structure
govagent/
โ
โโโ api/ # FastAPI REST Gateway Layer
โ โโโ server.py # Gateway engine, active policy execution router & REST endpoints
โ
โโโ examples/ # Standalone Institutional Demonstration Scripts
โ โโโ basic_demo.py # Pillar 1: Registry synchronization & baseline policy metrics
โ โโโ cost_control_demo.py # Pillar 2: Micro-cost accumulation loop validation checks
โ โโโ ibm_mcp_governed_tool.py # Pillar 4: IBM Bob out-of-band token-free proxy demo script
โ โโโ multi_agent_demo.py # Pillar 3: Trace ID inheritance across nested sub-swarms
โ โโโ run_institutional_swarm.py # Bulk multi-agent execution tracking simulation trace
โ โโโ self_healing_demo.py # Pillar 5: MetaGovernor automated policy optimization loops
โ
โโโ policies/ # Declarative YAML Operational Manifests & State Buffers
โ โโโ audit_buffer.jsonl # Dynamic high-throughput ledger cache for forensic session states
โ โโโ audit_policy.yaml # Logging validation verification control layout
โ โโโ cost_control_policy.yaml # Restrictive fiscal boundary constraint guidelines
โ โโโ default_policy.yaml # Framework standard system configuration profile
โ โโโ finance_policy.yaml # High-risk financial transaction authorization rules
โ โโโ initial_policy.yaml # Standard baseline initialization configuration snapshot
โ โโโ sample_crewai_policy.yaml # Tailored layout optimized explicitly for CrewAI adapter tracking
โ โโโ team_policy.yaml # Shared multi-role configuration scheme matrix
โ
โโโ src/ # Core Project Development Root
โ โโโ app/ # Next.js Presentation Panel Dashboard Frontend
โ โ โโโ globals.css # Frontend global interface styling configurations
โ โ โโโ layout.tsx # Next.js root layout metadata wrapping html trees
โ โ โโโ page.tsx # Core live evaluation dashboard UI rendering engine
โ โ
โ โโโ govagent/ # Core Python Governance Framework Packages
โ โโโ __init__.py # Root initialization plane exposing top-level framework decorators
โ โโโ agent.py # ExecutiveAgent runtime coordination loop logic
โ โโโ policy.py # System-wide declarative schema parser for active policy profiles
โ โโโ pricing.py # Token rate structures & model cost calculation matrices
โ โ
โ โโโ context/ # Thread-Safe Ledger & Trace Inheritance Systems
โ โ โโโ __init__.py # Context contextvars initialization layer
โ โ โโโ fiscal_ledger.py # Thread-isolated ledger state for real-time atomic TCO tracking
โ โ โโโ session.py # Session management & parent-to-child trace propagation blocks
โ โ
โ โโโ extensions/ # Third-Party Ecosystem Adapter Infrastructure
โ โ โโโ __init__.py # Plugin ecosystem baseline registration
โ โ โโโ crewai/ # Dedicated CrewAI Interception Extension
โ โ โ โโโ __init__.py # CrewAI extension bootstrap definitions
โ โ โ โโโ compliance.py # Dedicated Stage 0-2 CrewAI Compliance execution core
โ โ โ โโโ enforcer.py # GovAgentEnforcer control plane & Custom LLM Interceptor Bridge
โ โ โโโ ibm/ # IBM Enterprise Connectivity Middleware Package
โ โ โโโ __init__.py # IBM package registry namespaces
โ โ โโโ bob_mcp_proxy.py # Intercepts IBM Bob FastMCP tool registration boundaries out-of-band
โ โ โโโ watsonx_bus.py # Injects generation cost monitoring within watsonx Orchestrate
โ โ
โ โโโ governance/ # Policy Self-Healing & Optimization Architectures
โ โ โโโ __init__.py # Optimization namespace tracking configuration
โ โ โโโ meta.py # MetaGovernor automated friction log analysis engine
โ โ
โ โโโ guards/ # Cascading Control Check Circuit Breakers
โ โ โโโ __init__.py # Enforcement orchestration baseline entries
โ โ โโโ circuit_breaker.py # Multi-stage routing triage director execution pipeline
โ โ โโโ privacy.py # Presidio-backed local text anonymization & PII masking engine
โ โ โโโ semantic.py # Sentence-Transformer embedding vector intent alignment comparison
โ โ
โ โโโ hitl/ # Human Oversight & Federated Framework Judiciary
โ โ โโโ __init__.py # Human-in-the-loop coordination core constants
โ โ โโโ adapters.py # Core human notification interface protocols (CLI, Webhook)
โ โ โโโ manager.py # Role-weighted M-of-N signature verification logic panel
โ โ โโโ slack_adapter.py # Real-time interactive WebSocket Socket Mode adapter client
โ โ
โ โโโ llm/ # Infrastructure-Native Traffic Routers & Client Endpoints
โ โ โโโ __init__.py # Model routing structural definition map
โ โ โโโ base.py # Type-safe LLMRequest and LLMResponse structural schemas
โ โ โโโ ollama.py # Local Small Language Model generation client wrapper
โ โ โโโ router.py # Declarative YAML Policy-Based dynamic path router matrix
โ โ
โ โโโ registry/ # Tool Management & Supply Chain Authorization Systems
โ โโโ __init__.py # Legislation namespace entrypoint
โ โโโ harbor_verifier.py # Harbor API client for OCI cryptographic image signing checks
โ โโโ manager.py # Global tool legislation singleton coordinator plane
โ โโโ schemas.py # ToolManifest and type-safe compliance registration models
โ
โโโ tests/ # Automated Pytest Validation Matrix Suite
โ โโโ __init__.py
โ โโโ conftest.py # Shared testing environments, configuration defaults & mock fixtures
โ โโโ test_api_endpoints.py # Gateway response code verification verification paths
โ โโโ test_crewai_adapter.py # Isolated test vectors checking enforcer circuit breakers via tmp_path
โ โโโ test_cross_org_telemetry.py # Multi-tenant federation validation traces
โ โโโ test_flow.py # Multi-agent sequential logic workflow validations
โ โโโ test_governance.py # Verification paths tracking active runtime policy changes
โ โโโ test_ibm_connectors.py # IBM Bob MCP proxy and watsonx sync verification suites
โ โโโ test_meta_governor.py # Checks meta autonomous self-healing policy capabilities
โ โโโ test_slack_hitl.py # Interactive Socket Mode role-based weighted quorum tests
โ โโโ test_telemetry.py # Local and dead-letter queue metrics export tracking checks
โ
โโโ utility/ # Infrastructure Diagnostic Services
โโโ slack_diagnostic.py # Real-time WebSocket connection triage & channel tracking hooks
Contributions are welcome! Star the repo if you find it useful โค๏ธ Framework Developed and Maintained by Niraj Kakodkar
Contribution Workflow
We enforce a strict branching strategy to keep main stable:
- Fork/Branch: Create a feature branch from latest main (
feature/your-feature-nameorfix/issue-name). - Local Validation: Ensure all local tests pass and run the linter.
- Open a PR: Submit a Pull Request against
main. - Automated Check: GitHub Actions will automatically validate your build.
- Peer Review: At least one maintainer must review and approve the changes before merge.
Author Stamp
- Framework: GovAgent v3.0.2
- Compliance: Designed for Article 9, 12, and 14 Accountability
- Status: Active / Open-Source Standard
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 govagent-3.0.2.tar.gz.
File metadata
- Download URL: govagent-3.0.2.tar.gz
- Upload date:
- Size: 45.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4fad7ecbef3b0aa4c228e75c49ece025c880caaa2726bf008348d1cac1fb7fe
|
|
| MD5 |
333074e327956653323889d6d3458628
|
|
| BLAKE2b-256 |
43801f92c1e718e23e42a409809fa4ccad48fef48fad461936d8ebf8d651cbc7
|
File details
Details for the file govagent-3.0.2-py3-none-any.whl.
File metadata
- Download URL: govagent-3.0.2-py3-none-any.whl
- Upload date:
- Size: 50.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c255bf73eed91652e9cc51b3258946a466321e8203038be46eba7e215c246d5
|
|
| MD5 |
6c50dc635c98adf315dfa2df58a9deee
|
|
| BLAKE2b-256 |
e1a2bc770c2b30c736b4eb252fbf10890d729d49ce2478411122fa62f7a6a920
|