
AIdeas: PolicyCortex
An autonomous cloud governance platform that finds, fixes, and documents security, compliance, cost, and AI governance issues across defense contractors and regulated enterprises. 600K+ lines of production code, 4 patents filed, and already in evaluation at federal research centers.
My Vision
80,000 defense contractors must achieve CMMC certification by 2027 or lose their government contracts. Right now, they manage cloud compliance with 4-6 disconnected tools. One for policy checks. One for cost tracking. One for ticketing. One for evidence collection. None of them talk to each other, and none of them can actually fix anything.
I built PolicyCortex to replace that entire stack.
PolicyCortex is an autonomous cloud governance platform that finds, fixes, and documents security, compliance, cost, and AI governance issues across regulated enterprises. One platform. Five capabilities. Zero gaps.
What makes it different from every other cloud security tool on the market: PolicyCortex doesn't just alert. It fixes. When a compliance violation is detected, the platform generates remediation code (Terraform, Bicep, Azure CLI, PowerShell), validates it against deterministic guardrails, and executes it in production with full rollback capability. 30-second remediation versus the industry standard of 2-3 days.
The platform runs on a three-tier AI stack. Tier 1 is Xovyr, a custom-trained small language model purpose-built for cloud remediation tasks (not a GPT wrapper). Tier 2 leverages large language models for complex reasoning. Tier 3 is a deterministic rule-based fallback that guarantees safety when AI confidence is low. Every autonomous action passes through the patent-pending Safety Sandwich architecture: pre-execution guardrails validate before the change, the AI decision layer plans and executes, and post-execution validation confirms the desired state with a rollback ID held until verification completes.
This is 600,000+ lines of production TypeScript. 2,230 commits in 2026. Four U.S. patent applications filed. Not a hackathon project. A production platform already in evaluation at federally funded research centers and defense organizations.
Why This Matters
Cloud compliance in defense and government is not optional. It is law.
The Cybersecurity Maturity Model Certification (CMMC) Final Rule went into effect in December 2024. Every defense contractor handling Controlled Unclassified Information (CUI) must prove compliance with 110 NIST 800-171 controls or lose eligibility for Department of Defense contracts. The deadline pressure is real: 80,000+ contractors need to certify, and the vendor landscape capable of supporting federal compliance requirements is thin. Only about 20% of cloud security vendors can operate in this market.
The current state of affairs is painful. Compliance teams spend 6+ months manually collecting evidence for a single assessment. Security findings sit in queues for weeks because every tool is read-only. Nobody built write-access into production with safety guardrails. Cost overruns go unnoticed until month-end. AI models deploy across enterprises with zero governance, zero inventory, and zero threat detection.
PolicyCortex solves this for commercial enterprises that serve the defense industrial base, and the same architecture scales to healthcare (HIPAA), financial services (SOC 2), and energy (NERC CIP). Every regulated industry has the same core problem: too many tools, too little automation, and compliance that breaks between audits.
The commercial opportunity is a $12 billion serviceable addressable market across four regulated verticals with non-discretionary budgets. These organizations must buy. The question is from whom.
How I Built This
Architecture
PolicyCortex is built on Next.js 16 (App Router) with Express.js on the backend, PostgreSQL with Prisma ORM for data persistence, and Redis for caching and session management. The platform deploys on Azure with multi-tenant isolation via separate databases per customer. Auth0 handles tenant assignment, SAML/SSO, and role-based access control for enterprise deployments.
The AI Stack
The core intelligence layer is a three-tier AI architecture:
Tier 1 - Xovyr (Custom SLM): A StarCoder2-based small language model fine-tuned specifically on Terraform, Bicep, KQL, and PowerShell for cloud remediation tasks. This runs on dedicated inference infrastructure and handles the majority of remediation code generation. It understands cloud infrastructure at the code level because it was trained on real remediation patterns, not general-purpose text.
Tier 2 - Reasoning Engine: For complex multi-step remediation planning and natural language analysis, the platform routes to large language models via Azure AI Foundry. This tier handles the "Why This Matters" analysis, business impact assessment, and remediation strategy planning that requires broader reasoning.
Tier 3 - Deterministic Fallback: When AI confidence drops below threshold, the system falls back to rule-based remediation using OPA (Open Policy Agent) policies and pre-validated infrastructure-as-code templates. This guarantees safe operation even when the AI models are uncertain.
The Safety Sandwich (Patent-Pending)
This is the technical core and the reason defense organizations trust PolicyCortex with write-access to production.
Layer 1 - Pre-Execution Guardrails: Before any autonomous action, deterministic checks validate Azure credentials, subscription access, resource permissions, and production impact. The system evaluates blast radius, checks criticality tags, and flags production resources for human approval in Gated Mode.
Layer 2 - AI Decision Layer: Xovyr plans the remediation, generates the code, and selects the execution path (direct apply, pull request to CI/CD, Jira ticket creation, or Slack notification).
Layer 3 - Post-Execution Validation: After execution, the system verifies the change achieved the desired state, confirms compliance posture improvement, and holds a rollback ID. If validation fails, automatic rollback restores the previous configuration.
Gated Mode (human-in-the-loop approval) is the default until the platform achieves a 94% autonomous success rate in a given environment. Currently running at 85.5% in POC environments. We do not ship what we cannot trust.
Five Platform Modules
- Governance & Compliance: Continuous monitoring against CMMC, NIST 800-171, CIS Benchmarks, FedRAMP, and custom frameworks. Every finding maps to MITRE ATT&CK tactics and D3FEND defensive capabilities with cross-framework equivalence (CMMC, FedRAMP, ISO 27001, NIST CSF, DOE 205.1D).
- FinOps & Cost Intelligence: Multi-cloud spend tracking with AI-driven right-sizing recommendations based on 60-90 day usage analysis. CFO-ready reports, chargeback by business unit, and budget alerting.
- AI Observability: Full inventory of every AI model deployed across the enterprise. Token consumption, cost per model, latency monitoring, and anomalous access pattern detection mapped to MITRE ATLAS for AI-specific threat identification. Includes federal AI compliance tracking for OMB M-25-21 and DOE P 203.1.
- Autonomous Remediation: The Safety Sandwich in action. One-click or fully autonomous remediation with generated code preview, pre-flight validation, and rollback capability.
- ATO & Authorization Packages: Autonomous evidence collection pipeline that runs through five stages: Evidence Collection, Validation, POA&M Generation, SSP Document creation, and Export Package. Reduces CMMC evidence packaging from 6+ months to under 2 days.
AWS Integration
The platform connects to AWS environments via IAM role assumption and cross-account access, scanning CloudTrail logs, AWS Config rules, Security Hub findings, and Cost Explorer data. The same architecture supports Azure (primary) and GCP, making PolicyCortex a true multi-cloud governance platform. Kiro accelerated the development of our AWS connector modules and cross-cloud policy normalization layer during the building phase.
Key Development Milestones
- 600,000+ lines of production TypeScript
- 7,230 commits in 2026 (as of March)
- 4 U.S. patent applications filed on Safety Sandwich architecture
- Three enterprise engagements with federal R&D centers and defense organizations
- 160+ customer discovery calls, 28+ enterprise demos delivered
- Custom-trained SLM (Xovyr) running on dedicated inference infrastructure
- $3.5M qualified pipeline
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article