Connect a GitHub Organization
In this guide, you will connect a GitHub Organization to Turbot Guardrails using the Create Connection wizard. The wizard handles authentication, organization discovery, and connection creation in a single flow.
Connecting your GitHub organization gives Guardrails visibility into your repositories, teams, and organization settings. Once connected, Guardrails discovers resources automatically and evaluates them against your configured policies.
This guide covers both the GitHub-side setup (creating a personal access token with the right permissions) and the Guardrails-side wizard flow.
Prerequisites
- Access to the Turbot Guardrails console with Turbot/Owner or Turbot/Admin permissions at the Turbot resource level.
- Access to GitHub with organization owner privileges.
- The GitHub mod installed in your workspace (TE version
>=v5.48.x).
Step 1: Configure Your Organization's Token Policy
Before creating a personal access token, ensure your GitHub organization allows fine-grained personal access tokens. This is configured in your organization's settings.
Navigate to your GitHub organization's Settings > Third-party access > Personal access tokens and select Allow access via fine-grained personal access tokens.

Refer to the GitHub documentation on setting a personal access token policy for your organization for detailed steps.
Step 2: Create a Personal Access Token
Turbot Guardrails supports both fine-grained and classic GitHub personal access tokens. We recommend fine-grained tokens for their granular permission model.
Navigate to Settings > Developer settings > Personal access tokens and create a new token. Follow the GitHub steps for creating a fine-grained personal access token.

Copy the personal access token immediately after creation.
[!IMPORTANT] Make sure to copy your personal access token during the creation step. You will not be able to see it again.

Step 3: Grant Required Permissions
A newly created fine-grained token starts with no permissions. You must grant the following permissions to ensure full functionality of the GitHub integration.
Required Permissions
| Permission | Access Level | Description |
|---|---|---|
| Organization Administration | Read and write | Allows Guardrails to manage settings and configurations at the organization level. |
| Organization Webhooks | Read and write | Allows Guardrails to manage webhooks for capturing real-time events at the organization level. |
| Repository Metadata | Read-only | Provides Guardrails with visibility into repository metadata without modifying content. |
| Repository Administration | Read and write | Grants Guardrails the ability to manage repository settings, including access controls and policies. |
| Organization Blocking Users | Read and write | Enables Guardrails to block and unblock users within the organization. |
[!TIP] If you're using a classic token instead of a fine-grained token, grant the
read:org,repo, andadmin:orgscopes.

Select Edit to modify the token's permissions.

Grant the required permissions by selecting All repositories under Repository access and configuring the appropriate options in both the Repository permissions and Organization permissions sections.

Step 4: Validate the Token
Navigate to your GitHub organization's Settings > Personal access tokens > Active tokens to verify the token was created with the correct permissions.

Select the token to review its associated permissions.

Confirm the required permissions are associated with the token.

Step 5: Open the Create Connection Wizard
From the Accounts page in the Guardrails console, click the Create Connection button in the top right corner.

Step 6: Select GitHub as the Provider
The wizard displays a grid of available cloud providers. Each provider shows an Installed or Not Installed badge indicating whether the corresponding mod is available in your workspace.
Select GitHub from the provider grid.

Step 7: Authenticate
The wizard presents a 4-step process. Step 1 authenticates your personal access token against GitHub.
Choose Your GitHub Environment
Select your environment type:
| Environment | Description |
|---|---|
| GitHub Cloud | Connect to organizations hosted on github.com. |
| GitHub Enterprise | Connect to a self-hosted GitHub Enterprise Server instance. Requires a base URL (e.g., https://github.example.com/api/v3). |

Enter Your Token
Paste your personal access token into the Personal Access Token field. If you selected GitHub Enterprise, also enter the Base URL for your Enterprise Server's API endpoint.
Test Connectivity
Click Test Connectivity to verify your token. On success, Guardrails displays the authenticated GitHub user with their avatar and login name.

[!TIP] If the test fails, verify that:
- The token hasn't expired
- The token has the required permissions (or scopes for classic tokens)
- For Enterprise Server, the base URL is correct and reachable
Click Continue to proceed.
Step 8: Discover and Select Organization
Guardrails discovers all GitHub organizations accessible to your personal access token.
Organization Name Filter (Optional)
If you're using a fine-grained personal access token, enter the exact organization login name in the Organization Name field. Fine-grained tokens are scoped to specific organizations and require this filter for discovery.
For classic tokens, you can leave this field blank to discover all accessible organizations.
Click Discover Organizations to search.

Select Your Organization
After discovery completes, Guardrails displays organization cards showing:
- Organization name and login
- Description
- Repository count (public + private)
- Member count
- Token scopes detected
Select the organization you want to connect.

Click Continue to proceed.
Step 9: Choose Destination Folder
Choose where to place this connection in your Guardrails resource hierarchy.

Select an existing folder from the Destination Folder dropdown, or click Create Folder to create a new one. The imported organization and all its discovered repositories will be placed in this folder.
Click Continue to proceed to the final step.
Step 10: Review and Create Connection
The final step displays a summary of your configuration organized into numbered sections:
- Authentication: Authenticated user, environment (Cloud or Enterprise), and base URL (if Enterprise)
- Organization: Selected organization name, login, repository count, and member count
- Destination Folder: Where the connection will be placed in your hierarchy
A "What happens next" section explains that Guardrails will connect to the organization, discover repositories and teams automatically, and allow you to manage discovery settings after import.

Review the details and click Create Connection to start the import.
Step 11: Review
After creating the connection, Guardrails redirects you to the organization overview page and begins discovering resources.
- Verify the organization appears under the Accounts page in the Guardrails console.
- Check that controls are executing by navigating to the Controls tab. Default controls for the organization and repositories should reach an
OKstate.

[!NOTE] Discovery typically takes a few minutes depending on the number of repositories in your organization. You don't need to wait. You can navigate away and come back later.
Next Steps
- Configure real-time events: Set up event handlers so Guardrails receives webhook notifications when repositories are created, modified, or deleted.
- Explore your controls: Review the GitHub controls on the Dashboard to see your security posture across branch protection, secret scanning, code review requirements, and more.
- Apply policy packs: Browse GitHub Policy Packs for pre-built configurations covering common governance use cases.
Troubleshooting
| Issue | Solution |
|---|---|
| Create Connection not in Actions menu | Ensure you have Turbot/Owner or Turbot/Admin permissions at the Turbot resource level. |
| GitHub provider shows "Not Installed" | The GitHub mod needs to be installed in your workspace. Contact your Guardrails administrator. |
| Connectivity test fails | Verify the token hasn't expired, has the required permissions, and (for Enterprise) the base URL is correct. |
| No organizations discovered | For fine-grained tokens, enter the exact organization login name. For classic tokens, ensure the token has read:org scope and you are a member of the organization. |
| Controls in Error | Controls may enter error states during initial discovery. Check specific error messages. Common causes include missing token permissions. Learn more about control states. |
Bad Credentials message | The token may have expired or been revoked. Learn about token expiration. |
forbids access via a personal access token with fine-grained permissions | The token is missing required permissions. Review the required permissions and GitHub's fine-grained token permissions reference. |
Resource not accessible by personal access token .. list-users-blocked-by-an-organization | The token lacks the Organization Blocking Users permission. Grant Read and write access for this permission. |
| Further assistance | Open a support ticket with screenshots and error details, or join the #guardrails channel in the Turbot Community Slack. |