---
title: "Hands-On AI Security"
canonical: "https://codeandcypher.com/series/hands-on-ai-security/"
description: "A 4-part practical laboratory on local LLM deployment, red-team prompt injection, Flask gateways, and OPA policy enforcement."
---

# Hands-On AI Security


> A 4-part practical laboratory on local LLM deployment, red-team prompt injection, Flask gateways, and OPA policy enforcement.


## Index

- [Hands-On AI Security: Building a Zero-Cost Local LLM Lab with Docker, Ollama, and Piper](/series/hands-on-ai-security/part-1-zero-cost-local-llm-lab/index.md) (2026-09-10): Architect a reproducible local AI red/blue team lab using Docker, Ollama, and the vulnerable Piper chatbot on standard 8GB RAM student laptops.

- [Hands-On AI Security: Red Teaming Piper with 5 Prompt Injection Vectors](/series/hands-on-ai-security/part-2-red-teaming-piper-prompt-injection-vectors/index.md) (2026-09-17): Attack the Piper chatbot across 5 prompt injection categories, testing vulnerabilities, boundary bypasses, and hardened model variants in a local AI testbed.

- [Hands-On AI Security: Blue Teaming and Building the Security Gateway](/series/hands-on-ai-security/part-3-blue-teaming-building-the-security-gateway/index.md) (2026-09-24): Construct an external security gateway in Flask to inspect incoming prompts, enforce guardrails, and intercept leaked secrets before they reach the browser.

- [Hands-On AI Security: Policy-as-Code with Open Policy Agent and Rego](/series/hands-on-ai-security/part-4-policy-as-code-open-policy-agent-rego/index.md) (2026-10-01): Connect Open Policy Agent (OPA) to your AI security gateway, evaluate context classifications in real time, and generate audit-ready security block logs.

