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

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.

GitHub organization settings showing personal access token policy set to allow fine-grained 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.

GitHub developer settings showing the create personal access token page

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.

GitHub showing the newly created token with a copy button

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

PermissionAccess LevelDescription
Organization AdministrationRead and writeAllows Guardrails to manage settings and configurations at the organization level.
Organization WebhooksRead and writeAllows Guardrails to manage webhooks for capturing real-time events at the organization level.
Repository MetadataRead-onlyProvides Guardrails with visibility into repository metadata without modifying content.
Repository AdministrationRead and writeGrants Guardrails the ability to manage repository settings, including access controls and policies.
Organization Blocking UsersRead and writeEnables 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, and admin:org scopes.

Fine-grained token with no permissions assigned yet

Select Edit to modify the token's permissions.

Edit button on the personal access token page

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.

Token permissions page showing organization and repository permissions configured

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.

GitHub organization settings showing the active tokens list

Select the token to review its associated permissions.

Active tokens list with the newly created token

Confirm the required permissions are associated with the token.

Token detail page showing all required permissions are granted

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.

Accounts page with Create Connection button in the top right

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.

Provider selection grid showing AWS, Azure, GCP, GitHub, and other providers

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:

EnvironmentDescription
GitHub CloudConnect to organizations hosted on github.com.
GitHub EnterpriseConnect to a self-hosted GitHub Enterprise Server instance. Requires a base URL (e.g., https://github.example.com/api/v3).

Wizard step 1 showing GitHub Cloud and Enterprise environment selection with token input

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.

Wizard step 1 after successful connectivity test showing authenticated user

[!TIP] If the test fails, verify that:

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.

Wizard step 2 showing organization discovery with organization name filter and Discover button

Select Your Organization

After discovery completes, Guardrails displays organization cards showing:

Select the organization you want to connect.

Wizard step 2 showing discovered organization cards with repo and member counts

Click Continue to proceed.

Step 9: Choose Destination Folder

Choose where to place this connection in your Guardrails resource hierarchy.

Wizard step 3 showing folder selection dropdown

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:

  1. Authentication: Authenticated user, environment (Cloud or Enterprise), and base URL (if Enterprise)
  2. Organization: Selected organization name, login, repository count, and member count
  3. 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.

Wizard step 4 showing review summary with authentication, organization, and folder details

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.

Organization overview page showing discovered repositories and control status

[!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

Troubleshooting

IssueSolution
Create Connection not in Actions menuEnsure 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 failsVerify the token hasn't expired, has the required permissions, and (for Enterprise) the base URL is correct.
No organizations discoveredFor 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 ErrorControls may enter error states during initial discovery. Check specific error messages. Common causes include missing token permissions. Learn more about control states.
Bad Credentials messageThe token may have expired or been revoked. Learn about token expiration.
forbids access via a personal access token with fine-grained permissionsThe 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-organizationThe token lacks the Organization Blocking Users permission. Grant Read and write access for this permission.
Further assistanceOpen a support ticket with screenshots and error details, or join the #guardrails channel in the Turbot Community Slack.