---
title: "Delivery + Agents: From PR to production"
description: "When a change fails in Pulumi Delivery on the way to production, Pulumi Agents can pick up from there to debug the issue and get a fix up for review."
url: "https://www.pulumi.com/dev/videos/pulumi-delivery-and-agents-tour/"
image: "https://www.pulumi.com/assets/images/dev/videos/pulumi-delivery-and-agents-tour.webp"
---

# Delivery + Agents: From PR to production

When a change fails in Pulumi Delivery on the way to production, Pulumi Agents can pick up from there to debug the issue and get a fix up for review.

- Watch on YouTube: https://www.youtube.com/watch?v=ekDcolwOHzA
- Product tour, 2:57

In this video, Adam shows you how Delivery and Agents can work together to let you bring agents into your workflows and ship faster without having to give up safety or control.

## Transcript

### 0:00 A coding agent's pull request

Coding agents, building software has gotten a lot easier, but getting infrastructure changes into production can still be quite challenging. So, let me show you a better way. Here's my app. It's a small app backed by an API. It's on AWS Lambda. Each stage has its own stack so that I can safely roll out changes, but it's a bit slow. So, I asked my coding agent Claude to make the API faster. It opened this pull request right here where it adds more memory and provisioned concurrency. It looks reasonable, and so I merge it.

### 0:28 The release process, in code

Getting a merged change into production goes through a few stages. That used to be a messy deploy script that nobody wanted to touch, but Pulumi Delivery lets me take that out of bash and write it as proper code in TypeScript and lives right alongside my app. So, every merge to main starts as a release. It deploys to dev and then it runs a smoke test and then staging and then a smoke test and then I have an approval gate and then for production I loop over two regions. It's easy to build the release process you want in Pulumi Delivery.

### 0:57 Staging catches the mistake

So now I can see my change going through the pipeline. It passes dev, but look, it failed in staging. My coding agent has made a mistake. Provisioned concurrency actually needs a published version and it was pointing at latest. Because I wasn't using concurrency in dev, I didn't actually catch it until staging. So dev never caught it, but thankfully my delivery pipeline did catch it before it got to production.

### 1:19 Why not have the agent fix it?

And normally I'd have to go out and debug this, but if agents are writing changes, why not have the agent fix them too? And you can see that process is already started less than a second after it happened.

### 1:30 Pulumi Agents: the deploy troubleshooter

That is Pulumi Agents. I can put an agent on a specific job with its own role and its own instructions and it's starting work on its own. Pulumi provides agents for jobs like this or I can define my own. This one is a deploy troubleshooter. It's defined in code. It lives in the same repo as my infrastructure and my Pulumi Delivery code. Its instructions are pretty simple. You know, read the failed update, open a pull request to fix it. It has a specific role where it can read the stacks, it can read their history, but it can't deploy and I have to approve its changes.

### 2:00 The fix, under three minutes later

Okay, so under three minutes after that failure, there is a pull request. Here's what my coding agent changed and here's the fix that my Pulumi agent did, publishing a version and point the concurrency at it.

### 2:12 Approve and ship to production

So I review the fix and I merge it and we start a new release. We're going down the same path. Dev passes. This time staging passes too. Then it stops at the approval gate. I can see a preview of exactly what will change in production and I approve it and it rolls out to both my prod regions.

### 2:28 What just happened

So think about what just happened. A coding agent wrote a change and Pulumi Delivery stopped it before it hit production, even though I approved it. Then a Pulumi agent found the problem, proposed a fix and then those rules are all defined in code, both the pipeline and the agent. I reviewed the fix. I approved the release. The agents let me move fast, but the pipeline keeps them safe and I get to decide what actually ships.
