Hands-On AI Security: Policy-as-Code with Open Policy Agent and Rego
How to move beyond static regex filters by using Open Policy Agent (OPA) and Rego to enforce declarative, explainable security policies on AI prompts.
How to move beyond static regex filters by using Open Policy Agent (OPA) and Rego to enforce declarative, explainable security policies on AI prompts.
In August 2026 I delivered a webinar for the NCyTE Center on a question I kept hearing from community college faculty: how do you teach AI security when you don’t have a budget, your IT department locks down what you can install, and API costs for a live LLM are unpredictable? The answer I built — and the one this post walks through — is a zero-cost, fully local lab that any instructor can drop into their course next week. ...