A developer configures a Copilot agent with a tool that executes shell commands inside a GitHub Actions runner. During a security review, the reviewer flags this as a high-risk configuration. Which TWO mitigations MOST directly reduce the risk of this tool configuration? (Select TWO.)
- A. Enable Dependabot on the repository to scan the agent's dependencies for vulnerabilities.
- B. Store the list of permitted shell commands in a GitHub environment secret so the agent can reference it at runtime.
- C. Require that the agent's shell command output is reviewed and approved by a human before any subsequent agent action is taken.
- D. Restrict the shell command tool to a predefined allow list of permitted commands, rejecting any command not on the list.✓ Correct
- E. Run the agent in a dedicated, ephemeral runner with no access to production credentials or sensitive environment variables.✓ Correct
Explanation
Restricting the tool to a command allow list (Option D) prevents the agent from executing arbitrary or malicious commands, directly limiting the blast radius of any prompt injection or misconfiguration. Using an ephemeral, isolated runner (Option E) ensures that even if a dangerous command executes, it cannot access production secrets or persist state maliciously. Option B is incorrect because storing a command list in a secret doesn't enforce the allow list—it must be enforced in the tool's execution logic, not merely stored as a secret. Option A is incorrect because Dependabot scans dependencies for known CVEs; it does not mitigate the runtime risk of arbitrary shell command execution by an agent. Option C is incorrect because requiring human review of every shell output converts the agent to a human-in-the-loop system, which defeats the purpose of autonomous execution and is not a scalable mitigation.