Repository navigation
[bot] Document agent-scoped hooks in Learning Hub - #5062
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🚦 Submission status: ⏳ Awaiting automationRisk tier: Why this tier
Automated checks
Action needed
Review
Commands
Updated for |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
aaronpowell
left a comment
There was a problem hiding this comment.
@copilot - review this feedback
The agent-scoped hooks section and the autopilot ask → deny note are accurate and worth having. Before merge, please:
- Drop the
Telemetry and Folder Trust Flagssection and theghapp://install snippet — #5196 covers both in the same files. - Add a source for the bullet saying user-setting keys in
~/.copilot/config.jsonare ignored, or remove it. The v1.0.97 notes only say saved settings are kept when oneconfig.jsonentry is invalid. - Do the same for the
copilot configsubcommands section, or move it to its own update. - Bring the title and description back in line with the hooks-only scope.
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Removed the config and plugin-install additions, including the unsupported config claim, telemetry/trust flags, and |
|
🟡 Contributor Reputation Check: MEDIUM risk
Maintainers: please review this contributor before merging. |
There was a problem hiding this comment.
🟡 Changes recommended
Two active documentation issues remain: the hooks section lacks an authoritative syntax example, and it does not clearly limit agent-scoped hooks to Copilot CLI.
2 open issues
What changed in this PR
Documents Copilot CLI v1.0.97 agent-scoped declarative hooks in the Learning Hub, including autopilot handling of ask decisions.
Changes:
- Adds agent-scoped hooks guidance to the custom agents guide.
- Adds an “Agent-Scoped Hooks” section to the hooks guide.
- Documents that autopilot denies
preToolUsehooks returningask.
| File | Summary | Final review comments |
|---|---|---|
website/src/content/docs/learning-hub/building-custom-agents.md |
Adds agent-scoped hooks guidance to custom-agent frontmatter documentation. | Nit, 3 votes: Qualify the guidance as Copilot CLI-only so readers do not assume support in VS Code or Copilot coding agent. |
website/src/content/docs/learning-hub/automating-with-hooks.md |
Documents agent-scoped hooks and autopilot preToolUse behavior. |
Nit, 3 votes: Link to the authoritative agent-scoped hooks syntax reference or include a minimal frontmatter example. Nit, 1 vote: Identify the capability as CLI-specific and include the minimum version or supported hosts. Nit, 1 vote: Document the precise preToolUse response shape for ask/allow/deny and reconcile it with the existing exit-code guidance. |
Review effort: Lite (auto)
|
|
||
| ### Agent-Scoped Hooks | ||
|
|
||
| Custom agents can declare their own hooks declaratively, so the hooks apply only while that agent is running rather than to every session in the repository. Use this for guardrails that belong to one agent (for example, a security reviewer that blocks writes) while keeping repository-wide hooks in `.github/hooks/`. See [Building Custom Agents](../building-custom-agents/) for the agent file format and the [Copilot CLI changelog](https://github.com/github/copilot-cli/blob/main/changelog.md) for the current hook-declaration syntax. |
| --- | ||
| ``` | ||
|
|
||
| **Agent-scoped hooks**: An agent can declare hooks that run only while that agent is active, which is useful for per-agent guardrails such as validating commands or logging. See [Automating with Hooks](../automating-with-hooks/#agent-scoped-hooks). |

New features found
preToolUsehook'saskdecision instead of blocking on a permission dialog.Sections updated
automating-with-hooks.md: new "Agent-Scoped Hooks" section, including the autopilotaskbehavior.building-custom-agents.md: frontmatter note on agent-scoped hooks, linking to the hooks guide.Sources
Content cleanup
None needed this run. No inline version tags were added, and the existing Compatibility and Migration Notes sections were left unchanged.
Not checked: the web changelog pages, because web-fetch was unavailable. The check covered the copilot-cli releases only.