Removing a GitHub Organization
In this guide, you will safely remove a GitHub organization from your Turbot Guardrails workspace. This process deletes all associated CMDB records and policy settings from Guardrails but does not affect any resources in your actual GitHub organization.
The removal process has three phases: disabling event handlers (which removes webhooks from GitHub), cleaning up credential policies, and deleting the connection.
[!WARNING] Removing a GitHub organization from Guardrails permanently deletes all its CMDB records, policy settings, and control history. This action cannot be undone.
Prerequisites
- Turbot/Operator permissions at the Turbot level.
- Access to GitHub to verify webhook removal.
Step 1: Disable Event Handlers
Before removing the organization, disable the Event Handlers to cleanly remove any Guardrails-configured webhooks from your GitHub organization.
Navigate to the Guardrails > Policies page. Search for GitHub > Organization > Event Handlers and select the existing policy setting for your organization.

Select the Edit button in the top-right corner. Change the setting to Enforce: Disabled and select Update.

This triggers Guardrails to remove the webhook from your GitHub organization.
Step 2: Verify Webhook Removal
Confirm that the GitHub > Organization > Event Handlers control reaches OK status. Then navigate to your GitHub organization's Settings > Webhooks and verify that no Guardrails-configured webhooks remain.

Step 3: Remove Credential Policy
Delete the GitHub > Config > Personal Access Token policy configured for the target GitHub organization. This ensures that Guardrails no longer has stored credentials for the organization.
Navigate to the Guardrails > Policies page, search for GitHub > Config > Personal Access Token, and delete the policy setting.

Step 4: Delete the Connection
Navigate to the organization's page and select Delete Connection in the top right corner.

A confirmation dialog appears. Type the organization name to confirm, then select Delete to permanently remove the connection.

Step 5: Review
Guardrails begins the deletion process. The time required depends on the number of policies and resources associated with the organization. Larger organizations take longer.
- The GitHub organization no longer appears on the Accounts page.
- No residual event handlers or webhooks remain in your GitHub organization settings.
- The
GitHub > Config > Personal Access Tokenpolicy setting has been removed.
Troubleshooting
| Issue | Solution |
|---|---|
| Deletion errors | Errors may occur due to database locks or incomplete cleanup. Ensure all event handlers and policies have been removed before retrying. See Troubleshooting. |
| Webhooks still present in GitHub | If Guardrails webhooks weren't removed during step 1, manually delete them from your GitHub organization's Settings > Webhooks page. |
| Further assistance | Open a support ticket with screenshots and error details, or join the #guardrails channel in the Turbot Community Slack. |