answered from live GitHub & Hugging Face data

How do I create a separate GitHub App for Codex to manage its identity and contributions?

MaintActive · 2d ago
Stars191
Releasev16.1.43mo ago
Contrib32
Issues28 open
openai/codexApache-2.0
MaintActive · today
Stars134k
Releaserust-v0.167.03d ago
Contrib715
Issues27k open

Create your own GitHub App for Codex, install it on selected repositories, and keep its private key in a secret store. The Codex CLI repository does not handle this identity for you, so you must connect the app's tokens to Codex yourself.

What "Codex" means here

Your own app is a separate identity. Follow the steps below for that.

Steps

  1. Open your account Settings, then Developer settings, then GitHub Apps. Click New GitHub App. For an organization, use the organization's settings instead (GitHub Docs).
  2. Enter a name of 34 characters or fewer. The name must be unique across GitHub. Name it for Codex, for example codex-yourteam.
  3. Enter a homepage URL. Use your repository URL if you have no website.
  4. Turn off Active if the app does not need webhooks.
  5. Choose the minimum permissions. For example, select read and write for Contents and Pull requests only if Codex must push branches and open pull requests.
  6. Under "Where can this GitHub App be installed?", select Only on this account.
  7. Click Create GitHub App. Note the App ID. Do not use the client ID for API calls (octokit/app.js README).
  8. Generate a private key from the app settings page. Download the .pem file.
  9. Click Install App. Select Only select repositories, then choose the repositories Codex may change (GitHub Docs).
  10. Create an installation token for each run. Send a POST request to /app/installations/INSTALLATION_ID/access_tokens with a signed JWT (GitHub Docs).
  11. Pass repositories and permissions in that request to narrow the token further.

Security facts from the docs

What I could not verify

Recommendation

Choose your own GitHub App if you run one agent on a few repositories. It gives Codex a separate identity and short-lived tokens. You must build the token step yourself.

If you run several agents and need each action traced to one agent and one person, use a tool that does this for you. githug gives each agent its own key. That key mints one-hour tokens for one repository. The agent can also get its own GitHub App, so its commits and pull requests show as its own bot. The hug init --repo owner/repo command sets this up. It is free during the beta.

docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-appdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-appdocs.github.com/en/copilot/concepts/agent-capabilities/about-agents/about-third-party-coding-agentsdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-appdocs.github.com/en/apps/using-github-apps/installing-your-own-github-appdocs.github.com/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-appgithub.com/octokit/app.jsgithub.com/openai/codex
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 11/9/2026

Ask your own open-source question →