Answer: You block dangerous tools by defining a list of blocked tool names and using the onPreToolUse hook to return a permissionDecision of "deny" with a reason when the tool name is in that list, otherwise returning "allow". Status: Confirmed Entry: tool/github-copilot/permissions-and-security/block-dangerous-tools-hook Revision: 2 Digest: sha256:ea2002beae926eac (changes whenever the content changes) Timeline: Created: 2026-11-13T03:28:30Z Last changed: 2026-11-18T13:04:10Z (blocked tools list: BLOCKED_TOOLS → shell) Last verified: 2026-11-20T13:08:58Z Next check: 2026-11-21T13:08:58Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of blocked tools list | shell | [1] | 2026-11-20 hook name | onPreToolUse | [1] | 2026-11-20 deny decision | deny | [1] | 2026-11-20 deny reason | Shell access is not permitted | [1] | 2026-11-20 allow decision | allow | [1] | 2026-11-20 Sources: [1] GitHub. "Session hooks - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-sdk/hooks/hooks-overview Role: primary. Accessed: 2026-11-20T13:08:58Z Quote: "const BLOCKED_TOOLS = [ "shell" , "bash" , "exec" ];" (Supports: blocked tools list) Quote: "onPreToolUse : async (input) => {" (Supports: hook name) Quote: "permissionDecision : "deny"" (Supports: deny decision) Quote: "permissionDecisionReason : "Shell access is not permitted"" (Supports: deny reason) Quote: "return { permissionDecision : "allow" };" (Supports: allow decision) Snapshot SHA-256: 0d279d9e576a983d3a2eef1c9e5138cc225c4dcabb793cb545c1ba9a764fb490 (captured 2026-11-18T13:04:08Z) 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:04:10Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:08:58Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:08:58Z Last attempt: 2026-11-20T13:08:58Z Notes and limitations: Extracted automatically from a single official source (section "Blocking dangerous tools"). Related: https://latestn.com/tool/github-copilot/permissions-and-security/built-in-protections What built-in protections does GitHub Copilot provide for cloud agents in an enterprise? https://latestn.com/tool/github-copilot/permissions-and-security/check-current-filesystem-policy How do I check what the current filesystem policy allows in GitHub Copilot CLI sandboxing? https://latestn.com/tool/github-copilot/permissions-and-security/choose-tool-permissions How do I choose tool permissions for an agent session in the GitHub Copilot app? https://latestn.com/tool/github-copilot/permissions-and-security/autopilot-permissions What permissions and autonomy settings does GitHub Copilot Autopilot use? https://latestn.com/tool/github-copilot/permissions-and-security/azure-managed-identity-byok How do I configure Azure Managed Identity with BYOK for the Copilot SDK? https://latestn.com/tool/github-copilot/permissions-and-security/backend-authentication-options How do I authenticate GitHub Copilot SDK backend services using environment variable tokens, per-user OAuth tokens, or BYOK? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T13:04:10Z | changed | blocked tools list: BLOCKED_TOOLS → shell | [1] 2026-11-13T03:28:30Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/permissions-and-security/block-dangerous-tools-hook/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/block-dangerous-tools-hook POST: https://latestn.com/dispute/tool/github-copilot/permissions-and-security/block-dangerous-tools-hook with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/permissions-and-security/block-dangerous-tools-hook?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I block dangerous tools using hooks in the GitHub Copilot SDK? Revision 2, last verified 2026-11-20T13:08:58Z. https://latestn.com/tool/github-copilot/permissions-and-security/block-dangerous-tools-hook (accessed 2026-11-21T10:01:06Z). @misc{LatestN_tool_github_copilot_permissions_and_security_block_dangerous_tools_hook_r2, title = {How do I block dangerous tools using hooks in the GitHub Copilot SDK?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/permissions-and-security/block-dangerous-tools-hook}}, note = {Revision 2; digest sha256:ea2002beae926eac; last verified 2026-11-20T13:08:58Z; accessed 2026-11-21T10:01:06Z} } 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/block-dangerous-tools-hook