An architecture team is designing a CI/CD pipeline in which an AI agent generates code changes and immediately commits them. A security engineer recommends inserting a dedicated security-review step between code generation and commit. Which design pattern does this recommendation implement?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Think of it as the two-person integrity rule: no agent should be able to both create and commit code in a single uninterrupted step. Separating generation from execution means a vulnerability scanner or human reviewer always stands between what the agent creates and what actually lands in the repo. The correct answer is C.
Full explanation below image
Full Explanation
The separation of generation and execution is a foundational safety pattern for autonomous code-writing agents. The key insight is that a code generation model may produce code that passes functional tests but contains subtle security vulnerabilities, logic errors, or policy violations. If the agent can commit immediately after generating, these defects enter the codebase with no independent verification.
By inserting a dedicated review step, the pipeline gains a 'checkpoint' where the generated change can be evaluated independently of the generating agent. This checkpoint can be automated (static analysis, CodeQL, dependency scanning, secret scanning, custom policy checks) or manual (human code review), or both.
The pattern also creates a clear audit point: every change that enters the codebase passed through the checkpoint, and the checkpoint's result (pass/fail, scanner output, reviewer identity) is logged.
This directly addresses a key risk of agentic systems: the agent's motivation is to complete its task (generate a passing change), not necessarily to ensure that change is secure. An independent review step provides a check that does not share the agent's optimization objective.
Option A is incorrect because chain-of-thought prompting changes how the agent reasons during generation but does not add an independent verification step after generation. The model's reasoning is still inside the same trust boundary as the output.
Option B is incorrect because dual-write architecture is a resilience pattern for availability (surviving the failure of one write path), not a security control for validating generated code.
Option D is incorrect because a dead-letter queue buffers failed operations for retry — it is an error-recovery pattern, not a security review pattern.