Why is Copilot now prohibited from modifying files under .github/agents? #187679
Replies: 4 comments
-
|
Maybe GitHub Copilot was operating under repository-level or org-level guardrails that restrict modifying certain directories (like an it can create pull reqs but still:
it iz bout configured permissions and safety boundaries.... maybe u should check Copilot policies or whether the folder is explicitly excluded in in nutshell: Copilot can submit PRs, but it still follows guardrails set by your repo/org configuration. |
Beta Was this translation helpful? Give feedback.
-
|
GitHub Copilot intentionally blocks modifications to the .github/agents directory. This is a safety guardrail to prevent agents from altering their own configuration, which could cause instability or security issues. The restriction is built-in and can't be disabled. To update your agent docs, have Copilot generate the changes in a separate location, then manually move them into .github/agents, or edit the files directly yourself. This limitation is by design to maintain repository integrity. |
Beta Was this translation helpful? Give feedback.
-
|
This is an intentional security restriction introduced by GitHub. The .github/agents/ directory contains agent configuration files that define how Copilot behaves, so GitHub restricted AI modifications to prevent agents from modifying their own instructions — which would be a security risk. Edit files under .github/agents/ manually through the GitHub UI or your local editor This is similar to how Copilot cannot modify .github/workflows/ files directly in certain contexts — it's a deliberate guardrail, not a bug. |
Beta Was this translation helpful? Give feedback.
-
|
This is intentional and related to the trust boundary for repository automation. The
which is a privilege escalation risk. So Copilot is restricted from editing it to: 🔐 protect workflow integrity If you need changes there, they must be done manually or via a reviewed PR. This follows the same principle as protecting:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Copilot Feature Area
Copilot in GitHub
Body
For a long time, I've used Copilot to analyze the code repository and generate documentation that can be used to customize agents, in order to improve the efficiency of agents within the code repository. However, when I recently tried to instruct Copilot to generate new documentation based on recent commits, Copilot refused, stating that its internal instructions did not allow it to do so.
To be honest, asking a human like me to browse through so many documents and find out which ones need updating is really asking too much. Besides, Copilot submits its changes in a Pull Request, so why should it be prevented from editing documents in the agents folder?
Beta Was this translation helpful? Give feedback.
All reactions