Deployment, CI/CD and Troubleshooting

Make every release repeatable, tested and reversible, and know where to look when it is not.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

Keep agent code, configuration and platform resources in version control. Use the Agent Bricks CLI to develop and deploy agents, and Declarative Automation Bundles, formerly Asset Bundles, to define resources per environment. A pipeline running as a service principal promotes changes only when evaluation and security gates pass, with a tested way to roll back.

What you will learn: the delivery tools and their names, repository layout, environment targets, pipeline stages, release gates, migration from older deployment paths, production operation and systematic troubleshooting.
Prerequisites: Architecture, Mosaic AI, Agent Framework and Agent Bricks and CI/CD for agents.

Versions used

The example runs in November 2026 with Python 3.13 and only the standard library. It renders invented environment settings and applies invented gates; it does not call the Databricks CLI. Tool names and behavior come from Databricks documentation and release notes checked on November 28, 2026. Command options change between CLI versions, so pin the version in your pipeline. OneSmartClick is independent of Databricks.

Beginner Tools and a first release

Why a pipeline

An agent is more than code. Its behavior depends on prompts, model endpoints, tools, search indexes, permissions and data. If some of these are changed by hand in a screen, nobody can say what changed when quality drops. A pipeline gives one reviewed path: propose a change, test it, deploy it the same way everywhere and record the result.

The tools

ToolRole
Agent Bricks CLICreate agent projects, run them locally and deploy them
Declarative Automation BundlesDescribe platform resources and deploy them to named targets
Databricks CLIRuns bundle commands and many administrative operations
Git and your CI systemReview, test and trigger deployments
MLflowEvaluate versions and record results

Databricks bundle release notes record that Databricks Asset Bundles were renamed Declarative Automation Bundles in March 2026. The short form DABs still works as shorthand, and commands begin with databricks bundle.

A first deployment

  1. Create a project with agentbricks init, choosing a framework template.
  2. Run it locally with agentbricks dev and test with harmless data.
  3. Review the resources and permissions the project declares.
  4. Deploy to a development workspace with agentbricks deploy.
  5. Call the endpoint, read the traces and confirm the identity used for each tool.

The deployment documentation describes the deploy command as provisioning resources, granting the agent access and publishing an authenticated endpoint. Convenient automation still needs review: read the grants it creates and check them against your policy.

Lay out the repository

FolderContains
agent/Agent logic, tool wrappers and server code
prompts/Versioned instructions
resources/Bundle definitions for jobs, indexes, databases and Genie Agents
sql/Views, functions and migrations
evals/Datasets, scorers and thresholds
tests/Unit, contract, permission and safety tests
docs/Runbook, owners and architecture decisions

The names are a suggestion. What matters is that a reviewer can see everything that changes behavior, and that no secret is stored there.

Intermediate Environments and pipelines

Targets for each environment

A bundle can define targets, so that the same definitions deploy to development, staging and production with different values. Release notes list growing resource coverage, including Genie Agents, vector search endpoints and indexes and Lakebase projects and branches, and Python as a way to define resources. Keep the differences between targets few and visible: catalog names, identity, sizes and limits. Every extra difference is something staging does not test.

Pipeline stages

CommitReview change
TestFast checks
StageDeploy copy
ScoreEvaluate
ReleaseApprove
Each stage can stop the change. Production receives only what staging tested.
StageChecks
On every changeUnit tests, schema checks, secret scanning, bundle validation
Before mergeCore evaluation cases with stubbed side effects
StagingIntegration, permissions with real roles, full evaluation, load test where relevant
Production gateThresholds met, regressions reviewed, approver recorded
After releaseSmoke test, sampled scoring, error and cost watch

The command databricks bundle plan previews changes before they are applied. Read the plan, particularly deletions and permission changes. Release notes also describe deploying selected resources only, while saying that option is not intended for production.

Pipeline identity and secrets

Deploy with a dedicated service principal, authenticated by your CI system with short-lived credentials where supported. Give the deployment identity the right to manage the resources it owns, and give the running agent a separate, much smaller set of rights. A pipeline that can grant anything to anyone is a high-value target: protect its configuration, require review for workflow changes and keep untrusted pull requests away from credentials. See supply chain risks.

Render targets and apply gates

The program merges base settings with each target and refuses a production release that uses a personal identity, turns tracing off, misses a score threshold or adds a tool that staging never exercised.

"""Render per-environment settings and apply release gates."""
import json

BASE = {"agent": "support", "model": "small", "max_steps": 8,
        "tools": ["search", "ticket_lookup"], "tracing": True}
TARGETS = {
    "dev": {"catalog": "dev", "run_as": "developer@example.com"},
    "staging": {"catalog": "staging", "run_as": "sp-staging"},
    "prod": {"catalog": "prod", "run_as": "sp-prod", "max_steps": 6,
             "tools": ["search", "ticket_lookup", "ticket_close"]},
}
THRESHOLDS = {"correct": 0.90, "safe": 1.00}


def render(target):
    return {**BASE, **TARGETS[target], "target": target}


def gates(config, scores, tested_tools):
    problems = []
    if config["target"] == "prod":
        if "@" in config["run_as"]:
            problems.append("prod must run as a service principal")
        if not config["tracing"]:
            problems.append("tracing is off")
        extra = sorted(set(config["tools"]) - set(tested_tools))
        if extra:
            problems.append(f"untested tools: {', '.join(extra)}")
    for name, floor in THRESHOLDS.items():
        if scores.get(name, 0) < floor:
            problems.append(f"{name} {scores.get(name, 0):.2f} < {floor:.2f}")
    return problems


staging = render("staging")
scores = {"correct": 0.93, "safe": 1.0}
prod = render("prod")
print(json.dumps(prod, indent=1, sort_keys=True))
for name, config in (("staging", staging), ("prod", prod)):
    problems = gates(config, scores, tested_tools=staging["tools"])
    print(f"{name}: {'PASS' if not problems else 'BLOCK'}")
    for p in problems:
        print("  -", p)

Output:

{
 "agent": "support",
 "catalog": "prod",
 "max_steps": 6,
 "model": "small",
 "run_as": "sp-prod",
 "target": "prod",
 "tools": [
  "search",
  "ticket_lookup",
  "ticket_close"
 ],
 "tracing": true
}
staging: PASS
prod: BLOCK
  - untested tools: ticket_close

Production is blocked even though the scores pass, because its settings add a ticket-closing tool that staging did not include. This kind of drift between environments is easy to create with a small override and hard to spot by reading scores. Gates should compare what will run with what was tested, using the same identifiers for code, prompts, models and tools.

Expert Release strategy, migration and troubleshooting

Gates that mean something

  • Evaluate the exact build that will be released.
  • Include data and index versions, since they change behavior.
  • Test permissions and forbidden actions directly.
  • Require a person for new write tools, wider grants and model changes.
  • Fail closed when the evaluation job itself fails.
  • Keep results with the release so that they can be audited.

Roll out and roll back

Release to a small audience first, compare quality, errors, latency and cost with the current version, then widen. Decide in advance which signals trigger rollback and who may do it. Rolling back code is easy when versions are recorded; rolling back effects is not. Database migrations should be compatible with the previous version, indexes may need to be rebuilt, and actions already taken, such as closed tickets, need their own correction process. Promotion and rollback explains the patterns.

Moving off older paths

Older pathDocumented direction
Agent on a Model Serving endpointLabeled legacy; migrate to Databricks Apps
Earlier application-template agent serverKeep for existing agents; new agents use the CLI path
Supervisor APIEnd of life September 30, 2026; write the loop and deploy it
Terraform-based bundle engineNew bundles from CLI 1.3.0 use the direct engine by default; a migrate command exists

For each migration, freeze the evaluation set, run it on both versions, compare permissions identity by identity and move traffic gradually. Authentication often differs between hosting paths, so test user authorization again rather than assuming it carries over.

Operate in production

  • Name an owner and an on-call route for each agent.
  • Watch request errors, tool failures, limit hits, latency, cost and quality scores.
  • Set timeouts and step limits so that a run cannot continue indefinitely.
  • Test what happens when a model, warehouse, index or database is unavailable.
  • Keep a switch to disable a tool or the agent.
  • Review platform release notes and retirement notices.

Troubleshooting method

Narrow the layer before changing anything: did the request reach the application, did the server accept it, did the agent logic run, which call failed and as which identity? Reproduce with one saved request and compare with the last release that worked.

SymptomCheck first
Deployment failsCLI version, bundle validation output, deployer permissions, quotas
Application starts then stopsApplication logs, dependency versions, missing configuration
Unauthorized or forbiddenWhich identity, missing grant or dependency, user authorization scopes
Endpoint not foundRetired model, wrong region or target, renamed resource
Rate limit errorsGateway limits, retries amplifying load
Works locally onlyLocal credentials hiding grants, network access, environment values
Quality dropped without a releaseModel change, data load, index sync, permission change
Slow responsesSpan timings: model, warehouse start, search or tool
Costs jumpedStep counts, loops, context growth, new traffic

Record each resolved fault with symptom, cause, evidence and the test added. The runbook and failure catalog gives a format, and tool-calling errors covers a common class.

Coding agents in the delivery loop

The platform documentation mentions iterating with coding agents. They can scaffold code and explain errors quickly. Treat their changes like anyone else's: review them, run the same gates and keep production credentials away from interactive sessions. Give them a development workspace with limited data. Coding agent safety lists controls.

A release manifest

For every production release, write one record that a person can read during an incident. Generate it from the pipeline so that it cannot drift from what actually ran.

EntryWhy you will want it
Source commit and build identifierReproduce the exact code
Library and CLI versionsExplain dependency changes
Prompt versionsExplain behavior changes
Model endpoints and settingsCompare outputs and cost
Tools, functions and MCP endpointsKnow what the agent could do
Index, table and schema versionsRelate answers to data
Identities and grantsInvestigate access
Evaluation results and approverShow why it was released
Previous good releaseRoll back without searching

Compare the manifest of the new release with the previous one before approval. A short list of differences is the most useful review aid a pipeline can produce: reviewers can concentrate on the new tool, the wider grant or the changed model instead of reading everything again.

Releasing data changes

Data and indexes often change more frequently than code, and they can alter behavior just as much. Give pipelines their own checks: schema contract, row counts, quality rules and a fixed set of retrieval and query questions. Publish a new version beside the current one where the cost allows, test it and switch. Where a continuous sync makes that impractical, monitor closely and keep a way to pause synchronization and exclude bad records at query time. Record data changes in the same timeline as code releases, so that an investigator sees both.

A worked troubleshooting case

An invented team reports that after a release, the agent answers policy questions but fails every order lookup. The request reaches the application and the model chooses the lookup tool, so the application and routing are working. The tool span shows a permission error under the production service principal. Staging had passed because its principal held a schema-wide grant added during debugging months earlier. The release had moved the function to a new schema, and production had no usage privilege there.

The immediate fix is the missing grant, added through the repository. The lasting fixes are to remove the broad staging grant, make staging and production grants come from the same definitions and add a pipeline test that calls every tool with the runtime identity. One incident exposed a difference between environments, which is the thing a staging stage exists to prevent.

Start small, then add rigor

A new team does not need every control on the first day. A sensible order is: put the project in version control; deploy to development from a command that anyone on the team can run; add a pipeline that deploys to staging with its own identity; add a small evaluation gate; then add production with approval, rollback and monitoring. Do not connect real users or write tools before the last step is in place. Each step removes a manual action that could otherwise differ from one release to the next.

Review the pipeline itself every few months. Remove checks that never fail and tell you nothing, repair checks that people routinely override and add one for every incident that slipped through. A gate that is regularly bypassed provides the appearance of control without the substance, so treat each override as a signal and record why it was needed.

What the runbook needs

  • Purpose, owners and users.
  • Where code, traces, dashboards and cost views are.
  • How to disable, roll back and redeploy.
  • Known failure modes and their first checks.
  • Dependencies and their owners.
  • Escalation, including privacy and security contacts.

Common mistakes

MistakeConsequenceInstead
Editing production by handDrift and mystery regressionsChange the repository and redeploy
Deploying as a personBreaks when they leave; wide rightsService principals
Different tools in production than stagingUntested behaviorCompare manifests in a gate
Unpinned CLI and librariesSudden pipeline failuresPin and upgrade deliberately
Rollback never triedLong outagesRehearse it
Fixing without reading tracesGuessworkLocate the layer first

Checklist

  • All behavior-changing assets are in version control.
  • Targets differ only in intended, visible ways.
  • Deployer and runtime identities are separate and small.
  • Gates evaluate the exact build and tool set.
  • Rollback covers code, data changes and effects.
  • Legacy paths in use have a migration plan and date.
  • The runbook has been followed by someone other than its author.

Frequently asked questions

Do I need bundles if I use the agent CLI?

The CLI handles the agent's deployment. Bundles help define surrounding resources consistently across environments. Check current documentation for how the two work together in your version.

Can I deploy from my laptop?

That suits personal development. Shared and production environments should be deployed by a pipeline with its own identity and a record of approvals.

How long should staging tests take?

Long enough to cover important cases and short enough that people run them. Split fast checks on every change from slower full evaluation before release.

What if the evaluation score varies between runs?

Run several trials, report the spread and base gates on consistent passes for critical cases. Investigate cases that flip.

References

Where to go next