AI Agent Security in CI/CD: Why You Need Weekly Scans, Not One-Time Audits
One security audit before launch isn't enough. AI agents change every time you update a model, change a prompt, or add a tool. Here's how to build continuous security testing into your AI agent CI/CD pipeline.
You audit your AI agent before launch. You find 3 vulnerabilities, fix them, and ship. Six weeks later, you upgrade to GPT-4.5, tweak the system prompt, and add a new tool. Did you re-test?
Most teams don't. And that's where post-launch AI security incidents come from.
Why AI Agents Need Continuous Security Testing
Traditional software has a relatively stable attack surface. A SQL injection vulnerability exists until you patch it. But AI agent security is dynamic: every change to your model, system prompt, or tool configuration is a potential security regression.
Consider what changes between audits:
- Model upgrades: GPT-4o behaves differently from GPT-4. Gemini Pro behaves differently from Claude. The same prompt injection that failed on one model may succeed on another.
- System prompt changes: A new feature requires updating the system prompt. The update inadvertently removes a defense instruction.
- New tools: You add a database query tool. Now prompt injection doesn't just leak text — it can execute arbitrary queries.
- Context window changes: Longer context windows mean more attack surface for indirect injection.
- Fine-tuning: Fine-tuning on new data can inadvertently shift safety behaviors.
The OWASP LLM Top 10 isn't a static checklist you complete once. It's a test suite you run continuously.
What a CI/CD Security Gate Looks Like
A good AI security CI/CD pipeline has two modes:
Weekly scheduled scan: Runs your full security audit on a schedule — every Monday, or nightly if you ship frequently. Catches regressions introduced by model provider updates, configuration drift, or silent system prompt changes.
Pre-release gate: Runs on demand before any production deployment that touches the AI stack (model version, system prompt, tool configuration). Blocks deploys that drop below a minimum security score.
Both modes should be part of your CI/CD pipeline, not a manual process.
Setting Up AASA in GitHub Actions
AASA provides a GitHub Action at VinitMetange/aasa-scan@v1. Here's the recommended configuration:
name: AI Security Scan
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9am
workflow_dispatch: # On-demand before releases
jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: VinitMetange/aasa-scan@v1
with:
endpoint: ${{ secrets.AGENT_ENDPOINT }}
auth-header: ${{ secrets.AGENT_AUTH }}
tier: standard
fail-below: "75"
fail-on-critical: "true"
ci-token: ${{ secrets.AASA_CI_TOKEN }}
The fail-below threshold blocks deploys that drop below 75/100. The fail-on-critical flag blocks any deploy with a critical-severity finding, regardless of overall score.
What Score Should You Target?
There's no universal answer — it depends on your risk tolerance and deployment context. But as a starting framework:
- Consumer-facing agents: 80+ overall, 0 critical findings. You're responsible for users who don't understand AI risks.
- Internal tools: 70+ overall, 0 critical findings. Lower bar because your users understand the context.
- Agents with tool access (email, calendar, databases): 85+ overall, 0 critical. Excessive agency vulnerabilities carry outsized real-world impact.
- Healthcare, finance, legal: 90+ overall, 0 critical or high findings. Regulatory and liability exposure is severe.
The 38-Day Gap
IBM's 2024 Cost of a Data Breach Report puts the average time to identify and contain a breach at 38 days. For AI agents, that gap is often longer — jailbreak abuse and indirect injection often go undetected without active monitoring, because the agent still appears to function normally from the outside.
Weekly scans don't just catch regressions — they shrink the detection window from weeks to days.
Building the Habit
The teams that ship AI agents safely treat security testing like they treat unit tests: something that runs automatically, reports clearly, and blocks regressions before they reach users.
Start with the free AASA audit to get your baseline score. Then set up the GitHub Action with a score threshold you can defend to your team. Weekly scans cost nothing extra — credits are pre-purchased and the action handles the rest.
Test your agent, not just your knowledge.
AASA tests every layer of your agent — endpoint, tool calls, RAG sources, and web search — against the full OWASP LLM Top 10. Results in under 5 minutes. Intro pricing on your first audit.
Start your audit →