Prerequisites
- An existing Sourcegraph account or deployment containing the resources you want to inspect.
- Permission to create or obtain the credential described below.
- A CloudThinker workspace role that can add connections; see Roles.
- An HTTPS route from CloudThinker to your service. For a private service, see Reaching private services.
Setup
1
Prepare the credential
Obtain a Sourcegraph access token from the account that should perform searches. See the vendor’s authentication documentation for the procedure that applies to your account.
2
Add the connection
Open Settings → Connections, find Sourcegraph, and click Connect. Enter the values in Connection details.Use your Sourcegraph instance URL. Keep TLS verification enabled when its certificate is trusted.
3
Check the result
Click Connect and wait for the connection check.Success state: the connection shows Connected. Run the verification prompt below and confirm that the expected resources appear.
Connection details
Required permissions
Read: the token’s user can read the repositories you want searched; search sees only cloned repositories. Repository stats and code host sync health need a site admin token. Change metadata: Sourcegraph must allow the token’s user to edit metadata on that repository. If it refuses, use a user that can.Agent capabilities
Changes run only after you approve them. Agents show the current and new value first. Batch changes, settings and code host changes stay in Sourcegraph.
Verify the connection
Example prompts
Troubleshooting
The token is rejected
The token is rejected
Sourcegraph answers 401. Create a new token under Settings → Access tokens and reconnect.
Stats or code hosts show an error
Stats or code hosts show an error
These need a site admin token. Use one, or skip those sections.
The certificate is not trusted
The certificate is not trusted
The instance uses a self-signed certificate. Reconnect with TLS certificate set to Skip SSL verification.
The URL is not accepted
The URL is not accepted
It must be the instance root. Reconnect with the exact https address.
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.
- Keep this integration’s credential separate from personal daily-use credentials where your provider supports it.
- Revoke or rotate it in Sourcegraph when access is no longer needed, and update the connection after rotation.
Related
Connections
Manage access to the services CloudThinker investigates.
Approvals
Control which requested changes can run.