Agentic Pipelines

Agentic Pipelines is in beta.

Agentic Pipelines lets you embed AI agents directly into your Bitbucket Pipelines steps. These agents can analyze your code, troubleshoot failing pipelines, generate release notes, fix flaky tests, and more — all while running in your existing CI/CD workflows.

With Agentic Pipelines, you define agents in bitbucket-pipelines.yml and run them non‑interactively inside a pipeline step or via triggers. Agents run in the same environment as your build, and can be granted controlled access to Bitbucket using MCP tools and scoped OAuth permissions.


はじめる前に

Agentic Pipelines provides a framework to define and configure agents and run them non‑interactively within steps or on triggers. The sections below describe when to use agents, core concepts, and how to get started.

Use Agentic Pipelines when you want to do any or all of the following:

  • Automate code review, debugging, or release tasks

  • Reuse prompts you already tested with local agents inside Bitbucket Pipelines

  • Run multiple agentic background tasks in a secure environment and with limited permissions, for example - generating code or documentation

  • Automate tasks that are well-defined but require an understanding of the code change, for example - raising a pull request for another package if a new entity was added

It’s NOT a replacement for:

  • Your existing build or test steps

  • We wouldn’t recommend using the result of an AI-completed task as a release gate, because the result can be non-deterministic and requires human verification. However, it can be used to provide additional information that aids in making a decision.

動作の仕組み

Agentic Pipelines connects Bitbucket Pipelines with an AI agent. You define agents in your pipeline configuration and describe tasks by using natural language instead of writing complicated shell scripts.

Agents run inside your Pipelines step containers, with access to the following:

  • Your repository checkout.

  • Your build tools and dependencies.

  • Bitbucket APIs via a built-in Model Context Protocol (MCP) server.

  • Scoped OAuth tokens so they can safely act back on your repository (for example, pushing commits or creating pull requests). See for more information.

This transforms your pipelines from strict CI/CD into an agentic SDLC automation-environment where tasks such as code reviews, debugging, refactoring, or content generation can be automated.

Enabling Agentic Pipelines

Before you begin, you must enable Agentic Pipelines in your Bitbucket Workspace settings.

これを行うには、次のようにします。

  1. From the Settings cog icon in the top right, and select Workspace settings.

  2. Select Atlassian integrations in the left sidebar.

  3. Select Atlassian Intelligence.

  4. From there, enable the Agentic Pipelines toggle.

Choose an agent provider

Bitbucket Pipelines supports integrating agents using either Rovo Dev (Atlassian-managed) or Claude Code (bring-your-own account).

For guidance on using third‑party agent providers (including data handling and responsibilities), see Third-Party Agents providers and Bitbucket Agentic Pipelines.

Integrate Rovo Dev with Agentic Pipelines

To use Agentic Pipelines with Rovo Dev, you need:

  • A paid Bitbucket Cloud account with Pipelines enabled.

  • A paid Rovo Dev Standard subscription for your site.

We recommend creating a dedicated user account for Agentic Pipelines usage. This keeps ownership and permissions consistent and avoids coupling agent behavior to an individual developer’s personal account.

Before configuring anything in Bitbucket, make sure Rovo Dev is enabled for your Atlassian site/org and Rovo Dev CLI access is enabled for the account you plan to use in Pipelines. See: Turn Rovo Dev features on and off.

Rovo Dev authenticates using an Atlassian API token. Create a token for the bot account and store it securely. For details, see: Manage API tokens for your Atlassian account.

To use Agentic Pipelines with Rovo Dev, your build container must have the following environment variables available:

  • USER_API_TOKEN (secret)

  • USER_EMAIL

  • BILLING_SITE_URL (for example, <https://yoursite.atlassian.net)

Integrate Claude Code with Agentic Pipelines

Agentic Pipelines can be integrated with Claude Code, allowing you to reuse an Anthropic API Key or Claude Code Subscription Account your organisation already maintains. If you do not have any of those, you can use the Atlassian-managed provider instead. See Integrate Rovo Dev with Agentic Pipelines above.

Please note that using Agentic Pipelines with Claude Code is a third-party product integration, and Atlassian does not control and has no liability for third-party products see Third-Party Agents providers and Bitbucket Agentic Pipelines for more information.

Starting 2026年06月15日, all third-party integration via Claude Agent SDK will be forced to use the new Agent SDK credit for subscription accounts. API key users stay unchanged. Please see Use the Claude Agent SDK with your Claude plan for more information.

Enable Claude support

To start using the Claude provider, you will need to enable it first:

  1. From the Settings cog icon in the top right, select Workspace settings.

  2. Select Pipelines in the left sidebar.

  3. Select Agentic Pipelines.

  4. From there, enable the Claude toggle.

Configure your own agent provider

Set provider: claude on your agent definition in bitbucket-pipelines.yml

Example of configuring your Claude agent provider

definitions: agents: describe-repository: provider: claude prompt: "describe repository"

Not setting the provider will default to using rovodev as the agent provider. See Integrate Rovo Dev with Agentic Pipelines above for more details.

Provide authentication

Agentic Pipelines supports any Claude authentication method that does not require user interaction. See Claude's authentication options for the full list of supported methods.

The most common options are:

  • ANTHROPIC_API_KEY — an API key from the Claude Console.

  • CLAUDE_CODE_OAUTH_TOKEN — a long-lived OAuth token generated by claude setup-token. See Generate a long-lived token.

These can be provided as secure environment variables in your pipeline step.

We recommend using dedicated credentials (token or key) for Agentic Pipelines rather than an individual developer's personal credentials. This lets you track usage specifically for Agentic Pipelines separately from other Claude consumption.

Providing variables to a pipeline step

There are multiple ways to provide the required variables to a pipeline step.

We recommend a set of global user credentials configured as secured variables at the workspace level to operate as the default account for your workspace.

If you want to scope usage for specific repositories to different user credentials you can do this by configuring different credentials at the repository level. The repository-level variables will take precedent over the workspace-level variables at runtime.

Alternatively, for advanced use cases, you can use a third-party secrets provider so that secrets are injected at runtime, instead of being stored in Bitbucket.

詳細については次のページをご確認ください。

Quick start guide to run your first agent

The following example defines a simple agent and runs it as a custom pipeline to help explain test failures:

Example simple agent

image: "atlassian/default-image:5" definitions: agents: explain-test-failure: provider: rovodev # or claude prompt: | You are helping a developer understand why their CI tests failed. The file $TEST_INPUT contains npm test output showing test failures. - Analyze the test output and identify all failing tests - Briefly summarize what failed and where (test file and line numbers) - Identify the most likely root cause for each failure - Point to specific files, tests, or code sections if possible - Suggest 2-5 concrete next steps to fix the issues - If multiple unrelated failures exist, group them clearly - Save the result to a file $TEST_ANALYSIS_OUTPUT Format your response in markdown for readability. pipelines: custom: explain-test-failure: - step: name: Explain test failure script: - export TEST_INPUT=input.log - export TEST_ANALYSIS_OUTPUT=output.md - npm install - npm test > $TEST_INPUT || true - agent: explain-test-failure artifacts: - output.md

Steps to run the example agent

Follow these steps to understand how using agentic pipelines can help you analyse test failures from the example above.

  1. Add the agent and custom pipeline defined above to your bitbucket-pipelines.yml file in your repository.

  2. Select Pipelines on the left sidebar in your repository, and select the Run pipeline button.

  3. Select the ‘custom: explain-test-failure’ pipeline from the Pipeline dropdown in the Run pipeline dialog.

  4. Select the Run button in the Run pipeline dialog to run the pipeline.

This particular example agent will do the following:

  • Run inside the step container and analyze the output of the ‘npm test’ command.

  • The result of the analysis will be saved to a file and preserved as an artifact for future review.

Additionally, the step log in the Pipelines user interface (UI) will show that the step contains an AI agent, as well as the structured output from the agent.


Define an agent in your pipeline

Agents are defined in the definitions section of your bitbucket-pipelines.yml.

Basic inline definition

  • Each agent has a name (pull-request-comment-reviewer in this example).

  • Each agent has a prompt that can reference context variables, such as $BITBUCKET_PR_ID or $BITBUCKET_BRANCH, that describes what you want the agent to do when it runs.
    see: Variables and secrets | Bitbucket Cloud | Atlassian Support

image: "atlassian/default-image:5" definitions: agents: provider: rovodev # or claude pull-request-comment-reviewer: prompt: Can you review the comments on $BITBUCKET_PR_ID \ and provide me a summary of them as a comment on the pull request?

Run an agent in a step

To run an agent, reference it in the script section of a step using the agent: keyword.

image: "atlassian/default-image:5" definitions: agents: pull-request-comment-reviewer: provider: rovodev # or claude prompt: Can you review the comments on $BITBUCKET_PR_ID \ and provide me a summary of them as a comment on the pull request? pipelines: custom: analyse-pr-comments: - step: auth: system: scopes: - read:pullrequest:bitbucket script: - agent: pull-request-comment-reviewer

When a step contains agent: <agent-name> in its script, Bitbucket Pipelines will do the following:

  • Initialize the configured agent runtime.

  • Apply the Bitbucket‑specific system configuration.

  • Attach the Bitbucket Cloud MCP server.

  • Run the agent non‑interactively with your prompt.

Trigger agents with conditions

You can run agents in response to Bitbucket events using the triggers and conditions syntax.

The example provided below will generate release notes on pull request updates to main or master.

image: "atlassian/default-image:5" definitions: agents: release-notes-generator: provider: rovodev # or claude prompt: | For the code changes in the diff from $BITBUCKET_BRANCH and $BITBUCKET_PR_DESTINATION_BRANCH, create a release notes file committed to a new branch. Create a new pull request for the new branch targeting $BITBUCKET_BRANCH and set the reviewerUuid as $BITBUCKET_STEP_TRIGGERER_UUID. pipelines: custom: generate-release-notes: - step: auth: system: scopes: - write:repository:bitbucket - read:pullrequest:bitbucket - write:pullrequest:bitbucket script: - agent: release-notes-generator triggers: pullrequest-push: - condition: BITBUCKET_PR_DESTINATION_BRANCH == "main" pipelines: - generate-release-notes

For more about the triggers and condition syntax, see Pipeline start conditions | Bitbucket Cloud | Atlassian Support


Providing a custom config file for agent

You can supply your own agent configuration and have Pipelines merge it with the system config.

You can store the config:

  • in your repository

  • included into the build image

  • generated earlier in the step script

For more information on using custom config files, see the Agent configuration files help document.


Platform integrations: Bitbucket Cloud MCP server

The Bitbucket Cloud MCP server lets any supported agent runtime interact securely with Bitbucket. It exposes tools (for example, creating pull requests, commenting) that your agent can use to automate tasks simply by having them referenced in your natural language prompts.

For more information on how your agents can interact directly with Bitbucket Cloud, see the Interacting with Bitbucket via MCP help document.


Pricing and requirements

Agentic Pipelines steps run as normal Bitbucket Pipelines steps and follow the same billing model:

  • Build minutes - All agentic steps consume Bitbucket Pipelines build minutes in the same way as any other pipelines step.

  • Token consumption - Bitbucket Pipelines are not charging for token consumption, but it requires an integration with an LLM provider that may charge you separately.

    • RovoDev will consume Rovo dev credits for the actions performed by Rovo Dev in pipelines (like code review, adding tests, etc). Consumed credits will be attributed to the user who’s API key was used to configure Agentic Pipelines. If you exceed the Rovo Dev credits for your org, agentic steps may not start until those limits are reset.

    • When you configure Claude as a provider, any model usage is billed directly by Anthropic under your Claude account, according to your Claude plan and contract. Atlassian does not bill you for Claude token usage.


System defaults (what Bitbucket Pipelines configures for you)

When you run an agentic step in Bitbucket Pipelines, the system:

  • Installs an agent CLI into the build container

  • Applies a system base configuration tailored for Bitbucket Pipelines

  • Injects a Bitbucket Cloud MCP server configured with the step’s OAuth token

  • Adds an extra system prompt so the agent:

    • understands it is running in a CI/CD step

    • does not ask for interactive user input

    • understands $ENV reference to environment variables

既知の制限事項

  • Agentic CI/CD is not supported on self‑hosted runners

  • Only a single agent can be used per step

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。
Morty Proxy This is a proxified and sanitized view of the page, visit original site.