Copilot generates a login handler for you. What should you pay most attention to?
Why A is the answer
Security issues, because generated code can contain vulnerabilities
Generated code can contain flaws, and authentication has a high cost of failure. Review it, and use your normal security checks.
In detail
- Login code is security sensitive.
- Generated code can contain vulnerabilities, so check them first.
- Add security scanning for authentication code.
Use case
An illustrative scenario, not a real incident.
Copilot generates a login handler that compares passwords in plain text. It runs, and the formatting is tidy. A security review catches the flaw.
See it in different ways
flowchart LR A["Copilot suggestion"] --> B["Read and understand it"] B --> C["Test it"] C --> D["Check security and licensing"] D --> E["Merge"]
stateDiagram-v2 [*] --> Suggested Suggested --> Reviewed: check correctness, security and fit Reviewed --> Accepted: passes review Reviewed --> Rejected: fails review Accepted --> [*] Rejected --> [*]
mindmap
root(("Login code"))
n1["Check first"]
n2["Password handling"]
n3["Session handling"]
n4["Input validation"]
n5["Check later"]
n6["Formatting"]
n7["Naming"]Key point: Check security first in high-risk code.
Why the other options are wrong
- B. Whether the variable names are shorter than the ones that you would choose
- Variable names are not the main risk.
- C. Whether the formatting matches the style of the surrounding code in the file
- Formatting matters far less than security here.
- D. Whether Copilot produced the code in a single response or across several
- How the code arrived has no effect on its safety.

