The Simplest Way to Make Phabricator and Pulumi Work Like They Should
Teams pair Phabricator and Pulumi to review and run cloud changes through code. This setup runs cloud previews on each code diff and applies updates after review. Phabricator tracks code reviews, tasks, and repo rules for your team. Pulumi reads your code to build and update cloud apps and servers. When you join them, every cloud change goes through a peer review first. Reviewers see the exact cloud diff before they approve the code change. How phabricator and pulumi share keys and data The
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.
Teams pair Phabricator and Pulumi to review and run cloud changes through code. This setup runs cloud previews on each code diff and applies updates after review.
Phabricator tracks code reviews, tasks, and repo rules for your team. Pulumi reads your code to build and update cloud apps and servers. When you join them, every cloud change goes through a peer review first. Reviewers see the exact cloud diff before they approve the code change.
How phabricator and pulumi share keys and data
The link between phabricator and pulumi starts when a coder sends a code diff. Phabricator triggers a build task in your build runner for that diff. The build runner then starts a Pulumi preview run using cloud keys. Pulumi checks the current cloud state and compares it to the new code.
Next, the build runner sends the preview output back to the Phabricator review page. Reviewers read the planned cloud changes right next to the code lines. They can spot bad settings or dropped servers before any real change happens. Once a reviewer approves and lands the diff, the runner triggers a full update.
This flow needs two sets of keys to work well. First, the runner needs an API token to post comments back to Phabricator. Second, Pulumi needs cloud keys and a state key to read and write resources. Keeping both sets of keys safe is the main job for platform teams.
Common risks with shared keys and wide roles
Many teams put long-lived cloud keys right into their build runner storage. Every diff run then uses the same wide admin role to check cloud state. If a bad actor writes code in a diff, that code runs during preview. The preview step can then steal those wide keys or change live resources.
Shared bot tokens in Phabricator also create blind spots in your audit logs. When every run uses one bot account, you lose track of who ran what. You cannot tell which coder triggered a specific cloud API call during a failure. Teams also struggle when secret keys sit in plain text inside build logs.
Pulumi Policy as Code + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, split your preview roles from your update roles right away. Give the preview runner a read-only cloud role so diffs cannot write state. Scope your update runner to run only on the main branch after merge. Map each build run to the actual coder identity in your central logs.
How to set up safe branch rules and state checks
Start by locking down who can trigger a build run from a code diff. Set Phabricator repo rules to require at least one peer check before landing code. Make sure the build runner checks the branch name before loading any write keys. Preview runs on feature branches should never touch write keys for production stacks.
Store your Pulumi state in a locked backend with strict role checks. Set up separate stacks for test, stage, and live workloads with distinct keys. Rotate your Phabricator bot tokens and cloud keys on a fixed schedule. Check your runner logs each week to find failed logins or odd state reads.
When teams also query live databases during deploys, protect sensitive fields in results. Data masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs. This keeps private user details out of your build logs and review comments.
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 do we show Pulumi previews on Phabricator diffs?
Your build runner runs the preview step when a coder creates a new diff. The runner takes the text output and sends it to the Phabricator comment API. Reviewers then see the planned cloud changes as a comment on the diff.
Should preview runs and update runs use the same cloud role?
No, preview runs should only use a read-only role to check cloud state. Only the post-merge job on your main branch should hold write permissions. This stops untrusted code in a draft diff from changing live cloud resources.
How can we track which coder triggered a cloud change?
Pass the author identity from the Phabricator diff metadata into your build runner tags. Record that user tag in your Pulumi stack tags and cloud audit logs. This links every cloud resource update back to the person who wrote the code.
Related guides
In this post