Skip to main content

Enforcing policies for GitHub Codespaces in your enterprise

You can enforce policies for GitHub Codespaces within your enterprise's organizations.

Who can use this feature?

Enterprise owners can enforce policies for GitHub Codespaces in an enterprise.

About enterprise policies for GitHub Codespaces

As an enterprise owner, you can set a policy to enable or disable GitHub Codespaces across organizations in your enterprise. You can enable GitHub Codespaces for all organizations, enable for specific organizations, or disable for all organizations.

If you disable GitHub Codespaces for an organization, users cannot use or create codespaces for any of that organization's private or internal repositories, regardless of whether use of the codespace would be billed to the user or to your organization or enterprise. You cannot prevent users from creating and using codespaces for public repositories in your organizations at their own expense, but an organization will not be able to pay for this usage if GitHub Codespaces is disabled.

By enabling GitHub Codespaces, you can help your members and collaborators get started with projects quickly, without needing to install lots of tools and dependencies locally to start contributing. However, you might want to roll out GitHub Codespaces gradually across your organizations by enabling it for more organizations over time. Alternatively, if you need to comply with security regulations that require increased control over the private code in your enterprise, you might want to disable GitHub Codespaces for all organizations in your enterprise.

If you're an organization owner, you can enable GitHub Codespaces for specific members and collaborators in an organization. You can also choose to pay for these users' usage of Codespaces. For more information, see "Enabling or disabling GitHub Codespaces for your organization" and "Choosing who owns and pays for codespaces in your organization."

Enabling or disabling GitHub Codespaces in your enterprise

Note: If you remove a user's access to GitHub Codespaces, the user will immediately be unable to open existing codespaces they have created from an organization's private and internal repositories. For more information, see "Enabling or disabling GitHub Codespaces for your organization."

  1. In the top-right corner of GitHub.com, click your profile photo, then click Your enterprises.

  2. In the list of enterprises, click the enterprise you want to view.

  3. In the enterprise account sidebar, click Policies.

  4. Under " Policies," click Codespaces.

  5. On the GitHub Codespaces policies page, under "Manage organization access to GitHub Codespaces," select whether to enable GitHub Codespaces in your organizations' private and internal repositories.

    You can enable for all organizations, enable for specific organizations, or disable for all organizations.

  6. Click Save.

  7. Read the confirmation dialog, then click Submit to proceed.