The Simplest Way to Make Vertex AI and dbt Work Like They Should
Using vertex ai and dbt together lets data teams build clean features and score data inside cloud warehouses. In this setup, dbt shapes raw records into tables, and Vertex AI runs machine learning models on that data. Many teams struggle to link their transformation steps with model calls. Data engineers build clean tables, while machine learning engineers run separate scripts in another project. Putting both tools in one shared flow removes extra copies of your data. Your warehouse stays the s
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Using vertex ai and dbt together lets data teams build clean features and score data inside cloud warehouses. In this setup, dbt shapes raw records into tables, and Vertex AI runs machine learning models on that data.
Many teams struggle to link their transformation steps with model calls. Data engineers build clean tables, while machine learning engineers run separate scripts in another project. Putting both tools in one shared flow removes extra copies of your data. Your warehouse stays the single source of truth for both analytics and predictions.
How permissions and data flow between vertex ai and dbt
Data flows between these two tools through your cloud data warehouse. First, a dbt job reads raw tables and builds clean feature tables. Next, the transformation run calls a remote model hosted in Vertex AI. Finally, the model sends predictions back to the warehouse as a new table.
To make this work, both tools need clear cloud roles. Your dbt service account needs permission to read warehouse tables and call the model endpoint. At the same time, the Vertex AI service account needs permission to read training tables and write output rows.
Teams often trigger these steps in two ways. For batch scoring, a SQL model calls a remote function that points to the cloud model. For model training, a Python model inside dbt submits a training job to the cloud API. Both paths keep your data lineage in one single graph.
Common failure modes and how to scope roles
The biggest risk in this setup is using one giant service account for all jobs. Teams often grant full admin rights to make a broken script run fast. If that key leaks, an attacker can read every table and change live models.
Shared accounts also ruin your audit logs. When ten analysts and five automated jobs share one key, every query looks the same in the log. You cannot tell which user or model run ran a high cost query. Unlogged queries also make it hard to spot when raw emails or phone numbers enter a training set.
AI Agent Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, split your service accounts by job and role. Give your dbt run role access only to the specific schemas it needs to build. Give your Vertex AI role read access only to approved feature tables. Never let a model training role read raw staging tables that hold card numbers or national IDs.
You should also lock down network paths between your warehouse and your model endpoints. Keep all traffic inside a private cloud network instead of sending rows over the public web. Set up strict data masking rules so that sensitive fields like emails or phone numbers get rewritten in query results before any job reads them.
Keeping model pipelines fast and easy to debug
When a pipeline fails, engineers waste hours checking two different dashboards. A dbt run might fail because a model endpoint timed out or hit a quota limit. Without clear logs, the data team blames the cloud team, and work stops.
You can prevent this by tagging every run with a clear job ID. Pass that tag from your transformation step to your model call. When a job fails, you can match the SQL error directly to the model log.
Test your schema changes in a small staging project before running them in production. If a developer drops a column in dbt, the downstream model will break right away. Running automated checks on input columns catches these errors early and keeps your production jobs stable.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Can dbt trigger a Vertex AI model run directly?
Yes, dbt can call cloud models using warehouse remote functions or Python models. The warehouse sends table rows to the model endpoint and writes the predictions back into a target table.
How should we manage keys between dbt and Google Cloud?
Avoid saving long lived JSON keys in your git repo or local laptops. Use workload identity federation or short lived tokens scoped to a single job role.
How do we keep sensitive data out of model prompts and training sets?
Filter and mask sensitive columns in your staging models before creating feature tables. Data masking rewrites matched fields like card numbers, national IDs, emails, and phone numbers in results.
Related guides
In this post