← All articles
AI DevOps8 min read

AI DevOps: Shipping GenAI Features Safely to Production

How to treat LLM apps like real products—CI/CD, evaluation gates, cost controls, and rollback paths that ops teams can trust.

GenAI features move fast, but production still needs the same discipline as any other release. Teams that treat a prompt edit or a model swap as an informal tweak usually find out about latency spikes, cost surprises, or unsafe answers only after users do. The fix is not to slow down—it is to give prompts, models, and retrieval the same versioning, testing, and rollback paths that application code already has.

This guide describes the delivery pipeline we use for LLM-powered features: what to version, how to gate releases on evaluations instead of vibes, how to control cost and security, and how to roll out and roll back model changes safely.

GenAI release pipeline

  1. VersionPrompts, model IDs, parameters, and index versions in Git
  2. EvaluateRegression suite scores quality, safety, latency, cost
  3. SecureSecret scanning, tool permissions, data-leak checks
  4. CanarySmall share of traffic with automated analysis
  5. Promote or roll backConfig change, not a redeploy
Every change to a prompt, model, or retrieval index goes through the same gates as code.

What makes GenAI releases different

Traditional code is deterministic: the same input produces the same output, and unit tests catch regressions. LLM features are probabilistic and depend on several moving parts that change independently—the prompt template, the model and its version, generation parameters such as temperature and max tokens, the retrieval index, and any tools the model can call. A provider can also update a model behind the same name. Each of these can change behaviour without a single line of application code changing.

  • Quality regressions are statistical, so you need a test set and scores, not a single assertion.
  • Cost scales with tokens, so a longer prompt or a chattier model can double spend overnight.
  • Latency depends on model size, output length, and provider load.
  • Security risks include prompt injection, data leakage, and over-permissioned tools.

1. Version everything that changes behaviour

Keep prompts and model configuration in Git next to the code, as reviewed files rather than strings buried in application logic or edited in a vendor console. Reference a pinned model version wherever the provider allows it, so a provider-side update becomes a deliberate change you test, not a surprise.

prompts/support-answer.yamlyaml
id: support-answer
version: 14
model:
  provider: bedrock
  id: <pinned-model-version-id>
  temperature: 0.2
  max_output_tokens: 600
retrieval:
  index: support-kb
  index_version: 2026-09-28
  top_k: 4
system: |
  You answer customer support questions using only the provided context.
  If the context does not contain the answer, say you don't know and
  offer to connect the customer with a person. Cite the source title.
budget:
  max_input_tokens: 6000
  max_cost_per_request_usd: 0.02

With configuration in files, every change has an author, a review, and a diff—and rolling back is a revert of a small file.

2. Gate promotion on evaluations

An evaluation suite is a set of real or realistic inputs with expected properties of good answers: the facts that must appear, the sources that should be cited, things that must never be said, and limits on length and latency. Run it in CI on every change to prompts, models, or retrieval, and compare scores against the current production baseline. Block the merge if quality drops beyond a threshold or if any safety test fails.

  • Start with 50–200 cases drawn from real user questions, including the awkward ones.
  • Score with a mix of deterministic checks (required facts, forbidden phrases, JSON validity) and model-graded rubrics for tone and helpfulness.
  • Track latency percentiles and tokens per request alongside quality.
  • Add every production failure as a new test case, so the suite grows with real risks.
.github/workflows/genai-eval.yml (excerpt)yaml
name: genai-eval
on:
  pull_request:
    paths: ["prompts/**", "retrieval/**", "src/llm/**"]

jobs:
  evaluate:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
    steps:
      - uses: actions/checkout@v4
      - uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::111122223333:role/gha-genai-eval
          aws-region: us-east-1
      - name: Run regression suite against candidate config
        run: |
          python -m evals.run \
            --suite evals/support-regression.jsonl \
            --config prompts/support-answer.yaml \
            --baseline evals/baselines/production.json \
            --fail-if-quality-drop 0.03 \
            --fail-on-safety-violation \
            --max-p95-latency-ms 4000

How does your cloud measure up?

Score your setup across foundation, delivery, reliability, security, and cost in 3 minutes—instant results, no email needed.

Take the free scorecard

3. Security gates for LLM features

GenAI introduces new ways to leak data and misuse permissions. Add these checks to the same pipeline:

  • Secret scanning so API keys never reach prompts, repositories, or logs.
  • Policy checks on tool and agent permissions: each tool gets the narrowest IAM role and an allow-list of actions.
  • Prompt-injection test cases in the evaluation suite, including malicious instructions hidden inside retrieved documents.
  • Output filters for sensitive data, with guardrails such as Amazon Bedrock Guardrails or your own classifiers.
  • Logging that records prompts and outputs for debugging while redacting personal data.

4. Control cost before it controls you

Put budgets into configuration and enforce them at runtime: maximum input and output tokens per request, a maximum cost per request, and per-tenant or per-feature daily budgets with alerts. Emit token counts and estimated cost as metrics on every call. A dashboard that shows cost per feature and per customer turns a surprise invoice into an early warning.

5. Roll out model changes like code

Even with good offline evaluations, real traffic finds new failure modes. Send a small percentage of traffic to the new configuration, compare online metrics—error rate, latency, user feedback, escalation rate—and promote only if they hold. With Argo Rollouts, analysis runs automatically between steps and aborts the rollout if a metric breaches its threshold.

rollout.yaml (Argo Rollouts canary)yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: support-assistant
spec:
  replicas: 6
  strategy:
    canary:
      steps:
        - setWeight: 10
        - pause: { duration: 30m }
        - analysis:
            templates:
              - templateName: genai-health
        - setWeight: 50
        - pause: { duration: 1h }
        - analysis:
            templates:
              - templateName: genai-health
  selector:
    matchLabels:
      app: support-assistant
  template:
    metadata:
      labels:
        app: support-assistant
    spec:
      containers:
        - name: api
          image: 111122223333.dkr.ecr.us-east-1.amazonaws.com/support-assistant@sha256:<digest>
          env:
            - name: PROMPT_CONFIG_VERSION
              value: "14"

When the change is configuration only, a feature-flag service can route a percentage of requests to the new prompt version without redeploying. Either way, rollback must be a single, rehearsed action—reverting a config version—not an emergency code change.

6. Observe quality in production

Instrument every request with the prompt version, model ID, retrieved document IDs, token counts, latency, and outcome signals such as thumbs up or down, follow-up questions, and escalations to a human. Sample a share of conversations for review each week. When something goes wrong, you should be able to say which version produced the answer and why.

Finally, treat provider outages as a normal failure mode: set timeouts and retries with backoff, define a fallback model or a graceful degraded response, and test them, because an LLM dependency is still a network dependency.

Checklist

  1. Prompts, model versions, parameters, and index versions are reviewed files in Git.
  2. A regression evaluation suite runs in CI and blocks quality or safety regressions.
  3. Tools and agents have least-privilege permissions and injection tests.
  4. Token and cost budgets are enforced and visible per feature and tenant.
  5. Changes roll out through canaries with automated analysis.
  6. Rollback is a config revert that the team has practised.
  7. Production traces link answers to versions, sources, and cost.

The teams that ship GenAI fastest are not the ones that skip process—they are the ones whose process is automated enough that a prompt change is boring. We build these pipelines as part of our DevOps and platform engineering work so product teams can iterate on AI features with confidence.

Key takeaways

  • Version prompts, models, and retrieval indexes in git like application code.
  • Gate promotion on evaluation scores, cost budgets, and security checks—not only unit tests.
  • Roll back model/config changes with the same discipline as a bad application deploy.

FAQ

What belongs in an AI DevOps pipeline?

Prompt and model config versioning, automated quality/latency/groundedness evaluations, secret scanning, tool-permission policy checks, token or GPU budgets, and canary promotion with a clear rollback path.

How is this different from regular CI/CD?

You still need build and deploy automation, but you also treat non-deterministic model behaviour as a release risk—so evaluation gates and cost controls become first-class pipeline stages.

Need help putting this into practice?

Our engineers do this every week. Get a fixed-scope plan for devops & ci/cd services—free scoping call, written price before you commit.

Get a free scoping call