A security scan flags an injection flaw in an API handler, and you ask a coding agent to fix it. What makes the fix safe to merge?
- Exam domain
- Using coding agents for application development~17% of the exam
- Difficulty
- Hard
- In this mock
- 10 questions on this domainPractise this domain
Why the exam asks this
Using coding agents effectively.
Objective in the exam guide: Using coding agents to refactor source code, optimize execution runtimes, and patch application-layer vulnerabilities.
Agent-written security fixes still need proof that they work.
Why B is the answer
Tests that reproduce it, a rescan, and human review
Evidence makes an agent's patch trustworthy: a test that fails before and passes after, a clean rescan, and review of the change.
Remember: Agent fixes need tests, a rescan and review.
How it works
A test that reproduces the flaw shows the fix closes it.
A rescan and a human review catch what the test misses.
Clues in the question
The words that point to the answer, and what each one tells you.
- safe to merge
- Evidence, not confidence.
In detail
- The exam guide includes patching application-layer vulnerabilities with coding agents.
- Agents propose changes, and checks and people accept them.
- Ask the agent to explain the root cause in the pull request.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Turning off the scanner so it stops flagging the handlerWrong
Silencing the scanner hides the flaw.
B. Tests that reproduce it, a rescan, and human reviewRight
Agent fixes need tests, a rescan and review.
C. The agent saying it is confident in the fixWrongMost tempting
Confidence is not evidence.
Why it tempts: Model confidence is not evidence.
D. Merging straight away, because agents do not make mistakesWrong
Agents do make mistakes, which is why checks exist.
Use case
An illustrative scenario, not a real incident.
Illustrative: an agent parameterizes a SQL query, adds a test with a malicious input, and the scanner finding clears before review.
See it in different ways
flowchart LR S0["Reproduce with a test"] --> S1["Agent patches"] --> S2["Tests and rescan pass"] --> S3["Human review"] --> S4["Merge"]
How to read this chart
- Read it in order: Reproduce with a test, then Agent patches, then Tests and rescan pass, then Human review, then Merge.
stateDiagram-v2 state "Patch proposed" as s0 state "Checks pass" as s1 state "Merged" as s2 state "Rework" as s3 [*] --> s0 s0 --> s1: tests and rescan s1 --> s2: reviewer approves s0 --> s3: checks fail s2 --> [*] s3 --> [*]
How to read this chart
- It starts at "Patch proposed".
- From "Patch proposed", "tests and rescan" moves it to "Checks pass".
- From "Checks pass", "reviewer approves" moves it to "Merged".
- From "Patch proposed", "checks fail" moves it to "Rework".
- It ends at "Merged" or "Rework".