Answer: You implement the GitHub Copilot user prompt transformed hook by registering an onUserPromptTransformed hook in the session's hooks configuration that returns a modifiedTransformedPrompt, as shown in the TypeScript example using client.createSession with hooks: { onUserPromptTransformed: async (input) => ({ modifiedTransformedPrompt: redact(input.transformedPrompt) }) }. Status: Confirmed Entry: tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-example Revision: 1 Digest: sha256:39ca5a0cccad61b7 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:28:41Z Last changed: 2026-11-13T03:28:41Z Last verified: 2026-11-20T13:09:13Z Next check: 2026-11-21T13:09:13Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of TypeScript hook name | onUserPromptTransformed | [1] | 2026-11-20 Python hook name | on_user_prompt_transformed | [1] | 2026-11-20 Go hook name | OnUserPromptTransformed | [1] | 2026-11-20 .NET hook name | OnUserPromptTransformed | [1] | 2026-11-20 Java hook name | setOnUserPromptTransformed | [1] | 2026-11-20 Rust hook name | on_user_prompt_transformed | [1] | 2026-11-20 Persistence behavior | The replacement is persisted as the user message content | [1] | 2026-11-20 Sources: [1] GitHub. "User prompt transformed hook - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-sdk/hooks/user-prompt-transformed Role: primary. Accessed: 2026-11-20T13:09:13Z Quote: "onUserPromptTransformed : async (input) => ({ modifiedTransformedPrompt : redact (input. transformedPrompt ), })" (Supports: TypeScript hook name) Quote: ""on_user_prompt_transformed" : lambda input_data, invocation:" (Supports: Python hook name) Quote: "OnUserPromptTransformed: func (input copilot.UserPromptTransformedHookInput, invocation copilot.HookInvocation)" (Supports: Go hook name) Quote: "OnUserPromptTransformed = (input, invocation) => Task.FromResult" (Supports: .NET hook name) Quote: "setOnUserPromptTransformed((input, invocation) -> CompletableFuture.completedFuture(" (Supports: Java hook name) Quote: "async fn on_user_prompt_transformed ( & self , input: UserPromptTransformedInput, _ctx: HookContext," (Supports: Rust hook name) Quote: "The replacement is persisted as the user message content, so resumed sessions replay the modified content unchanged." (Supports: Persistence behavior) Snapshot SHA-256: 2a8119be06d42104bccd6768754568a1518061a6d7f507772fe75f88a912a35c (captured 2026-11-18T13:04:26Z) 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:27Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:09:13Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:09:13Z Last attempt: 2026-11-20T13:09:13Z Notes and limitations: Extracted automatically from a single official source (section "Examples"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-io What input and output does the GitHub Copilot user prompt transformed hook receive and return? https://latestn.com/tool/github-copilot/agents-and-automation/what-are-agent-skills What are agent skills in GitHub Copilot and what can they do? https://latestn.com/tool/github-copilot/agents-and-automation/what-are-copilot-agents What are GitHub Copilot agents and what can they do? https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-hook-best-practices What are the best practices for using the GitHub Copilot SDK user prompt submitted hook? https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-hook-signature What input and output does the GitHub Copilot SDK user prompt submitted hook receive and return? https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook How do I transform a user prompt with a hook in the GitHub Copilot SDK? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:28:41Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-example/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/user-prompt-transformed-hook-example POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-example with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-example?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I implement the GitHub Copilot user prompt transformed hook? Revision 1, last verified 2026-11-20T13:09:13Z. https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-example (accessed 2026-11-21T09:58:52Z). @misc{LatestN_tool_github_copilot_agents_and_automation_user_prompt_transformed_hook_example_r1, title = {How do I implement the GitHub Copilot user prompt transformed hook?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-example}}, note = {Revision 1; digest sha256:39ca5a0cccad61b7; last verified 2026-11-20T13:09:13Z; accessed 2026-11-21T09:58:52Z} } 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/user-prompt-transformed-hook-example