Skip to main content

GitHub

Read and write repositories, issues, pull requests and Actions on GitHub.

Connect it with: Sign in (OAuth), API key. GitHub's own developer documentation has the details.

What agents can do​

Connect GitHub so the agents working your tasks can reach it. With it connected, they can:

  • Clone, branch, commit and push code, and open pull requests for a task.
  • Read and comment on issues and pull request reviews.
  • Check GitHub Actions runs and read their logs when a build fails.
  • Search code across your organization's repositories.

Before you start​

  • A GitHub account with access to the repositories agents should work in.
  • For an organization that restricts OAuth apps or fine-grained tokens, an organization owner must approve Jaah or the token (Organization settings > Third-party access).
  • A Jaah account. Anyone can add a personal secret; an organization secret needs an Org Owner or Admin.

Connect with GitHub​

This is the quickest way in: you sign in to GitHub and approve what Jaah asks for. You never copy a key.

  1. In Jaah, open Secrets and select New.
  2. Search for GitHub and select its card.
  3. Give the secret a name you will recognize, such as the account or workspace it reaches, and choose who can use it (see Who can use it).
  4. Select Connect GitHub. GitHub's sign-in window opens.
  5. Sign in to GitHub if asked, check the access listed, and approve it.
  6. You land back in Jaah on the new secret, which reads Connected once its test passes.

If the button reads Jaah app not configured, this Jaah has no app registered at GitHub yet. Use an API key, or your own OAuth app, until it does.

Scopes Jaah requests​

Jaah asks GitHub for these scopes, and no others. A scope marked optional is a checkbox on the Connect screen: untick it and agents simply cannot do that part.

ScopeWhy Jaah asks for itRequired
repoRead and push code, open pull requests and manage issues in the repositories you can reachYes
workflowUpdate GitHub Actions workflow files when a change touches themYes
read:orgSee your organizations and teams, to find their repositoriesYes
read:userRead your profile, so the connection shows whose it isYes
user:emailRead your email address, to attribute commits correctlyYes

Connect with an API key​

Prefer this when you cannot sign in with GitHub — for example a service account, or a token your admin issued. On the Connect screen select Use an API key instead.

Find each value first:

  • Personal access token: GitHub > your avatar > Settings > Developer settings > Personal access tokens > Fine-grained tokens > Generate new token: name it Jaah, choose the resource owner and repositories, grant Contents, Issues, Pull requests and Metadata (read and write as needed), then Generate token and copy it - GitHub shows it once.
  • Base URL (optional): Leave blank for GitHub in the cloud. For GitHub Enterprise Server, your instance's https root (not /api/v3).

Then add it to Jaah:

  1. In Jaah, open Secrets, select New, and pick the GitHub card.
  2. Name the secret and choose who can use it.
  3. Select Use an API key instead.
  4. Fill in Personal access token, Base URL.
  5. Select Save. Jaah tests the secret straight away (see Test the connection).

Jaah encrypts what you type and never shows it again — not to you, and not to an admin.

Use your own OAuth app​

Register your own OAuth app at GitHub when your company requires apps it controls, or before this Jaah has an app registered there.

  1. Create an OAuth app in GitHub's developer settings.
  2. Set its redirect URI to https://app.jaah.ai/api/credentials/connect/callback (on your own Jaah, its console address followed by /api/credentials/connect/callback).
  3. Give it the scopes in Scopes Jaah requests.
  4. Copy its client ID and client secret.
  5. In Jaah, start a new GitHub secret, select Use your own OAuth app, paste both values and select Connect GitHub.

The client secret is stored with the connection, encrypted, like any other secret value.

Test the connection​

Select Test on the secret. Jaah makes one read-only call to GitHub with the stored values and shows the result on the secret's page. Jaah also tests automatically when you save or reconnect.

Who can use it​

Every secret has an owner, and the owner decides who can use it:

  • Personal — only your own tasks can use it. This is the default.
  • Organization — every task in the organization can use it. Only Org Owners and Admins can choose this.
  • Attached to a project — every task on that project can use it, whoever started the task. See Attach a secret to a project.

More on owners and access: How secrets work.

Use it in an agent session​

An agent asks for the secret with its credential_get tool, by the secret's path, when it needs it, and gets the values for that one call. The path is the owner's prefix and the secret's name:

  • org/<name> for an organization secret,
  • projects/<project>/<name> for one attached to a project,
  • me/<name> for your personal one.

A signed-in connection hands the agent a live access_token, with access_token_expires_at. Jaah refreshes it before it expires, so an agent never handles a refresh token.

A key connection hands the agent its fields: token, base_url.

Tell the agent in your task description which secret to use, for example “use the GitHub secret org/github”.

Manage, rotate or disconnect​

Everything is on the secret's page under Secrets:

  • Rotate a key: create a new key at the vendor first, then select Replace on the secret and paste it. Revoke the old key at GitHub once the test passes. Steps: Replace or delete a secret.
  • Reconnect: when GitHub ends the grant (a password change, a revoked app, an expired refresh), the secret shows Needs reconnect. Select Reconnect and sign in again; agents get the new token on their next call.
  • Disconnect: select Delete. The stored values are destroyed and agents lose access on their next call. To end access at GitHub's side too, revoke Jaah in GitHub's settings, or revoke or delete the key at GitHub.

Limitations​

  • Agents act as the connected account: commits, comments and pull requests are attributed to it.
  • A fine-grained token reaches only the repositories and permissions chosen for it; a sign-in reaches every repository the account can.
  • GitHub limits authenticated API calls to 5,000 an hour per user.
  • A token for GitHub Enterprise Server needs Base URL set to that server.
  • Agents can do only what the connected GitHub account and its granted scopes allow.

Troubleshooting​

Test says GitHub rejected the token (401)

The token expired, was revoked, or was mistyped. Generate a new one and select Replace, or Reconnect a sign-in.

Agents get 404 for a repository you can see

A fine-grained token was not given that repository, or the organization has not approved the token. Edit the token, or ask an owner to approve it.

Push fails with a workflow permission error

The change touches .github/workflows and the token lacks Workflows write (or the sign-in lacks the workflow scope). Add it and try again.

Still stuck? Select Test and read the result: it names the value GitHub refused and the status it answered.

FAQ​

Sign-in or personal access token?

Sign in for the quickest setup. Use a fine-grained token to limit agents to some repositories and permissions.

Is this the same as the GitHub connection for a project's repository?

It is the same kind of secret. A project's repository access can use it, or a separate one with narrower access.

Can Jaah or an admin see the key or token?

No. Jaah stores it encrypted and never shows it again. Only the tasks allowed to use the secret receive it, at the moment they ask for it.

Can I connect more than one GitHub account?

Yes. Add one secret per account, each with its own name, and tell the agent which one to use.