Prerequisites
- Admin access to the Semgrep AppSec Platform. Only admins can create API tokens.
- Repositories that Semgrep already scans, if you want agents to read existing findings.
- The Admin role in the CloudThinker workspace, which you need to add connections. See Roles.
Setup
1
Create an API token in Semgrep
In the Semgrep AppSec Platform, go to Settings → Tokens → API tokens and click Create new token.
2
Set the scope and copy the token
Under Token scopes, select Web API and name the token
cloudthinker. Copy the Secrets value, then click Save. Semgrep shows the value only once.3
Add the connection in CloudThinker
In the sidebar, click More → Workspace settings → Connections. On the Builtin Connections tab, search for Semgrep and select it to open the form.Paste the token into SEMGREP_APP_TOKEN, then click Connect.Success state: the connection shows Connected.
Connected doesn’t prove the token works. Semgrep checks it the first time an agent reads platform findings, so run the verify prompt in a new chat before you rely on it.
Connection details
Required permissions
Agent capabilities
Two limits shape what a scan finds:
- No cross-function analysis. Agent scans don’t follow data across functions or files, so they miss issues that span them. For cross-file results, ask for platform findings from your CI scans.
- Size caps. By default a scan reads up to 1 MB per file and 2 MB in total. Name the files to scan rather than a whole repository.
Verify the connection
Example prompts
Troubleshooting
Platform findings fail to load
Platform findings fail to load
The token is wrong, revoked, or has the Agent (CI) scope. Create a Web API token in Settings → Tokens → API tokens, then open the Semgrep connection in CloudThinker and replace the saved value.
A scan returns no findings
A scan returns no findings
The rule set may not match the file’s language. Ask the agent to scan with a rule set for that language, such as
p/python, or with auto.A scan stops with a size error
A scan stops with a size error
The file is over 1 MB, or the selected files total more than 2 MB. Scan fewer files at once, or read the platform findings for that repository instead.
Platform findings miss an issue a scan found, or the reverse
Platform findings miss an issue a scan found, or the reverse
Agent scans and CI scans run differently. CI scans can use your organization’s policies and cross-file analysis, while agent scans don’t follow data across functions or files. Treat platform findings as the record and agent scans as a quick check.
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.
- Read-only. The connection scans and reads. It can’t triage, ignore, or change findings in Semgrep.
- Revoke when done. Revoke the token under Settings → Tokens in Semgrep when you remove the connection.
Related
GitGuardian Connection
Secrets detection and incident triage
SonarQube Connection
Code quality and security scanning