Ai4
Open-source policy engines eliminate shadow AI risks by enforcing automated runtime controls even when primary security gateways fail.
AI-assisted summary of AI Governance in the Tech Stack - Making AI Safe to Scale - AI Governance as Code with CSX — original source. Check the original for full context.
Source published:
Detailed notes
## Background This YouTube video was presented by Marc Cagulangan, Technical Director at CSX, and published by the Ai4 channel on August 18, 2026. The presentation explores "AI Governance-as-Code," demonstrating how organizations can automate governance and risk management across CI/CD pipelines, runtime environments, and agent workflows using Open Policy Agent (OPA).
## TL;DR Marc Cagulangan outlines an executable approach to AI governance designed to replace static policy documents with automated, code-based policy enforcement engines. He presents a target state architecture featuring eight sequential governance gates—covering inventory, architecture, identity, data, deployment, runtime operations, telemetry, and automated containment—mapped to frameworks like NIST AI RMF. Through a practical hands-on demonstration using Open Policy Agent (OPA) and Rego, Cagulangan illustrates how automated fail-close mechanisms can enforce real-time security, mitigate shadow AI, and maintain compliance even during vendor gateway outages.
## Atmosphere & style The session carries an authoritative, pragmatic, and highly technical tone, blending developer expertise with cybersecurity and IT audit rigors. Cagulangan presents with an open, "no-gatekeeping" approach, utilizing real-world analogies like airport TSA checkpoints to make complex policy architectures accessible. The atmosphere feels pragmatic and solution-oriented, transitioning from high-level enterprise risk considerations to real-time VS Code demonstrations that ground AI safety directly in operational reality.
## Key takeaways - [00:04](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=4s) Static policy documents fail to keep pace with rapid AI and automation scaling, creating gaps between policy, execution, and auditability. - [00:04](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=4s) Operationalizing AI governance as an enforceable policy engine moves organizations toward automated, living governance embedded in CI/CD pipelines and runtime environments. - [01:51](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=111s) Organizations face critical management challenges from 'shadow AI' and a lack of centralized, real-time metrics across the AI agent lifecycle. - [01:51](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=111s) Automating governance delivers scalable speed, continuous runtime protection, safe agentic autonomy, and lower operating costs by reducing manual audit overhead. - [03:00](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=180s) Open Policy Agent (OPA) serves as a CNCF-graduated, open-source rules engine using the declarative Rego language to evaluate compliance dynamically across the AI lifecycle. - [03:00](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=180s) Major technology and financial industry leaders (e.g., Anthropic, Netflix, Google, Capital One) rely on OPA or similar policy frameworks as de facto enforcement engines. - [06:25](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=385s) The target architecture defines eight sequential governance gates: Inventory, Build & Architecture, Identity & Tools, Data Governance, Approve & Deploy, Runtime Operations, Observability & Telemetry, and Contain & Respond. - [06:25](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=385s) Governance policies managed entirely as code are version-controlled, peer-reviewed, tested in CI/CD pipelines, and fully auditable. - [07:44](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=464s) OPA provides architectural flexibility across three key patterns: a redundant defense-in-depth fail-close backup, a unified single pane of glass, and a rapid stop-gap engine for early POCs. - [13:32](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=812s) In fail-close execution scenarios, OPA can block unauthorized foundation models or agent actions during primary gateway service outages. - [16:00](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=960s) OPA policies mapped to frameworks like NIST AI RMF decouple central decisioning (allow/deny) from downstream REST API execution across tech stack components. - [17:47](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=1067s) Effective AI governance aligns technical safety directly with corporate business imperatives, ensuring resilient operations and measurable return on investment.
## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=4s) Introduction and Vision: AI Governance as Code
Marc Cagulangan, Technical Director at CSX specializing in AI governance, IT, cybersecurity, and risk management, introduces himself and sets the agenda for the session. Blending his background in software development, IT audit, cybersecurity, and AI governance, Cagulangan approaches the challenge from multiple angles: a developer focused on delivering value, an auditor concerned with compliance and burden of proof, a security practitioner mitigating threats, and an executive-facing leader responsible for runtime safety. He emphasizes that the talk will be completely open and transparent—promising "no gatekeeping"—and will demonstrate a proof-of-concept (POC) built on Open Policy Agent (OPA) to operationalize AI governance as an enforceable policy.
- **Speaker background:** Transitioned across software development, IT audit, cybersecurity, and AI governance. - **Core goal:** Move away from static policy documents toward an enforceable, automated "AI Governance-as-Code" policy engine. - **Audience takeaway:** Full visibility into the open-source coding project to enable attendees to build their own OPA-based policy engines.
---
[01:51](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=111s) The Operational Challenge and Business Value of Automated Governance
Organizations face significant operational hurdles in AI management, chief among them being "shadow AI"—the principle that "you can't govern what you can't see." Beyond basic visibility, there is a systemic lack of centralized, real-time, and integrated metrics spanning the entire AI agent lifecycle. While emerging vendor solutions attempt to tackle isolated parts of the lifecycle, Cagulangan argues that a unified governance framework is essential to achieve both compliance and speed.
Automating governance delivers tangible business value across several dimensions: - **Scalable Governance:** Allows governance velocity to match the rapid pace of AI adoption. - **Runtime Protection:** Ensures AI models and agents remain governed post-deployment, not just during pre-deployment checks. - **Agentic Autonomy:** Enables autonomous AI agents to operate within strict guardrails without sacrificing organizational accountability. - **Lower Operating Costs:** Reduces administrative overhead through automated controls rather than manual audit checks.
---
[03:00](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=180s) Open Policy Agent (OPA) as the Universal Policy Engine
Open Policy Agent (OPA) is an open-source, Cloud Native Computing Foundation (CNCF) graduated project that functions as a real-time, centralized rules engine. OPA utilizes **Rego**, a specialized declarative policy language, to codify business, legal, and technical requirements into computable conditions that can be evaluated dynamically. Rather than replacing existing tools, OPA sits centrally across the AI development lifecycle to execute governance gate checks at each phase.
To demystify OPA, Cagulangan provides a real-world airport security analogy:
``` +------------------------------------------------------------------+ | TSA CHECKPOINT ANALOGY | +------------------------------------------------------------------+ | AI Agent Lifecycle Stage | TSA Security Counterpart | +---------------------------------+--------------------------------+ | Identity & Registration | Driver's License / Passport | | Data Governance & Hygiene | Baggage & Carry-on Inspection | | Identity & Role Security | Gate Ticket & Boarding Pass | | Runtime Operations Guardrails | CCTV & Federal Air Marshals | | Enterprise Risk Governance | DHS & TSA Headquarters Oversight| +------------------------------------------------------------------+ ```
Industry heavyweights—including Anthropic (using Responsible Scaling Policies), Netflix, Google, Capital One, and Goldman Sachs—already rely on OPA or similar policy frameworks as de facto enforcement engines.
---
[06:25](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=385s) The Target State Architecture: 8 Sequential Governance Gates
The core of the presentation is the target state architecture for the AI development lifecycle. It establishes eight sequential governance gates that every AI agent and solution must traverse. Policies are managed entirely as code—version-controlled, peer-reviewed, tested in CI/CD pipelines, and fully auditable.
``` +-----------------------------------------------------------------+ | AI LIFECYCLE GOVERNANCE PIPELINE | +-----------------------------------------------------------------+ | [Gate 1: Inventory] --> [Gate 2: Build] --> [Gate 3: Identity] | | | | | [Gate 6: Runtime] <-- [Gate 5: Deploy] <-- [Gate 4: Data] | | | | | v | | [Gate 7: Telemetry] --> [Gate 8: Contain & Respond] | +-----------------------------------------------------------------+ ```
Detailed Gate Specifications
- **Gate 1: Inventory & Profile (Blue) — *"What are we building?"*** Verifies AI agent registration in enterprise registries, evaluates AI profile identifiers, assesses business context, and logs risk classifications in systems of record (e.g., ServiceNow AI Control Tower, Credo AI). - **Gate 2: Build & Architecture (Purple) — *"Can it be built?"*** Evaluates stack metadata for architectural viability, dependency security, approved cloud services, and sanctioned data sources. - **Gate 3: Identity & Tools — *"Who is doing the work?"*** Validates agent identity, role-based access control (RBAC), sanctioned foundation models, approved tool integrations, and Model Context Protocol (MCP) servers (e.g., Microsoft Entra, Okta, Palantir Foundry). - **Gate 4: Data Governance (Yellow) — *"What data can it access?"*** Enforces data classification, anonymization, hygiene, and data pipeline version control (e.g., Microsoft Purview). - **Gate 5: Approve & Deploy (Red) — *"Can it be deployed?"*** Verifies staging environments, MLflow registration, formal sign-offs, and automated security test harness results prior to production release. - **Gate 6: Runtime Operations (Orange) — *"Can it safely operate?"*** Monitors active requests to enforce response thresholds, API rate limits, behavioral boundaries, and sanctioned model versions (e.g., Kong API Gateway, Zscaler AI Guard). - **Gate 7: Observability & Telemetry (Black) — *"Is it behaving correctly in production?"*** Provides continuous real-time monitoring for model drift, algorithmic bias, and execution exceptions (e.g., LangSmith, Microsoft Sentinel). - **Gate 8: Contain & Respond (Teal) — *"How do we react to threats?"*** Triggers automated incident response protocols, escalates anomalies, and executes automated kill switches when safety boundaries are breached.
---
[07:44](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=464s) Implementation Strategies: Build vs. Buy and Redundancy
While off-the-shelf commoditized vendor solutions dominate individual points in the stack, OPA provides crucial architectural flexibility through three main deployment patterns: 1. **Redundant Defense-in-Depth:** Serves as a fail-close backup engine that enforces safety controls even if a primary commodity gateway or security vendor experiences an outage. 2. **Single Pane of Glass ("Life360 for AI"):** Aggregates verification state across all eight gates to provide a unified real-time inventory of every AI agent’s compliance posture. 3. **Rapid Stop-Gap Solution:** Acts as a lightweight, custom policy engine during early proof-of-concept (POC) phases to allow fast production deployments without waiting for enterprise procurement cycles.
---
[13:32](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=812s) Real-World Case Study: Mitigating Shadow AI and Gateway Outages
Cagulangan walks through a practical threat scenario involving an unauthorized foundation model (**Kimmy K3**) that has not received legal or security clearance for general availability (GA) deployment.
Incident Execution Flow
1. **Attempted Access:** An AI agent attempts to invoke the blacklisted Kimmy K3 model via RPC. 2. **Gateway Failure:** Simultaneously, the primary AI Gateway service experiences an infrastructure outage. 3. **OPA Fail-Close Intervention:** Acting as a redundant control at Gate 6 (Runtime Operations), OPA intercepts the request. Because the primary gateway is offline and the requested model is unapproved, OPA defaults to a **fail-close** decision. 4. **Automated Escalation:** OPA signals Zscaler to enforce a perimeter firewall rule blocking blacklisted AI traffic, alerts the Security Operations Center (SOC), and triggers an automated AI governance review.
"In this case, the AI agent was essentially quarantined and denied traffic," Cagulangan explains, demonstrating how OPA maintains compliance and mitigates operational, legal, and privacy risks even during vendor outages.
---
[16:00](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=960s) Hands-On Code Walkthrough and Executive Dashboards
Transitioning to VS Code, Cagulangan demonstrates the project structure for the OPA engine.
``` /ai-governance-opa │── /policies │ ├── gate1_inventory.rego │ ├── gate2_architecture.rego │ ├── gate3_identity.rego │ ├── gate4_datagov.rego │ ├── gate5_deployment.rego │ ├── gate6_runtime.rego │ ├── gate7_telemetry.rego │ └── gate8_containment.rego └── /configs └── nist_ai_rmf_mapping.json ```
- **Policy Generation:** Policies are written in Rego and mapped directly to the **NIST AI Risk Management Framework (AI RMF)**, allowing developers to customize rules for edge cases. - **Enforcement Decoupling:** OPA handles central *decisioning* (`allow` vs. `deny`), while execution is handled by integrated downstream stack components via REST APIs. - **Telemetry Console:** A dedicated dashboard displays real-time agent population health using visual status indicators: - **Green:** Policy evaluation passed. - **Yellow:** Incomplete API payload; insufficient data to evaluate condition. - **Red:** Explicit policy denial; execution blocked.
---
[17:47](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=1067s) Conclusion: Aligning AI Safety with Corporate Imperatives
Closing the presentation, Cagulangan ties technical governance directly to business strategy. While CEOs demand immediate financial and operational returns on AI investments, those returns cannot be realized without robust safety and governance.
"At CSX, we are envisioning an AI governance program where it is no longer just a security and technology concern—there's a business, safety, and financial imperative," he concludes. The ultimate goal for CSX is to leverage executable AI governance to remain the safest, most efficient, and most resilient railroad in North America while maintaining best-in-class service delivery.
## Notable quotes > [01:51](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=111s) you can't govern what you can't see — Marc Cagulangan
> [13:32](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=812s) In this case, the AI agent was essentially quarantined and denied traffic — Marc Cagulangan
> [17:47](https://www.youtube.com/watch?v=g0zqHEOr2DM&t=1067s) At CSX, we are envisioning an AI governance program where it is no longer just a security and technology concern—there's a business, safety, and financial imperative — Marc Cagulangan
## Mentioned Marc Cagulangan, CSX, Open Policy Agent (OPA), Rego, TSA, Department of Homeland Security (DHS), Anthropic, Netflix, Google, Capital One, Goldman Sachs, ServiceNow AI Control Tower, Credo AI, Microsoft Entra, Okta, Palantir Foundry, Microsoft Purview, MLflow, Kong API Gateway, Zscaler AI Guard, LangSmith, Microsoft Sentinel, NIST AI Risk Management Framework (AI RMF), Kimmy K3
## Video description Marc Cagulangan - Technical Director, CSX
What if your governance policies could execute themselves—directly enforcing control at every layer of your technology stack? As organizations scale AI and automation, traditional governance models struggle to keep pace, creating gaps between policy, execution, and auditability. In this session I will discuss how to embed governance directly into CI/CD pipelines, runtime environments, and agent workflows using a “AI Governance-as Code” approach. Attendees will learn how to translate risk, compliance, and security requirements into enforceable controls that operate in real time across modern AI systems. They will also see how this model improves audit readiness, reduces operational risk, and enables scalable oversight. Join this session to move from static policy documents to living, executable governance that scales with your technology.
[Source](https://www.youtube.com/watch?v=g0zqHEOr2DM)