The Simplest Way to Make Pulumi and Vertex AI Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using pulumi and vertex ai together lets teams manage machine learning setups with code. This pair automates model endpoints, data stores, and network rules in one workflow. Data scientists often build models by clicking around in a cloud console. That slow habit causes drift when moving apps to production. Writing code to build your cloud tools fixes this problem fast. Every change goes through a git review before it runs. Your team gets a clear record of who built each model endpoint. How i

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 pulumi and vertex ai together lets teams manage machine learning setups with code. This pair automates model endpoints, data stores, and network rules in one workflow.

Data scientists often build models by clicking around in a cloud console. That slow habit causes drift when moving apps to production. Writing code to build your cloud tools fixes this problem fast. Every change goes through a git review before it runs. Your team gets a clear record of who built each model endpoint.

How identity and data flow in pulumi and vertex ai

Pulumi talks to Google Cloud APIs to build and update your resources. It needs a cloud identity with the right roles to do this work. Most teams use a dedicated service account for their build pipelines. The pipeline logs in using workload identity federation instead of static keys. Once logged in, the tool reads your state file and checks the cloud.

Next, it sends API calls to set up your machine learning tools. It can create storage buckets, feature stores, and private model endpoints. You also define a separate service account for the model itself. That model identity gets read roles for training data in cloud storage. Data flows from your buckets into the training job over private networks. The build tool tracks every dependency so resources start in the right order. Storage buckets finish building before the training job tries to read them.

Common failure modes and how to scope roles

Many teams fail by giving one shared service account too much power. They attach broad editor or owner roles to make deployments work fast. If an attacker steals that token, they can read all company data. Shared accounts also ruin your audit logs during a security review. You cannot tell which engineer or pipeline ran a bad update.

Another common mistake is leaving model endpoints open to the public internet. Unlogged queries to these endpoints can leak data or run up huge bills. You can fix this by splitting roles between build time and run time. Give your deployment pipeline only the permissions needed to create AI resources. Give each running model its own narrow identity with read-only data access. Put your endpoints inside a virtual private cloud to block outside traffic. Turn on cloud audit logs for all admin steps and data reads. Check your state file storage and lock it down to specific users. Encrypt the state backend so plain text secrets do not leak out. Finally, add masking rules to rewrite emails, phone numbers, and card numbers.

Pulumi Policy as Code + AI Agent Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing state and drift across team setups

Machine learning projects change fast as teams test new prompts and weights. Engineers often tweak settings in the cloud console during an outage. Those manual clicks create drift between your code and the real cloud. The next time the pipeline runs, it might overwrite those manual fixes. Worse, a sudden update can take down a live prediction endpoint.

You can stop drift by removing human write permissions in production projects. Let engineers read logs and metrics, but force all changes through code. Run automated checks on every pull request to preview resource changes first. This preview shows if an update will delete and rebuild an endpoint. Separate your base network stack from your fast-moving model deployment stack. That way, a broken model update will never break your core network rules. Small stacks also run faster and limit the blast radius of bad code.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How should we store secrets for our machine learning pipelines?

Use your cloud secret manager or encrypted state values for all sensitive keys. Never put plain text API keys or passwords inside your source code files.

Why did my model endpoint rebuild from scratch during an update?

Some cloud settings cannot change in place after you create the resource. Check the preview diff before deploying to see which changed field forces replacement.

How do we stop data scientists from using overly broad cloud roles?

Give humans read-only roles in production and run all updates through automated pipelines. Use custom roles that grant access only to specific storage buckets and models.

The query runs. The emails stay hidden.