Prerequisites
- A Bitbucket Cloud account with access to the workspace you want agents to read. The connection talks to
bitbucket.organd has no field for a Bitbucket Data Center or Server URL. - Your workspace slug: the part after
bitbucket.org/in your repository URLs. Inbitbucket.org/acme/payments-api, the slug isacme. - For the token method: admin rights on the workspace, project, or repository where you create the token.
- For Review with OAuth: admin rights on the repositories Review runs on, because Bitbucket only lets repository admins add webhooks.
- The Admin role in your CloudThinker workspace, which can add and edit connections. See Roles.
Choose a method
A workspace holds one Bitbucket connection. To try CloudThinker on several repositories, use a project or workspace token, or OAuth, rather than several repository tokens.
Setup
Open the connection first. In the sidebar, click More → Workspace settings → Connections. On the Builtin Connections tab, search for Bitbucket and click Connect. The dialog opens with two tabs: OAuth and Access Token.- OAuth
- Access Token
1
Enter your workspace slug
On the OAuth tab, type your slug in Bitbucket workspace (for example
acme). Connect to Bitbucket stays disabled until this field has a value.2
Authorize CloudThinker
Click Connect to Bitbucket. Sign in as a Bitbucket user who can see the workspace, then approve the request. CloudThinker asks for read and write repository access, API access for webhooks and pull requests, and your account information (username, email).Success state: you land back in CloudThinker with Bitbucket Connected! and Bitbucket shows Connected on the Builtin Connections tab.
CloudThinker registers the Bitbucket webhook for Review on its own. You don’t add one by hand. Pick the repositories Review runs on in Review setup.
Connection details
OAuth needs only the workspace slug. Bitbucket issues the credentials and CloudThinker stores them.Required permissions
Every token type needs the same scopes, and all three types offer them:
Access tokens have no issues scope, so agents can’t read Bitbucket’s issue tracker through a token. Connect with OAuth if you need issues.
Review needs the write permissions to register its webhook and post comments. Agent writes still pass through your Rules and Approval mode before anything changes.
Control access in CloudThinker
Two settings on the connection’s detail panel narrow what agents do. Open More → Workspace settings → Connections, select Bitbucket, and look under Settings.
These settings only narrow what Bitbucket already grants. Choosing which repositories Review runs on is a separate step in Review setup.
Agent capabilities
Reads run without asking. Writes need Allow writes on and pass through your Rules and Approval mode first.Verify the connection
Example prompts
Troubleshooting
Connect to Bitbucket stays disabled
Connect to Bitbucket stays disabled
The OAuth flow needs the workspace slug first. Enter the part after
bitbucket.org/ from any repository URL, then click Connect to Bitbucket.Validate Token fails
Validate Token fails
The token is expired or revoked, lacks one of the required permissions, or doesn’t match your plan. Workspace and project tokens need Bitbucket Premium. Create a new token with every permission in Required permissions and validate again.
Confirm Bitbucket workspace
Confirm Bitbucket workspace
This warning appears on an OAuth connection that has no stored workspace slug. Bitbucket no longer lets CloudThinker discover the workspace on its own, so you enter it once. It shows on the connection’s detail panel and in Review → Settings. Click Set workspace, enter the slug, and click Save workspace.
An agent can't find a repository
An agent can't find a repository
A repository token reaches one repository, and a project token reaches only that project. Use a workspace token, or sign in with OAuth as a user who can see the repository. Then check that Repository access includes it.
Agents can read but every change is refused
Agents can read but every change is refused
Allow writes is off on the connection, or a Rule blocks the action. Turn on Allow writes under Settings, then check your Rules.
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- Prefer scoped tokens. A repository or project token keeps CloudThinker inside the code it should see, and revoking it touches nothing else.
- Set an expiration date. Rotate the token before it lapses, or Review and agents lose access on that day. To swap in the new token, open Review → Settings, open the Connection actions menu (⋯) in the Connection section, and click Update token.
Related
Set Up Review
Choose repositories and start AI code reviews on pull requests
Provider Authentication
Compare auth methods across every Git provider