Databricks Well-Architected Agent
All decks Repo
01 / 16

Navigation

→ / SpaceNext slide
←Previous slide
HomeFirst slide
EndLast slide
SwipeTouch navigation
Click anywhere or press Esc to close

Is your Databricks workspace well-architected?

An agent that checks a workspace against proven reference patterns, tells you what is missing and why, and shows the exact Terraform to fix it. It can also build a new workspace from tested Terraform.
AzureGoogle CloudAWS Read-onlyRuns locallyMCP

Companion to the Well-Architected Agent README and simple guide. Community project, provided as is; not an official Databricks product.

The challenge

Workspaces drift from the design they were meant to have.

A team deploys a workspace "with Private Link". Months later, nobody can say for sure whether public access is really off, whether serverless can reach the whole internet, or whether the IP access list was ever turned on. The design review was a slide; the workspace is the truth.

Why this happens

Secure defaults are opt-in, settings live in three places (cloud, account, workspace), and each new workspace is rebuilt by hand from a different starting point.

Where the gaps show up

Controls left at their defaults

IP access lists off, serverless egress unrestricted, Unity Catalog not assigned, audit logs not delivered.

Reviews without evidence

A checklist says "done". Nothing records which API call or Terraform resource proved it.

Every new workspace is a one-off

Teams copy an old folder, change a few values, and inherit its gaps.

What it is

Rules, not a model. Same input, same report.

What the agent does

  • Reads a Terraform plan or state, or a deployed workspace (read-only).
  • Matches it to one of five reference patterns and scores it against the baseline you choose.
  • Gives a ranked prescription: every finding has evidence, the official doc, and the fix from this repo.
  • Writes a ready-to-run folder for a new workspace from tested Terraform, then verifies the result.

What it is not

Not a hosted service, not an LLM judging your setup, and not a tool that applies anything. It prescribes; you decide what to apply and run it yourself.

Design principles
PrincipleIn practice
DeterministicFindings come from rules in the catalog. No timestamps, stable sort: safe for CI gates.
GroundedEvery check cites an official doc (the loader refuses one that doesn't) and the tested Terraform that fixes it.
Never guessesA fact it can't see is UNKNOWN, with how to collect it. Never a false pass or fail.
Pattern-firstScored against an architecture, not a flat list, with the upgrade path to the next one.
AdvisoryRead-only. Fixes are Terraform or CLI for a person to apply.
How it works

From what you have to what to fix, in one deterministic pass.

Terraform plan or stateterraform show -json, before or after apply
Deployed workspaceread-only calls through your az, gcloud and databricks logins
→collectors
Factsnormalized per cloud; each records the command or resource it came from
→rules
Engine + catalogpatterns, checks and baselines in YAML; three-valued logic: pass, fail, unknown
→report
Prescriptiongaps in priority order, evidence, official docs, the fix from this repo, upgrade path

Merge several plans

Network in one root, workspace in another, guardrails in a third? Pass each plan; facts merge in any order.

Override what you know

An account-level fact no plan contains (audit log delivery, for example) can be set with --set path=value after you check it in the account console.

Draw what it deploys

wa-agent diagram turns any plan or state into a Mermaid architecture diagram and a resource manifest.

Baselines

Five baselines, with the same names on every cloud.

A baseline is what the workspace is supposed to be. Classic means compute runs in a VNet or VPC you bring; serverless means it runs in the Databricks serverless compute plane.

BaselineWhat it isAzureGoogle CloudAWS
serverlessNo customer network; a VNet or VPC only for a private front-endserverlessserverless-ws + guardrailsserverless-ws + guardrails, or the SRA
classic-no-plYour network, no Private Link; public front-end limited to your IPsnon-plinfra4db + byovpc-ws, or lpwdatabricks-aws-production + guardrails
classic-backend-plBack-end Private Link only; public front-end limited to your IPsassess onlyassess onlyassess only
classic-full-plFront-end and back-end Private Link; public access off, or on for selected clientsfull-privatebyovpc-psc-*, or lpwdatabricks-aws-production + guardrails, or the SRA
classic-depData exfiltration protection: controlled egresshub-spoke firewall, assessedVPC Service Controls, assessedthe SRA, isolated network
Assess only means the agent scores a workspace against it but has no build for it: every Private Link root in the repo also adds the front-end, so it builds classic-full-pl. Azure and GCP classic-dep are assessed against the Databricks data exfiltration protection guides.
Bare minimum and options

Three controls everywhere. The rest is your choice.

An IP restriction on any public front-end

IP access lists from your known ranges (corporate egress, VPN, automation, your Terraform runner). On AWS, context-based ingress limited to them also counts. 0.0.0.0/0 is refused.

Enforced serverless egress

A network policy in RESTRICTED_ACCESS, enforced, bound to the workspace, so serverless compute reaches only the destinations you allow.

Unity Catalog

A metastore assigned to the workspace: one governance layer for data, AI and access.

Required in every baseline on every cloud; they can't be waived, and every build turns them on.

OptionAdds
public-accessOn classic-full-pl: keeps the public front-end on for selected clients, behind your IP ranges; front-end Private Link stays.
cmkCustomer-managed keys for managed services, workspace storage and disks.
data-leakNotebook export, results download and the notebook table clipboard turned off.
context-ingressAllow and deny rules on identity, request type and network source, on top of IP access lists.
storage-lockdown, storage-privateAzure: workspace storage firewall and service endpoint policy; private endpoints from serverless to your storage.
A chosen option makes its controls required (--option <id>); options you don't choose show as recommended. Where a build has no setting for an option, the run book lists it as a manual step.
Pick a baseline

Three questions get you to the right one.

Do you need classic compute in your own network?
no →
serverless
yes ↓
Must all egress be inspected, or have no internet path at all?
yes →
classic-dep
no ↓
Should users reach the workspace privately?
yes →
classic-full-pl
no ↓
Public front-end, limited to your IP ranges
→
classic-no-pl

Compute mode is fixed at creation

A baseline whose compute mode differs from the workspace (say, serverless on a classic workspace) is flagged: moving between them means a new workspace.

Not sure? Don't pick one

With no --baseline, the workspace is scored against the pattern it is detected as, with the upgrade path to the next tier.

See it in plain language first

wa-agent show classic-full-pl lists every control by area (Network, Storage, Unity Catalog and so on), required or recommended, with its options and builds.

When to use it

Before you deploy, while you build, and once it runs.

1
Review Terraform before applying

Catch gaps in a plan before anything exists: collect tfplan, then assess.

2
Build a new workspace, then verify it

new writes the folder; you run terraform apply; verify checks the state did what the baseline requires.

3
Health-check a running workspace

collect live reads it with allow-listed read commands only; assess scores it. Azure and Google Cloud; on AWS, use the workspace's Terraform state.

4
Gate a pipeline

assess --format json --fail-on-gaps fails the build on any required gap.

# 1 · before deploying (any cloud)
terraform show -json tf.plan > plan.json
uv run wa-agent collect tfplan --cloud aws --plan plan.json -o ws.facts.json
uv run wa-agent assess --cloud aws --facts ws.facts.json --baseline classic-full-pl

# 2 · after apply
uv run wa-agent verify --tf-json state.json --baseline classic-full-pl --option cmk

# 3 · a running workspace (Azure, GCP)
uv run wa-agent doctor --workspace <name-or-url>
uv run wa-agent collect live --cloud gcp --workspace <name-or-url> -o ws.facts.json
uv run wa-agent assess --cloud gcp --facts ws.facts.json

Preflight first

doctor --workspace resolves the workspace, matches your CLI logins, tries each data source and says how to fix what's missing, before you scan.

Reading a report

Most important first, with the proof and the fix.

SectionWhat's in it
PrescriptionEvery gap in order: required before recommended, then by severity.
Gaps against targetEach failed check: evidence, planning-guide phase, official docs, the repo fix.
Beyond targetWhat the workspace does above its baseline.
Not evaluableWhat it couldn't see, and the access or plan that would show it.
Passed, not applicableThe rest, so nothing is silently skipped.
Coverage by phaseOrganized by the Databricks production planning guide.
PASSFAILUNKNOWNNOT APPLICABLE
One finding, from the demo report
AZ-ING-001 — IP access lists restrict the public front-end
required · high · security · phase 4 Network · fix: in_place

Evidence
access.ip_access_lists_enabled = false
  from databricks workspace-conf get-status enableIpAccessLists

Fix (ground-truth repo, tested)
module "workspace" {
  enable_ip_access_lists = true
  allowed_ip_ranges      = ["203.0.113.0/24"]
}

Try it now

uv run wa-agent demo prints a full report from a real, sanitized Azure workspace. No setup, no cloud access.

New workspaces

A ready-to-run folder from tested Terraform, never generated code.

uv run wa-agent new --cloud aws --baseline classic-full-pl \
  --build awsdb4u --option cmk --out ./my-ws \
  --set region=us-west-2 \
  --set allowed_ip_ranges='["203.0.113.0/24"]'
In the folderPurpose
terraform/The repo's tested Terraform, copied as-is (never state or local tfvars)
inputs-*.tfvarsRequired values; anything you didn't answer is a REPLACE_ME_*
stage-N-*.tfvarsThe baseline's settings, one file per stage, in apply order
README.mdRun book: sign in, plan, assess the plan, apply, verify

Your IP ranges are required

The run book can't turn on IP access lists without them, so new asks and never invents a default.

Secrets stay in the environment

Account IDs and client secrets come from TF_VAR_* and DATABRICKS_* variables; they are never written to a file.

Wired and checked

Later roots read values such as workspace_url from the previous root's terraform output. CI resolves every emitted value against the real Terraform, for every build and option.

Builds

Where a baseline has several builds, you choose.

Azure

One build per baseline from adb4u/deployments: non-pl, full-private, and serverless (no VNet, the same ARM call as the SRA serverless module).

Google Cloud

new-vpc and existing-vpc (standard creation: Databricks creates the IAM roles and firewall rules) or lpw, the least-privilege workspace, for teams that must create those themselves. serverless-ws for serverless.

AWS

awsdb4u: databricks-aws-production or serverless-ws, then workspace-guardrails. Or sra, the Databricks Security Reference Architecture, which is also the only classic-dep build.

The SRA: the one build from outside this repo

Pinned to a full commit and never copied (it has its own licence). The run book clones that commit; the folder holds only your inputs and stage settings. CI checks that the variables the catalog records still match the SRA at that commit.

Known gaps are stated up front

The SRA keeps the public front-end on, limited to your IP ranges by context-based ingress, so its private builds list "public access off" as a known gap. Choose public-access to hold the workspace to that design.

Coverage

What works on each cloud today.

CapabilityAzureGoogle CloudAWS
Plan and state reviewyesyesyes
Architecture diagramyesyesyes
New workspace and verifyyesyesyes (awsdb4u, sra)
Live, read-only scanyesyesno, by design: checked from Terraform state
Data exfiltration protectionhub-spoke firewall, assessedVPC Service Controls and restricted.googleapis.com, assessedno internet path or a firewall, S3 endpoint policy; built with the SRA

Every fix states how proven it is

tested deployed and verified by the repo owner (the default). validated terraform validate and mock-provider tests only, not yet applied. The new workspace-guardrails and serverless-ws roots on GCP and AWS are labelled validated.

Organized by the planning guide

Checks map to cloud-neutral controls, by phase of the Databricks production planning guide and by pillar of the Well-Architected Lakehouse framework.

In your AI assistant

Ask in plain English. The answer still comes from the rules.

The agent has no LLM inside, so it works the same under any assistant. Your assistant calls its tools over MCP and relays the report. Every tool is read-only and none writes files.

# register once (doctor prints this with your path)
claude mcp add --scope user databricks-wa -- \
  uv run --quiet --frozen --project /abs/path/well-architected-agent wa-agent-mcp

Also Codex CLI, Cursor, Gemini CLI and VS Code: the repo includes their configs.

Ten tools

list_baselines describe_baseline list_patterns preflight collect_live collect_tfplan assess verify diagram new_workspace

Things to ask

"What does classic-full-pl require, and what does the cmk option add?"

"Preflight workspace prod-ws, then assess it against classic-full-pl with public-access, and list the required gaps."

"Assess ./tf.plan.json against serverless before I apply, and draw what it deploys."

"Compare the awsdb4u and sra builds of classic-full-pl on AWS."

The bundled AGENTS.md tells assistants to relay findings unchanged, ask you for the baseline, options and IP ranges, and never apply anything.

Safe by construction

It can't change anything, and it doesn't phone home.

1 · Never changes anything

Only allow-listed read commands can run (READ_ONLY_COMMANDS, one table per cloud). It never runs Terraform and never overwrites a file. Tests enforce all three.

2 · Grounded, with evidence

Every check cites an official doc and, where it exists, the tested Terraform here. Every fact records the command or resource it came from.

3 · You decide

The agent prescribes. Choosing what to apply, and when, is yours.

Runs on your machineNo hosted service, no account to create. macOS, Windows and Linux, tested in CI on all three.
No telemetryThe only network calls are read-only calls to your tenant through your own CLI logins.
No credentials handledIt never asks for, stores or prints keys or tokens.
Safe to sharedoctor output is redacted: IDs, AWS account IDs and ARNs, names, emails, tokens.
Your data stays localFacts and reports go only where you choose and are git-ignored by default. Through an assistant, results go to that assistant's model provider under its terms.
Scope and design choices

What it assesses, what it builds, and how it reads.

Assessed, not built

Back-end-only Private Link everywhere, and data exfiltration protection on Azure (hub-spoke) and Google Cloud (VPC Service Controls), are scored against the official guides; the repo has no root for them.

Plans are matched by resource type

Resource IDs exist only after apply, so a few resources are matched by address name. Live scans match exactly. A VPC managed in another root makes its checks not evaluable until you add that plan.

Firewall rules are checked for presence

The agent follows egress to the firewall and checks it has rules and logs; it doesn't compare each destination with the published Databricks list.

Context-based ingress is a how-to

The check passes on enforced ingress rules; ingress_dry_run is for testing and doesn't count. The report gives the Terraform to add them, starting in dry run.

Account-level facts can be outside a plan

Audit log delivery, for example, often lives in another root: add that plan, or set the fact after checking the account console.

AWS is assessed from Terraform

Plans before apply, state after. There is no live AWS scan: a running workspace is checked from its terraform show -json state.

Getting started

Three steps, any OS.

1
Install uv and clone

brew install uv or winget install astral-sh.uv, then git clone https://github.com/bhavink/databricks.git and cd databricks/well-architected-agent. uv brings everything else.

2
See it work

uv run wa-agent demo: a full report from a real, sanitized workspace, with no setup and no cloud access.

3
Point it at yours

uv run wa-agent doctor checks tools and logins; then assess a plan, scan a workspace, or run new for a fresh one. Every command has --help.

Read next

Problem or question?

Open an issue and paste the output of wa-agent doctor: it's redacted for you.

Community project, provided as is, without warranty. Not an official Databricks, Microsoft, Google or AWS product. You are responsible for reviewing and testing anything you apply.