Skip to content

[TEC-629] GitHub PAT permissions docs re-worked - #2805

Open
abhijna wants to merge 3 commits into
mainfrom
abhijna/tec-629-improve-documentation-for-github-pat-permissions
Open

[TEC-629] GitHub PAT permissions docs re-worked #2805
abhijna wants to merge 3 commits into
mainfrom
abhijna/tec-629-improve-documentation-for-github-pat-permissions

Conversation

@abhijna

@abhijna abhijna commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

This PR updates the GitHub permissions docs so PAT users (including orgs still on classic tokens) can see what scopes and roles they need.

  • Added a full GitHub PAT reference on SCM permissions: fine-grained vs classic, account/role requirements, Connect/Test validation, code access, and Autofix
  • Expanded Grant code access with separate fine-grained and classic setup steps, and pointed scope questions back to SCM permissions so we don’t duplicate the matrix

Reorg

  • Clarified the split: SCM permissions = what you need; Grant code access = how to configure it
  • Swapped nav order so permissions comes before grant code access
  • Put GitHub App and PAT under tabs (App first, as preferred)
  • Explained public vs private Semgrep GitHub Apps before listing either app’s permissions
  • Moved the Autofix GitHub API deep dive under Private GitHub App permissions, since it was never really general
  • Autofix docs: Added a Next steps section for setup pages so the permissions page stays a reference

Review focus: Are the classic vs fine-grained scopes right for connection validation, and does the public/private App + PAT layout make sense?

  • A subject matter expert reviews the content

@abhijna abhijna self-assigned this Aug 22, 2026
@mintlify

mintlify Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
semgrep-docs 🟢 Ready View Preview Aug 22, 2026, 12:24 AM

@armchairlinguist armchairlinguist left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely needs some refinement - while I've flagged a few things I noticed, I would highly recommend checking this with an SCM SME from the platform team.

<Note>
**Managed Scans on GitHub**

[Semgrep Managed Scans](/deployment/managed-scanning/github) for GitHub still require the public and private Semgrep GitHub Apps. A PAT alone does not replace those apps for Managed Scans.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, though.

[Semgrep Managed Scans](/deployment/managed-scanning/github) for GitHub still require the public and private Semgrep GitHub Apps. A PAT alone does not replace those apps for Managed Scans.
</Note>

Use a personal access token (PAT) when your organization connects GitHub to Semgrep with a token instead of a GitHub App, or alongside a GitHub App. Semgrep recommends a **fine-grained** PAT. **Classic** PATs remain supported when org policy requires them.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't do combined connections AFAIK?


Use a personal access token (PAT) when your organization connects GitHub to Semgrep with a token instead of a GitHub App, or alongside a GitHub App. Semgrep recommends a **fine-grained** PAT. **Classic** PATs remain supported when org policy requires them.

A PAT can only grant access that the creating GitHub user already has. Use a dedicated machine user when possible. That user must be a member of the target organization, or a collaborator on the selected repositories. For [Autofix](/semgrep-code/triage-remediation/autofix), the user must be able to push branches and open pull requests on those repositories.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "dedicated machine user" the term GitHub uses?

- Have connected to a GitHub org already, but want to add additional GitHub connections

You can connect to GitHub using Semgrep's GitHub app and one of the following: a personal access token or your individual GitHub account.
You can connect to GitHub using Semgrep's GitHub app and one of the following: a personal access token or your individual GitHub account. If you use a personal access token, see [GitHub personal access tokens](/deployment/prepare/scm-permissions#github-personal-access-tokens) for required roles and scopes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this was meant to mean or what it means now - again, I don't think we really do combined connection types.

</Step>
<Step>
Under **Repository permissions**, set **Pull requests** to **Read and write**.
Under **Repository permissions**, set **Pull requests** to **Read and write** if you use Autofix. For read-only code access, you can leave **Pull requests** at **No access**.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually true? Don't we need access to them to write PR comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants