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
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.
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, such as static analysis, CodeQL, dependency scanning, secret scanning, or custom policy checks, or manual, such as 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, such as pass or fail, scanner output, or reviewer identity, is logged.
This directly addresses a key risk of agentic systems: the agent's motivation is to complete its task, such as generating 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.
The chain-of-thought prompting choice is incorrect because it 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.
The dual-write architecture choice is incorrect because it is a resilience pattern for availability, such as surviving the failure of one write path, not a security control for validating generated code.
The dead-letter queue pattern choice is incorrect because it buffers failed operations for retry. It is an error-recovery pattern, not a security review pattern.