Skip to content

Agents ​

An Agent runs one of your custom agents as a step in a stage. Use it for work that needs judgment, such as summarizing what a release changes or reviewing it against a runbook. The agent returns a structured response that the rest of the pipeline can read.

To gate a stage on its preview, use a decision gate.

Each agent run counts toward your organization's Pulumi Agents usage and its usage limits.

Adding an agent to a stage ​

An Agent names its stage, the custom agent to run, the prompt to send it, and a responseSchema that its final answer must match. This example asks a release-notes agent to summarize each release in prod, then publishes the summary as an artifact:

typescript
const notes = new delivery.Agent("releaseNotes", {
    stage: prod,
    agentDefinitionId: "<your-agent-id>",
    prompt: "Summarize the user-facing changes in this release.",
    responseSchema: {
        type: "object",
        properties: { summary: { type: "string" } },
        required: ["summary"],
    },
});

new delivery.Artifact("releaseSummary", {
    stage: prod,
    value: notes.response.apply(r => r["summary"]),
});

The agent runs with the role, connected tools, and saved instructions of your custom agent. Its prompt can accept outputs from the stacks and jobs earlier in the pipeline run.

How an agent runs ​

Delivery starts the agent after the release enters the stage and the outputs the agent depends on are ready. The agent's response is defined by responseSchema and returned as the response output. Downstream resources can use response the same way they use a job's outputs.

Next steps ​

Content from the official Pulumi documentation (github.com/pulumi/docs).