Prerequisites
- A SonarQube Cloud organization, or a SonarQube Server or Community Build instance reachable from CloudThinker over HTTPS. For a private instance, see Reaching private services.
- A SonarQube account for CloudThinker with Browse permission on the projects agents should read (see Required permissions).
- The Admin role in the CloudThinker workspace, which you need to add connections. See Roles.
Setup
- SonarQube Cloud
- SonarQube Server
1
Generate a user token
Sign in to SonarQube Cloud as the account CloudThinker will use. Go to My Account → Security, enter a name such as
cloudthinker, set an expiry, and click Generate Token.Copy the token. SonarQube shows it only once.2
Find your organization key
Open your organization. The key is the last part of the URL:
https://sonarcloud.io/organizations/<org-key>.3
Grant Browse on the projects
For each project agents should read, open the project, go to Administration → Permissions, and give the CloudThinker account Browse. Without it, the verify prompt comes back empty.
4
Add the connection in CloudThinker
In the sidebar, click More → Workspace settings → Connections, stay on the Builtin Connections tab, and select SonarQube. Fill in:
- SONARQUBE_TOKEN: the token you copied
- SONARQUBE_DEPLOYMENT_TYPE: SonarQube Cloud
- SONARQUBE_ORG: your organization key
Connection details
The form shows SONARQUBE_ORG or SONARQUBE_URL depending on the deployment type you pick. The SonarQube Cloud option connects tosonarcloud.io. There’s no region field.
Required permissions
A user token acts with the permissions of the account that created it. Grant that account project permissions in SonarQube, per project or through a permission template.Agent capabilities
Severity names follow your instance’s mode. Multi-Quality Rule mode reports BLOCKER, HIGH, MEDIUM, LOW, and INFO. Standard Experience reports BLOCKER, CRITICAL, MAJOR, MINOR, and INFO.
Every change an agent makes goes through your workspace’s Approvals first. On the default Auto · Rules + AI · Ask me mode, AI judgment can let a safe change run without asking — and an Allow Rule can too, once CloudThinker turns on Rule enforcement for your workspace. Choose Manual to approve every change yourself.
A rejected request isn’t retried. To decide each status change yourself, such as marking an issue as a false positive, choose Manual so a person approves every change. Once CloudThinker turns on Rule enforcement for your workspace, an Ask first Rule can narrow that to the SonarQube connection alone. Some tools depend on your SonarQube edition: dependency risks need an Advanced Security license, and system health tools work only on SonarQube Server.
Agents report each project’s numbers as they are today. SonarQube returns current measures, so agents won’t claim a trend unless you ask them to compare branches or pull requests.
Verify the connection
Example prompts
Troubleshooting
Requests return 401
Requests return 401
The token is wrong, expired, or revoked. Generate a new user token, edit the connection, and paste it into SONARQUBE_TOKEN.
Connect fails on SonarQube Server
Connect fails on SonarQube Server
CloudThinker can’t reach SONARQUBE_URL. Check that the address is HTTPS and reachable from the internet, not
localhost or a private hostname, and that the SonarQube service is running.No projects come back (Cloud)
No projects come back (Cloud)
SONARQUBE_ORG is wrong, or the token’s account isn’t a member of that organization. Copy the key from the organization URL and confirm membership.
Some projects are missing
Some projects are missing
The token’s account lacks Browse on them. Grant Browse on those projects in SonarQube. No need to reconnect; permissions apply on the next request.
Changing a status returns 403
Changing a status returns 403
The account lacks Administer Issues or Administer Security Hotspots on that project. Grant the permission in SonarQube, then ask again.
Dependency risks or system health aren't available
Dependency risks or system health aren't available
Your edition doesn’t include those tools. Dependency risks need an Advanced Security license, and system health tools exist only on SonarQube Server.
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.
- Use a user token: on SonarQube Server, pick the User Token type, not a Global Analysis Token, so access follows one account’s project permissions.
- Set an expiry: give the token an expiry date and rotate it before it lapses.
Related
Review
Get AI review comments on every merge request and pull request.
Semgrep connection
Let agents triage static analysis findings from Semgrep.