Answer: Return a block decision to refuse the prompt: {"decision": "block", "reason": "Prompts may not include credentials."} No model turn runs and no user message is recorded, and the session emits an ephemeral session.warning with warningType: "policy_blocked" that carries the reason. Status: Confirmed Entry: tool/github-copilot/agents-and-automation/block-user-prompt-hook Revision: 3 Digest: sha256:99f6ebc40df78949 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:28:38Z Last changed: 2026-11-19T13:02:44Z (Java decision: — → User Prompt Submitted Hook Output.block(reason)) Last verified: 2026-11-20T13:09:09Z Next check: 2026-11-21T13:09:09Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Block decision | block | [1] | 2026-11-20 Reason example | Prompts may not include credentials. | [1] | 2026-11-20 Warning type | policy_blocked | [1] | 2026-11-20 Node.js / Python decision | decision: "block" | [1] | 2026-11-20 Go / .NET decision | Decision = "block" | [1] | 2026-11-20 Rust decision | decision: Some("block".into()) | [1] | 2026-11-20 Java decision | User Prompt Submitted Hook Output.block(reason) | [1] | 2026-11-20 Go empty reason behavior | In Go, an empty Reason is omitted from the output, and the prompt is blocked only when a reason is present. | [1] | 2026-11-20 Sources: [1] GitHub. "User prompt submitted hook - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-sdk/hooks/user-prompt-submitted Role: primary. Accessed: 2026-11-20T13:09:09Z Quote: "Return a block decision to refuse the prompt: { "decision" : "block" , "reason" : "Prompts may not include credentials." }" (Supports: Block decision) Quote: ""reason" : "Prompts may not include credentials."" (Supports: Reason example) Quote: "The session emits an ephemeral session.warning with warningType: "policy_blocked" that carries the reason." (Supports: Warning type) Quote: "Block the prompt decision: "block"" (Supports: Node.js / Python decision) Quote: "Decision = "block"" (Supports: Go / .NET decision) Quote: "decision: Some("block".into())" (Supports: Rust decision) Quote: "User Prompt Submitted Hook Output.block(reason)" (Supports: Java decision) Quote: "In Go, an empty Reason is omitted from the output, and the prompt is blocked only when a reason is present." (Supports: Go empty reason behavior) Snapshot SHA-256: 758bcb5515c6532a256f90821442e9c18a0c0c9c71908f0c34ebf2a90640f294 (captured 2026-11-18T13:04:22Z) 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:22Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:09:09Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:09:09Z Last attempt: 2026-11-20T13:09:09Z Notes and limitations: Extracted automatically from a single official source (section "Blocking a prompt"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/bug-fix-teammate-agent-profile What does the GitHub Copilot bug fix teammate agent profile include? https://latestn.com/tool/github-copilot/agents-and-automation/built-in-agents What are the built-in agents in GitHub Copilot? https://latestn.com/tool/github-copilot/agents-and-automation/change-tools-during-session How do I change the tools available during a GitHub Copilot SDK session? https://latestn.com/tool/github-copilot/agents-and-automation/automation-triggers What triggers can start a GitHub Copilot automation? https://latestn.com/tool/github-copilot/agents-and-automation/autopilot-considerations What should I consider before letting GitHub Copilot Autopilot work autonomously? https://latestn.com/tool/github-copilot/agents-and-automation/available-session-hooks What session hooks are available in the GitHub Copilot SDK? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:02:44Z | changed | Java decision: — → User Prompt Submitted Hook Output.block(reason) | [1] 2026-11-19T13:02:44Z | changed | Rust decision: — → decision: Some("block".into()) | [1] 2026-11-19T13:02:44Z | changed | Go / .NET decision: — → Decision = "block" | [1] 2026-11-19T13:02:44Z | changed | Node.js / Python decision: — → decision: "block" | [1] 2026-11-19T13:02:44Z | changed | Warning type: — → policy_blocked | [1] 2026-11-19T13:02:44Z | changed | Reason example: — → Prompts may not include credentials. | [1] 2026-11-19T13:02:44Z | changed | Block decision: — → block | [1] 2026-11-19T13:02:44Z | changed | Go empty reason behavior: an empty Reason is omitted from the output, and the prompt is blocked only when a reason is present → In Go, an empty Reason is omitted from the output, and the prompt is blocked only when a reason is present. | [1] 2026-11-19T13:02:44Z | changed | Java member: User Prompt Submitted Hook Output.block(reason) → — | [1] 2026-11-19T13:02:44Z | changed | Rust member: decision: Some("block".into()) → — | [1] 2026-11-19T13:02:44Z | changed | Go / .NET member: Decision = "block" → — | [1] 2026-11-19T13:02:44Z | changed | Node.js / Python member: decision: "block" → — | [1] 2026-11-19T13:02:44Z | changed | warning type: policy_blocked → — | [1] 2026-11-19T13:02:44Z | changed | block decision: block → — | [1] 2026-11-17T13:27:21Z | changed | Java member: — → User Prompt Submitted Hook Output.block(reason) | [1] 2026-11-17T13:27:21Z | changed | Rust member: — → decision: Some("block".into()) | [1] 2026-11-17T13:27:21Z | changed | Go / .NET member: — → Decision = "block" | [1] 2026-11-17T13:27:21Z | changed | Node.js / Python member: — → decision: "block" | [1] 2026-11-17T13:27:21Z | changed | Go empty reason behavior: In Go, an empty Reason is omitted from the output, and the prompt is blocked only when a reason is present. → an empty Reason is omitted from the output, and the prompt is blocked only when a reason is present | [1] 2026-11-17T13:27:21Z | changed | Java method: User Prompt Submitted Hook Output.block(reason) → — | [1] 2026-11-17T13:27:21Z | changed | Rust decision: decision: Some("block".into()) → — | [1] 2026-11-17T13:27:21Z | changed | Go / .NET decision: Decision = "block" → — | [1] 2026-11-17T13:27:21Z | changed | Node.js / Python decision: decision: "block" → — | [1] 2026-11-17T13:27:21Z | changed | reason example: Prompts may not include credentials. → — | [1] 2026-11-13T03:28:38Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/block-user-prompt-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/agents-and-automation/block-user-prompt-hook POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/block-user-prompt-hook with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/block-user-prompt-hook?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I block a user prompt in the GitHub Copilot SDK user prompt submitted hook? Revision 3, last verified 2026-11-20T13:09:09Z. https://latestn.com/tool/github-copilot/agents-and-automation/block-user-prompt-hook (accessed 2026-11-21T09:58:35Z). @misc{LatestN_tool_github_copilot_agents_and_automation_block_user_prompt_hook_r3, title = {How do I block a user prompt in the GitHub Copilot SDK user prompt submitted hook?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/block-user-prompt-hook}}, note = {Revision 3; digest sha256:99f6ebc40df78949; last verified 2026-11-20T13:09:09Z; accessed 2026-11-21T09:58:35Z} } 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/agents-and-automation/block-user-prompt-hook