A developer uses Copilot CLI in a repository that has organization-approved hooks. Copilot proposes a command that would modify production infrastructure while fixing a deployment issue. The session stops before the command runs. Which option best explains the behaviour? Select one answer.
Copilot CLI session: cpl_98a1
Repository: octo-org/payments-api
Hook configuration: .github/hooks/copilot-cli-policy.json
Event: preToolUse
toolName: bash
toolArgs.command: terraform apply -auto-approve -target=module.prod_database
Policy decision:
{
"permissionDecision": "deny",
"permissionDecisionReason": "Production infrastructure changes require platform-team approval. Open an esc
alation issue with the proposed plan and attach the command."
}
Result:
Tool execution blocked before bash command started.
Audit entry written to .github/hooks/logs/audit.jsonlChoose an answer
Tap an option to check your answer.
Correct answer: A preToolUse hook escalated the command.
Why this is the answer
The correct answer is that a preToolUse hook escalated the command. The provided Policy decision clearly shows permissionDecision: "deny" for the terraform apply command, along with a permissionDecisionReason explaining why. This denial happened during the preToolUse event, meaning the hook intercepted the command before it could execute. The Result confirms this, stating "Tool execution blocked before bash command started." The other options are incorrect because they are not supported by the provided information. There's no indication that the Actions runner cannot locate Terraform; the command was blocked by policy, not execution failure. The repository's lack of deployment environment secrets is irrelevant here, as the command was not even attempted. Branch protection is also not applicable, as this is about a command being run by Copilot CLI, not a direct push to a branch.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed