Skip to content

Authentication

Erode needs a platform token to read diffs and post analysis comments. This page covers the required permissions for each platform. For the environment variable names and other configuration, see Configuration.

Erode uses ERODE_GITHUB_TOKEN to read the source PR and post analysis comments. ERODE_MODEL_REPO_PR_TOKEN is used to create model update PRs (branches, commits, pull requests) on the model repository and falls back to ERODE_GITHUB_TOKEN when not set.

Same repository (source code and architecture model live in one repo, so a single token covers everything):

FeaturePermissions
Read PR and diffContents: Read, Pull requests: Read
Post analysis commentsIssues: Read and write
Create model update PR (--open-pr)Contents: Read and write, Pull requests: Read and write

External model repository (source and model are in separate repos, each with its own token):

TokenRepositoryPermissions
ERODE_GITHUB_TOKENSource repoContents: Read, Pull requests: Read, Issues: Read and write
ERODE_MODEL_REPO_PR_TOKENModel repoContents: Read and write, Pull requests: Read and write

Select these Repository permissions when creating a fine-grained personal access token:

  • Contents: Read-only (or Read and write if using --open-pr on that repo)
  • Pull requests: Read-only (or Read and write if using --open-pr on that repo)
  • Issues: Read and write (source repo only)

The repo scope covers all required permissions. If the model repository is public, public_repo is sufficient for ERODE_MODEL_REPO_PR_TOKEN.

Section titled “GitHub Apps (recommended for organizations)”

GitHub Apps are the recommended token strategy for organizations:

  • Short-lived tokens: automatically generated and rotated on every workflow run, eliminating long-lived secrets
  • Repository-scoped: access is limited to specific repositories, not broad user-level access
  • Not tied to user accounts: tokens keep working when people leave the organization or change roles
  • Centralized permissions: managed through the App’s installation settings, not individual developer tokens

Use the same Repository permissions as fine-grained PATs above. See GitHub App Token for a complete workflow example.

Erode uses ERODE_GITLAB_TOKEN for all operations on the source project: reading MR diffs, posting notes, and (with --open-pr) creating branches, commits, and merge requests. The api scope is required; read_api is not sufficient.

For external model projects, the CI entrypoint accepts ERODE_MODEL_REPO_TOKEN (see GitLab CI).

TypeScopeMinimum role
Personal Access Tokenapi
Project Access TokenapiDeveloper
Group Access TokenapiDeveloper

ERODE_BITBUCKET_TOKEN handles all operations. There is no separate model-repo token. If the token contains : (e.g. username:app_password), Erode uses HTTP Basic auth; otherwise it uses Bearer auth.

FeatureApp password scopes
Read PRs and diffsRepositories: Read
Post PR commentsPull requests: Write
Create model update PR (--open-pr)Repositories: Write, Pull requests: Write

Minimum scopes (no --open-pr): Repositories: Read + Pull requests: Write. Full scopes (with --open-pr): Repositories: Write + Pull requests: Write.

Repository access tokens and workspace access tokens use the same permission categories but authenticate with Bearer auth.