# Creating a .github-private repository

> A .github-private repository can serve as a designated source of governance settings for agents and plugins across your enterprise.

- 网址：https://funcoding.ai/agents/github-copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/create-github-private-repo/
- 来源：GitHub Copilot 官方文档原文（英文），CC-BY-4.0 许可，同步于 2026-10-11
- 官方原文：https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/create-github-private-repo

---
A `.github-private` repository can house governance settings for your enterprise's custom agent profiles, client permissions, and plugins.

A repository-based governance approach allows users to open pull request with suggestions to improve the settings, and it allows settings changes to be restricted by codeowners and rulesets.

You can create a `.github-private` repository using a template or from scratch.

## Creating a repository for your enterprise governance

1. Choose an organization in your enterprise to own the repository containing your enterprise-level custom agents and governance settings.
1. Navigate to the [governance template repository](https://github.com/docs/custom-agents-template?ref_product=copilot&ref_type=engagement&ref_style=text&ref_plan=enterprise).
1. In the top-right corner, click "Use this template" and create a new repository in your chosen organization named `.github-private`. Settings will apply to members regardless of whether they can access the repository, so choose the visibility based on who should be able to suggest changes:
     * To grant **read access to all members** of your enterprise, choose organization **Internal**.
     * To **manually grant access after creation**, choose lock **Private**.
1. Update the template README as needed. Consider including creation guidelines for custom agents or compliance considerations specific to your enterprise.

<div class="callout callout-note">

Settings in this repository apply to all users on your enterprise's Copilot plan who use a supported client.

</div>

## Selecting your repository as your source of governance

1. Navigate to your enterprise. For example, from the [Enterprises](https://github.com/settings/enterprises?ref_product=ghec&ref_type=engagement&ref_style=text) page on GitHub.com.

1. At the top of the page, click **copilot AI controls**.
1. On the "Agents" tab, in the "Configuration source" section, select the **Select organization** triangle-down dropdown menu, then click the organization that contains your `.github-private` repository.

The "Configuration summary" on the settings page will display the settings taken from this repository.

## Protecting your governance repository

To control who can propose and merge changes to the governance settings stored here, you can create a repository ruleset that targets the branches and files in your `.github-private` repository. See [AUTOTITLE](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/creating-rulesets-for-a-repository).

## Next steps
* [AUTOTITLE](https://funcoding.ai/agents/github-copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents/)
* [AUTOTITLE](https://funcoding.ai/agents/github-copilot/how-tos/administer-copilot/manage-for-enterprise/use-managed-settings/get-started/)
