Rovo Dev agent in Bitbucket Pipelines fails with “Missing required environment variable(s): USER_API_TOKEN, USER_EMAIL” – tried both auth: system and auth: user

I’m setting up a Rovo Dev code-review agent for pull requests in Bitbucket Pipelines, but the pipeline fails with:

Error: Missing required environment variable(s): USER_API_TOKEN, USER_EMAIL
Rovodev requires USER_API_TOKEN and USER_EMAIL to start.

This happens with both auth: system and auth: user.

My bitbucket-pipelines.yml:

image: node:22
definitions:
  agents:
    code-review-agent:
      prompt: "!.rovodev/prompts/pr-code-reviewer/prompt.md"
pipelines:
  # Pull request pipeline (for code review)
  pull-requests:
    '**':
      - step:
          name: AI Code Review
          size: 2x
          auth:
            user:
              scopes:
                - read:repository:bitbucket
                - read:pullrequest:bitbucket
                - write:pullrequest:bitbucket
          script:
            - agent: code-review-agent

What I’ve tried:

  • Using auth: user with read:repository, read:pullrequest, and write:pullrequest scopes

  • Using auth: system instead of auth: user

  • Ensuring the prompt file exists at !.rovodev/prompts/pr-code-reviewer/prompt.md

  • Running the pipeline on a PR branch (feat/add-pr-code-review-agen)

Error I’m getting:

The pipeline clones the repo successfully, but when it reaches the agent step, it fails with:

+ "${AGENT_INSTALL_PATH}/run-agent.sh" "code-review-agent" "!.rovodev/prompts/pr-code-reviewer/prompt.md"
Running rovodev agent from: /opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/agent
Installer Version: local:80259.1786074296.monorepo
Event Mode: TRANSFORMED
Error: Missing required environment variable(s): USER_API_TOKEN, USER_EMAIL
Rovodev requires USER_API_TOKEN and USER_EMAIL to start.

Hi @ankitjangid – Have you tried configuring the missing environment variables? According to the Agentic Pipelines documentation, three environment variables are required (including the two in your error message):

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)

In case it helps, here’s a tutorial authored by @CaterinaCurti that describes setting up the code review agent: How I Added a Code Review “Skill” to My Repo — and Made It Run Locally, in PRs, and Across the Whole Codebase

@AaronMorris1 Thanks for your help! I added the missing environment variables, but now I’m getting the following error:

{
"type": "exception",
"message": "There was an error checking your Rovo Dev credits. Please try again later.",
"title": "Error checking Rovo Dev credits",
"exceptionType": "RateLimitExceededError"
}

I think Rovo Dev might not be enabled on my site.