Skip to content

Agent access

Last updated:

When an AI coding assistant signs in to Codebahn through OAuth (as described in MCP server), you land on a consent page before the connection is created. That page is where you choose what the assistant can see and do, not an all-or-nothing grant.

A connection is the record created when you approve an OAuth sign-in from an application that has no client secret: AI assistants such as Claude Code, Codex and VS Code, the Codebahn CLI, git credential helpers (Git Credential Manager, git-credential-oauth), the tea CLI, and public apps you register yourself. It holds the access you granted, the repositories it applies to, and the token the client uses to call the API. You can review and edit it later under Settings > Applications.

Access is split into four areas, each with read and read and write levels. Code & pull requests, Issues & comments, and Organization settings can also be turned off. Profile always stays at least read. An assistant or tool needs it to know which account it is signed in to.

AreaOffReadRead and write
Code & pull requestsNo access to code, branches, or pull requestsClone, browse code, view pull requests, diffs, releases and CI runsPush, open, review and merge pull requests, publish releases and run workflows. On repositories you administer, also change repository settings, branch protection, webhooks and deploy keys
Issues & commentsNo access to issuesView issues and commentsCreate, edit, close issues, and post comments
Organization settingsNo access to org settingsView teams, members, org-wide labels, secrets, and webhooksChange teams, members, org-wide labels, secrets, and webhooks; create new organizations, and repositories in your organizations
Profile & repo listView your profile, account settings, and the list of repositories you can accessView and change your profile and account settings, including adding SSH keys. View the list of repositories you can access

An assistant with Code & pull requests set to read and Issues & comments set to off can read your code but cannot see or create issues.

  • A connection never exceeds your own access, but within an area it has everything your role allows. There is no separate admin level, so on a repository you administer, Code & pull requests write includes its settings, branch protection, webhooks and deploy keys. This holds only for a connection set to All repositories (see Specific repositories).
  • A connection that can push can change CI workflows, and workflows run with the repository’s secrets.
  • Profile write lets the assistant add an SSH key to your account. SSH keys have your full access, outside any connection’s limits, so keep Profile at read unless the assistant needs more.

The consent page offers three starting points, which you can adjust before approving:

  • Read only. Read on Code & pull requests, Issues & comments, and Profile & repo list. No write access anywhere. Organization settings stays off, as in the default.
  • Read and write (the default). Read and write on Code & pull requests and Issues & comments. Read on Profile & repo list. Organization settings stays off; you turn it on explicitly if the assistant needs it.
  • Custom. Set each of the four areas independently.

Picking a preset does not lock you in. Switch to Custom at any point to change any area.

By default a connection applies to every repository you can access. You can instead scope it to specific repositories you pick on the consent page.

Three things are different with specific repositories:

  • No repository administration. Repository settings, branch protection, webhooks, deploy keys and Actions secrets are refused, even on repositories you administer. Use a connection set to All repositories if the assistant needs them.
  • Organization settings is not available. Scoping to specific repositories is a per-repository restriction; organization-level settings (teams, members) aren’t tied to individual repos, so this area is unavailable whenever specific repositories are selected.
  • Profile is fixed. The assistant can read your profile and the list of the selected repositories, and nothing else in the profile area: no account settings, keys, emails or activity.

Each time you approve a sign-in from one of these applications, Codebahn creates a new connection rather than reusing an existing one. You can hold several connections for the same client this way, each with its own label, repository selection, and access, so one agent can stay scoped to a single repo while another keeps broader access, without sharing limits.

Every connection gets a label you can rename, defaulting to the application name; if you already have a connection for that application, the default gets a numeric suffix (“Claude Code 2”).

You can hold at most 10 connections at a time. Sign-ins from the Codebahn CLI and from git credential helpers count too. A connection that goes unused long enough for its refresh token to expire, about a month, is removed automatically, so stale connections from old logins don’t count against the limit.

“Sign in with Codebahn” apps that hold a client secret (the ones you use to log into another product with your Codebahn account) work differently: they keep a single connection per application, reused on every sign-in, with no repository selection or access presets.

Settings > Applications lists every connection: its label, application, when it was created and last used, repository selection, and access. From there you can rename a connection, change its repository selection or access, or revoke it. Changes take effect on the connection’s next request; no new sign-in is required.

Connections created before connections had limits keep the access they had. Settings shows that access as it is: Full access for one that never had limits, the matching areas for one that had narrower scopes. Renaming one keeps its access, except that a connection without profile access gains read on your profile, as every connection now has. Changing its areas or repositories sets it to what the form shows.

A connection’s limits apply when its token is used as a git HTTPS password, the same as for repository-specific personal access tokens. They do not apply to your personal SSH keys, which keep your full account access regardless of any connection’s limits.

Git Credential Manager and git-credential-oauth sign in through the same consent page, so each sign-in creates its own connection with its own limits.

Git Credential Manager only learns that its token expired when a git command fails. After a day without git activity, the first command fails with an authentication error and the next one refreshes the token without a browser. Run the command again.

The Codebahn CLI can hand its own connection’s token to git automatically:

Terminal window
codebahn auth setup-git

This points git’s credential helper for your Codebahn host at the CLI, so git push, git pull, and similar commands authenticate with the CLI’s connection instead of a separate token. It’s idempotent, so running it again is safe. Behind the scenes it calls codebahn auth git-credential get, which implements the standard git credential helper protocol and refreshes the token automatically when it’s close to expiring.

Cursor doesn’t yet support the OAuth flow described above, so it authenticates with a personal access token instead of a connection, as described in MCP server. Create the token under Settings > Applications for all repositories, with the user permission at Read or higher. The MCP server checks every token against your profile, and a token limited to specific repositories can’t include that permission, so it can’t be used over MCP. Keeping an assistant to specific repositories needs the OAuth flow described above.