Personal access tokens
Create, use, and revoke personal access tokens for scripts, CI runners, and Git over HTTPS.
A personal access token lets a script, a CI runner, or Git over HTTPS act as you without your password. "Tokens inherit your user permissions, scoped further by the chosen scopes": a token can never do more than your own account can, and you narrow it further with scopes and an expiry date.
Tokens live in Settings → Personal access tokens. You can also get there from New → New access token in the top bar, or Personal access tokens in the account menu.
Create a token
- Click Generate new token.
- Fill in the Generate new token dialog:
- Token name: something that tells you later where it's used, for example
CI runner — production. - Scopes: tick at least one. repo:read and git:read are ticked by default. Pick the narrowest set that fits the use case.
- Expiration: how long the token stays valid.
- Source identifiers: the networks the token may be used from — your current network's verified IP is pre-selected. On a connection whose address changes (home DHCP, hotspot), Allow my whole network (a.b.0.0/16) adds your network's range in one click (details).
- Token name: something that tells you later where it's used, for example
- Click GENERATE TOKEN →.
- The dialog now shows Token … created and the token itself under One-time display. Click COPY TOKEN, store it somewhere safe (for example your CI system's credential store), then click DONE →.
Copy the token before you close the dialog. You will not be able to see it again. If you lose it, revoke it and create a new one.
Tokens and SSH keys are created only from a signed-in browser session. A personal access token can't create another
token or add an SSH key, whatever its scopes: the request is refused with insufficient_scope. A token can still be
revoked.
A token created in the browser from the same address you signed in from sends no "token was created" email — see Access log.
Scopes
| Scope | What it allows |
|---|---|
repo:read | Read repositories and metadata, including clone and fetch via git-over-HTTPS |
repo:write | Create branches, commits, refs |
repo:admin | Full administrative control over repositories — everything repo:write allows, plus deleting repositories and managing their hooks, branch protection and read-ACL rules (your org role still applies); organization members, invitations, teams and settings are managed in the browser only |
git:read | Clone and fetch via git-over-HTTPS, and read code and history |
git:write | Push via git-over-HTTPS |
user:read | Read your account settings (usage meter, 2FA, security identifiers, IP allowlist, AST-index consent, tokens, SSH keys) — it grants no repository reads |
checks:write | Post CI check statuses through the REST API's /checks/report — nothing else: it grants no repository reads or writes and no MCP tools. Give a CI job that only reports statuses a token with just this scope. Your organization role must still allow writing. |
Every way of reading needs a read scope. Cloning, fetching and Git LFS over HTTPS, and the REST API's code and history
reads, need git:read, git:write, repo:read, repo:write or repo:admin. The REST API's pull request,
check, memory, repository-list and audit reads need repo:read (or repo:write / repo:admin). A token holding
only checks:write or user:read reads no repository content; a REST read its scopes don't cover is refused with
HTTP 403 insufficient_scope.
Expiration
| Option | Token is valid for |
|---|---|
| 30 days | 30 days from creation |
| 60 days | 60 days from creation |
| 90 days (default) | 90 days from creation |
| 1 year | 365 days from creation |
| No expiration (not recommended) | Until you revoke it |
Once a token expires it's refused, exactly like a revoked token.
Use a token with Git over HTTPS
Every repository can also be reached over HTTPS at https://gitdb.net/{org}/{repo}:
git clone https://gitdb.net/{org}/{repo}When Git asks for credentials, enter any username and paste your token as the password.
- To clone and fetch, a token with git:read is the narrowest choice. A token with no read scope — for
example one holding only
checks:writeoruser:read— is refused clone, fetch and Git LFS with HTTP 403 (read refused: this personal access token has no git read scope). - To push, the token needs git:write (or repo:write). A token without a write scope can clone and fetch but can't push.
- Branch protection rules apply to HTTPS pushes exactly as they do over SSH. See Branch protection.
Use your operating system's Git credential helper to store the token instead of typing it each time. If you'd rather not handle tokens at all, use SSH keys.
Use a token with your AI agent (MCP)
Your agent connects to GitDB's MCP server with a token — see Connect your AI agent. Each MCP tool checks the token's scopes:
| Scope | What it allows over MCP |
|---|---|
repo:read | Every tool that reads: code, history, pull requests, checks, memory recall, and gitdb_list_repos (your organizations and the repositories your token can access) |
repo:write | Everything repo:read allows, plus every tool that writes: staging and committing, branches, tags and merges, opening, reviewing, merging and closing pull requests, saving and forgetting memories, and creating repositories (gitdb_create_repo) |
repo:admin | Everything repo:write allows |
git:read | The code and history reads only — not pull requests, checks, memory, or gitdb_list_repos |
git:write | Everything git:read allows, plus staging, committing, branches, tags and merges — not pull request writes, memories, or creating repositories |
user:read | None of the repository tools — only gitdb_scan_secrets, which checks just the content you pass |
checks:write | No MCP tools — the scope grants none, so a token holding only checks:write reaches just gitdb_scan_secrets, like user:read. It's for posting CI check statuses through the REST API's /checks/report only |
A call the token's scopes don't cover is refused with insufficient_scope, naming the scope it needs, and nothing is
read or changed; your agent's tool list leaves those tools out. Writes also need an organization role that can write.
Your token list
Each token in the list shows its name, its scopes, when it was Last used (or "never"), and when it expires (or "no expiration").
Revoke a token
- Click the delete icon next to the token.
- A confirmation dialog titled with the token's name warns: "Any CLI sessions or scripts using this token will stop working immediately. This cannot be undone."
- Click REVOKE TOKEN →.
Revoke a token right away if it may have leaked, and create a new one for whatever used it.
Good practice
- One token per use (per CI pipeline, per script), so you can revoke one without breaking the others.
- Pick the narrowest scopes and a real expiry date rather than No expiration (not recommended).
- Never commit a token to a repository or paste it into chat.