Skip to content

πŸ‘‰ PolicyStream: Orchestrating AI with built-in governance, compliance, and trust.

License

Notifications You must be signed in to change notification settings

4th/PolicyStream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PolicyStream

PolicyStream is a microservices-based platform for policy-aware AI orchestration.
It integrates governance, risk, and compliance (GRC) controls directly into AI service pipelines, ensuring every model call is auditable, explainable, and compliant.

Unlike traditional AI service layers, PolicyStream embeds policy enforcement, evidence logging, and observability hooks into the runtime, making it suitable for enterprise, regulated, and mission-critical deployments.


✨ Key Features

  • Security & Governance β†’ All requests evaluated by a Policy Enforcement Point (PEP) against organizational policies before execution.
  • Observability & Auditability β†’ Every decision and model interaction logged into an Evidence Store for compliance reporting.
  • Risk Awareness β†’ Dynamic checks against Data Protection Impact Assessments (DPIAs), risk registers, and compliance rules.
  • Modular AI Runtime β†’ Supports Retrieval-Augmented Generation (RAG), tool brokers, and hosted/third-party LLMs.
  • Cloud-Native Design β†’ Deployable on Kubernetes (EKS, GKE, AKS, or on-prem), with GitHub Actions + GHCR pipelines.
  • Multitenancy + Regionalization β†’ Supports tenant-aware routing and regional data residency enforcement.

πŸ—οΈ Architecture Overview

flowchart TB
  %% Clients
  subgraph CLIENTS["Clients"]
    Web["Web App"]
    Mobile["Mobile App"]
    Partner["Partner API"]
  end

  %% Edge / Gateway
  subgraph GATEWAY["Gateway and WAF"]
    AuthN["Auth and Tokens"]
    RateLimit["Rate Limiting"]
    Validate["Schema and Payload Validation"]
    PEP["Policy Enforcement Point (PEP)"]
  end

  %% AIMS / PDP
  subgraph AIMS["AIMS - Policy Decision Point"]
    PDP["Policy Rules Engine (OPA/Rego)"]
    Evidence["Evidence Store (Audit Logs)"]
  end

  %% Core Services
  subgraph SERVICES["Core AI Services"]
    RAG["Retrieval-Augmented Generation"]
    Tools["Tool Broker"]
    Models["Model Service"]
  end

  %% Observability
  subgraph OBS["Observability and Audit"]
    Logs["Logs and Traces"]
    Metrics["Metrics and Usage"]
    SIEM["Security Monitoring (SIEM/SOC)"]
  end

  %% Flows
  Web --> GATEWAY
  Mobile --> GATEWAY
  Partner --> GATEWAY

  GATEWAY --> PEP
  PEP --> PDP
  PDP --> Evidence

  PEP --> RAG
  PEP --> Tools
  PEP --> Models

  RAG --> Logs
  Tools --> Logs
  Models --> Logs

  Logs --> SIEM
  Logs --> Metrics
Loading

πŸ“¦ Microservices

1. Gateway

  • Routes client requests.
  • Handles auth, basic rate-limiting, and payload validation.
  • Forwards requests to PEP β†’ AIMS β†’ Services.

2. PEP (Policy Enforcement Point)

  • Intercepts every request.
  • Calls AIMS PDP for policy decisions.
  • Supports allow / deny / modify outcomes.

3. AIMS (AI Management System)

  • Central policy decision point (OPA/Rego-ready).
  • Stores evidence of every decision (audit trail).
  • Integrates with risk registers, DPIAs, and compliance APIs.

4. RAG Service

  • Provides context retrieval from a knowledge base/vector DB.
  • Adds grounding to model responses.

5. Tools Service

  • Broker for external APIs and system tools.
  • Examples: calendars, DB lookups, compliance checks.

6. Models Service

  • Simple echo model for development.
  • Swap for OpenAI, Anthropic, or NVIDIA NIM APIs.

πŸš€ Quick Start (Docker Compose)

# from repo root
docker compose up --build -d

Health Checks

curl.exe http://localhost:8080/healthz   # gateway
curl.exe http://localhost:8084/healthz   # pep
curl.exe http://localhost:8090/healthz   # aims
curl.exe http://localhost:8081/healthz   # rag
curl.exe http://localhost:8082/healthz   # tools
curl.exe http://localhost:8083/healthz   # models

Test Request

curl.exe -X POST http://localhost:8080/v1/route -H "Content-Type: application/json" -d "{"user_id":"u1","prompt":"Draft a friendly email (no secrets).","sensitivity":"Public","labels":["Public"]}"

☸️ Kubernetes Deployment (Helm)

# Push images to GHCR
docker login ghcr.io -u <USERNAME> -p <TOKEN>
$services = @("gateway","pep","aims","rag","tools","models")
foreach ($s in $services) {
  docker build -t ghcr.io/<org>/policystream/$s:dev ".\services\$s"
  docker push ghcr.io/<org>/policystream/$s:dev
}

# Deploy with Helm
helm upgrade --install policystream .\charts\policystream `
  -n prod --create-namespace `
  --set global.registry=ghcr.io/<org>/policystream `
  --set global.tag=dev

Verify

kubectl -n prod get pods
kubectl -n prod get svc
# optional port-forward for quick testing
kubectl -n prod port-forward svc/policystream-gateway 8080:80
curl.exe http://localhost:8080/healthz

πŸ“– Roadmap

  • Add NVIDIA NIM API support for accelerated inference.
  • Integrate Azure Purview-style governance connectors.
  • Multi-cluster federation support.
  • Policy authoring UI for non-technical stakeholders.

πŸ“œ References (APA-style placeholders)

  • Microsoft. (2023). Microsoft Purview: Data governance at scale. Microsoft Docs.
  • Open Policy Agent. (2024). OPA/Rego Policy Engine. CNCF.
  • NIST. (2023). AI Risk Management Framework (AI RMF 1.0). National Institute of Standards and Technology.
  • ISO/IEC. (2023). ISO/IEC 42001 Artificial Intelligence Management System (AIMS). International Standards Organization.

About

πŸ‘‰ PolicyStream: Orchestrating AI with built-in governance, compliance, and trust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published