AI Agent CI/CD: Why Prompts, Models
An agent version is the combination of prompt, model snapshot, tools and code. Test the behaviour, not just the functions, in CI.
📖 Keep reading
Traditional CI compares function output to an assertion. Agent CI has to evaluate behaviour across four changing inputs: prompt, model version, tool definitions and code. Failures rarely throw; output just gets worse.
Four test layers by cost: unit tests on tool functions and parsing (seconds), contract tests on tool schemas and response parseability (seconds), prompt regression on a golden set (minutes), end-to-end evaluation of multi-step completion, cost and latency (tens of minutes). Most teams only run layer one and catch problems in production.
A golden set of 50-200 cases stores input, must_include, must_not_include, expected_tools, max_steps and tags. Tool trajectory catches the common regression where the answer is right but the process is wrong. Add a case every time production breaks.
GitHub Actions: a unit job, then a prompt-regression job gated by a script that fails on pass rate below threshold, cost above budget, or a drop of more than 3 points versus the main-branch baseline. Relative regression matters more than absolute score.
Keep prompts in the repo with version, model and updated fields in the header so evaluation reports are traceable. Pin model snapshots with dated versions and roll upgrades through the evaluation set before any traffic.
Deploy with shadow traffic, then 1-5% canary, watching completion rate, human handoff rate, steps and cost per task. Put cost and P95 step count in CI as hard gates; a single extra tool call per request is invisible to functional tests and very visible on the invoice.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.