> For the complete documentation index, see [llms.txt](https://docs.ox.security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ox.security/get-started/onboarding-to-ox/source-control/github/github-token.md). Agents can also search and read this documentation through its [MCP server](https://docs.ox.security/~gitbook/mcp).

# GitHub Token

The Token method provides the most flexibility for connecting GitHub to OX Security. In this method, users generate an API token in GitHub, which serves as a security credential to allow OX Security access to specific repositories and actions.

**To connect with Token:**

1. [Get a GitHub token.](https://docs.ox.security/get-started/onboarding-to-ox/source-control/github/github-token/getting-github-tokens.md)
2. In the **OX** platform, go to **Connectors** and select **GitHub > TOKEN**.

<figure><img src="https://884876233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdK3XMLdV8zRg847RmGmZ%2Fuploads%2Fgit-blob-92db786c90b22a856f3cbc7cdd891fa9e91b6695%2FGH_SC_Token%20(2).png?alt=media" alt="" width="495"><figcaption></figcaption></figure>

3. In the **Configure your GitHub credentials** dialog, set the following parameters:

   <table><thead><tr><th width="264.166748046875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>GitHub Host URL</strong></td><td>Add your GitHub organization account URL.</td></tr><tr><td><strong>Token</strong></td><td>Paste the GitHub token you have created.</td></tr><tr><td><strong>Connection Name</strong></td><td>The token name is automatically generated by OX app.<br>You can change/edit the connection name at any time.</td></tr><tr><td><strong>OX Broker</strong></td><td>Enable this option to connect GitHub through an OX Broker instead of a direct connection. When enabled, OX routes communication through the broker, allowing access to GitHub instances that are not directly reachable from the internet. After enabling the toggle, provide the broker connection details as described in the <a href="https://docs.ox.security/get-started/onboarding-to-ox/prerequisites-and-access/ox-deployment/ox-broker.md">OX Broker documentation</a>.</td></tr></tbody></table>
4. To select specific repositories for scanning by OX platform, select the gear icon next to **DELETE**.

<figure><img src="https://884876233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdK3XMLdV8zRg847RmGmZ%2Fuploads%2Fgit-blob-07f73b8b0e9278c5539a519850d40be46afae27e%2Fgear_icon.png?alt=media" alt="" width="321"><figcaption></figcaption></figure>

5. Select the repos you want to protect.

<figure><img src="https://884876233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdK3XMLdV8zRg847RmGmZ%2Fuploads%2Fgit-blob-1c5aef154f13badd37b9095f85209c5c49a34272%2Fselecting%20repos_no_title.png?alt=media" alt="" width="266"><figcaption></figcaption></figure>

6. Select **SAVE**.
7. (optional) [Select branches you want to scan within the selected repos.](https://docs.ox.security/ox-code/scanning/multi-branch-support.md)
8. To connect more GitHub accounts to the same organization in the OX platform, select **Add another Token +**, set the required parameters and select **CONNECT**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ox.security/get-started/onboarding-to-ox/source-control/github/github-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
