A developer accepts a Copilot suggestion that builds a SQL query by concatenating user input directly into the statement. Which statement best describes the responsible way to handle the risk that Copilot can produce insecure code?
- ACopilot guarantees the suggestion is safe because its proxy filters block insecure patterns, so the developer can merge the concatenated query without further checks.
- BEnabling content exclusions on the repository will rewrite the unsafe query into a parameterised statement automatically before the suggestion is ever shown.
- CSwitching the request to Copilot Chat instead of inline completions removes the vulnerability, because Chat validates all generated code against security benchmarks.
- DSuggestions can contain vulnerabilities such as injection flaws, so the developer remains accountable for reviewing the code and running security tooling before merging it. Correct
Why A is wrong: The proxy filters target things like matching public code, not every vulnerability, so trusting it to certify security lets an injection-prone query through unchecked.
Why B is wrong: Content exclusions only stop named files being used as context and never rewrite suggestions, so they cannot turn an unsafe query into a parameterised one.
Why C is wrong: Chat is a different surface, not a security gate, and it does not certify code against benchmarks, so the injection risk would persist regardless of the surface used.
Why D is correct: Copilot can reproduce insecure patterns, and responsible use keeps the developer accountable for review and security scanning, which would catch the unsafe concatenation here.