AI-Assisted Features in DevSecOps
How GitLab uses prompt guardrails to help protect customers

How GitLab uses prompt guardrails to help protect customers

1/30/2025 · David O'Regan

What this post added

This post details GitLab's implementation of prompt guardrails for AI features. It explains the concept of prompt guardrails as structured safeguards combining instructions, filters, and context boundaries. GitLab uses tags like `<selected_code>` and `<log>` to define context boundaries, and tools like Gitleaks to scan inputs for secrets before transmission to the AI. The post also discusses different approaches to prompt guardrails, including system-level filters, model instruction tuning, and sidecar/gateway solutions, and explains GitLab's hybrid approach. Lessons learned emphasize balancing restrictiveness with usability, continuous updates, and transparent communication about risk reduction rather than absolute security guarantees.

Read the original post ↗