Answer: Use the preToolUse hook to evaluate a tool call before it runs; it can allow execution by doing nothing or deny execution by returning a structured response. The hook input includes toolName and toolArgs, and a policy script can log attempts and deny high-risk bash patterns such as privilege escalation, destructive operations, and download-and-execute commands. Status: Confirmed Entry: tool/github-copilot/permissions-and-security/enforce-policies-pretooluse Revision: 3 Digest: sha256:91d56b42a2af3fab (changes whenever the content changes) Timeline: Created: 2026-11-13T03:33:10Z Last changed: 2026-11-19T13:08:48Z (download-and-execute rule: — → Download-and-execute patterns require manual approval.) Last verified: 2026-11-20T13:15:07Z Next check: 2026-11-21T13:15:07Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of hook purpose | evaluate a tool call before it runs | [1] | 2026-11-20 allow behavior | allow execution (by doing nothing) | [1] | 2026-11-20 deny behavior | deny execution (by returning a structured response) | [1] | 2026-11-20 input field toolName | toolName | [1] | 2026-11-20 input field toolArgs | toolArgs | [1] | 2026-11-20 denial response | permissionDecision:"deny" | [1] | 2026-11-20 privilege escalation rule | Privilege escalation requires manual approval. | [1] | 2026-11-20 download-and-execute rule | Download-and-execute patterns require manual approval. | [1] | 2026-11-20 Sources: [1] GitHub. "Rolling out Copilot CLI hooks for your teams - GitHub Docs". https://docs.github.com/en/copilot/tutorials/copilot-cli-hooks Role: primary. Accessed: 2026-11-20T13:15:07Z Quote: "Use the preToolUse hook to evaluate a tool call before it runs" (Supports: hook purpose) Quote: "This hook can allow execution (by doing nothing) or deny execution (by returning a structured response)." (Supports: allow behavior, deny behavior) Quote: "toolName : The tool that Copilot CLI is about to run (for example, bash )" (Supports: input field toolName) Quote: "toolArgs : A JSON string containing that tool’s arguments" (Supports: input field toolArgs) Quote: "'{permissionDecision:"deny", permissionDecisionReason:$r}'" (Supports: denial response) Quote: "deny "Privilege escalation requires manual approval."" (Supports: privilege escalation rule) Quote: "deny "Download-and-execute patterns require manual approval."" (Supports: download-and-execute rule) Snapshot SHA-256: f8bc9b4504be46c82f4ab2f6638a21f9a0f0c9452b9ebe6251ce4b57894be72b (captured 2026-11-18T13:11:33Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:11:34Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:15:07Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:15:07Z Last attempt: 2026-11-20T13:15:07Z Notes and limitations: Extracted automatically from a single official source (section "5. Enforce policies with preToolUse"). Related: https://latestn.com/tool/github-copilot/permissions-and-security/environment-variables-auth How do I use environment variables for authentication in the GitHub Copilot SDK? https://latestn.com/tool/github-copilot/permissions-and-security/find-vulnerabilities-prompt How do I use GitHub Copilot to find existing vulnerabilities in my code? https://latestn.com/tool/github-copilot/permissions-and-security/firewall-limitations What are the limitations of the GitHub Copilot firewall? https://latestn.com/tool/github-copilot/permissions-and-security/enable-local-sandboxing How do I enable local sandboxing for GitHub Copilot? https://latestn.com/tool/github-copilot/permissions-and-security/enable-local-sandboxing-cli How do I enable local sandboxing in GitHub Copilot CLI? https://latestn.com/tool/github-copilot/permissions-and-security/enable-local-sandboxing-repository How do I enable local sandboxing for a repository in the GitHub Copilot app? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:08:48Z | changed | download-and-execute rule: — → Download-and-execute patterns require manual approval. | [1] 2026-11-19T13:08:48Z | changed | privilege escalation rule: — → Privilege escalation requires manual approval. | [1] 2026-11-19T13:08:48Z | changed | denial response: — → permissionDecision:"deny" | [1] 2026-11-19T13:08:48Z | changed | input field toolArgs: — → toolArgs | [1] 2026-11-19T13:08:48Z | changed | input field toolName: — → toolName | [1] 2026-11-19T13:08:48Z | changed | deny behavior: — → deny execution (by returning a structured response) | [1] 2026-11-19T13:08:48Z | changed | log file: .github/hooks/logs/audit.jsonl → — | [1] 2026-11-19T13:08:48Z | changed | script path (PowerShell): .github/hooks/scripts/pre-tool-policy.ps1 → — | [1] 2026-11-19T13:08:48Z | changed | script path (Bash): .github/hooks/scripts/pre-tool-policy.sh → — | [1] 2026-11-19T13:08:48Z | changed | input fields: toolName → — | [1] 2026-11-19T13:08:48Z | changed | deny response: permissionDecision:"deny" → — | [1] 2026-11-16T12:59:36Z | changed | log file: — → .github/hooks/logs/audit.jsonl | [1] 2026-11-16T12:59:36Z | changed | script path (PowerShell): — → .github/hooks/scripts/pre-tool-policy.ps1 | [1] 2026-11-16T12:59:36Z | changed | script path (Bash): — → .github/hooks/scripts/pre-tool-policy.sh | [1] 2026-11-16T12:59:36Z | changed | input fields: — → toolName | [1] 2026-11-16T12:59:36Z | changed | deny response: — → permissionDecision:"deny" | [1] 2026-11-16T12:59:36Z | changed | audit log path: .github/hooks/logs/audit.jsonl → — | [1] 2026-11-16T12:59:36Z | changed | bash script path: .github/hooks/scripts/pre-tool-policy.sh → — | [1] 2026-11-16T12:59:36Z | changed | denial response: permissionDecision:"deny" → — | [1] 2026-11-16T12:59:36Z | changed | input field toolArgs: toolArgs → — | [1] 2026-11-16T12:59:36Z | changed | input field toolName: toolName → — | [1] 2026-11-16T12:59:36Z | changed | deny behavior: deny execution (by returning a structured response) → — | [1] 2026-11-13T03:33:10Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/permissions-and-security/enforce-policies-pretooluse/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/github-copilot/permissions-and-security/enforce-policies-pretooluse POST: https://latestn.com/dispute/tool/github-copilot/permissions-and-security/enforce-policies-pretooluse with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/permissions-and-security/enforce-policies-pretooluse?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I enforce policies on Copilot CLI tool use with a preToolUse hook? Revision 3, last verified 2026-11-20T13:15:07Z. https://latestn.com/tool/github-copilot/permissions-and-security/enforce-policies-pretooluse (accessed 2026-11-21T10:01:43Z). @misc{LatestN_tool_github_copilot_permissions_and_security_enforce_policies_pretooluse_r3, title = {How do I enforce policies on Copilot CLI tool use with a preToolUse hook?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/permissions-and-security/enforce-policies-pretooluse}}, note = {Revision 3; digest sha256:91d56b42a2af3fab; last verified 2026-11-20T13:15:07Z; accessed 2026-11-21T10:01:43Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/github-copilot/permissions-and-security/enforce-policies-pretooluse