Valid GH-600 Dumps shared by ExamDiscuss.com for Helping Passing GH-600 Exam! ExamDiscuss.com now offer the newest GH-600 exam dumps, the ExamDiscuss.com GH-600 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com GH-600 dumps with Test Engine here:
You have a GitHub repository. Developers use the GitHub Copilot CLI and repository-scoped hooks under .github/hooks/*.json. You need to allow the Copilot CLI to automatically run low-risk Bash commands. The solution must prevent the autonomous execution of high-risk commands, such as sudo, rm -rf, and curl ... | bash. What should you do?
Correct Answer: C
A preToolUse hook evaluates the proposed command before the shell tool executes it. The hook can inspect command arguments and return permissionDecision: "deny" when a pattern indicates a high-risk operation, while allowing low-risk commands to continue automatically. This is the correct enforcement point because the requirement is preventive. A policy banner only informs the user or agent; it cannot block execution. Logging submitted prompts provides audit information but does not evaluate the actual shell command. Ignoring the hooks directory simply removes the repository-scoped enforcement mechanism. The hook should use precise matching rules. For example, it can deny sudo, destructive recursive deletion, and piping untrusted remote content into a shell, while allowing commands such as git status, package metadata inspection, and test execution. Rules should avoid broad string matching that blocks harmless commands merely because they contain similar text. Study-guide topics: pre-execution guardrails, shell-command approval, policy enforcement, and autonomous tool safety. Reference: GitHub Copilot-Hooks reference.