Question 310
A CI agent reviews a pull request containing untrusted contributor code and prepares a patch, without any authority to release production. Which THREE controls make this CI workflow safer? (Select THREE.)
Explanation
Correct Answers
Use a short-lived credential restricted to the specific repository and the review job's required operations. A pull-request CI worker should not inherit a personal administrator token or long-lived production secret simply to read code and propose a patch. Limit the token's audience, permissions and lifetime, and ensure unrelated repositories or release systems reject it. This shrinks the impact of a malicious contribution or accidental shell command while allowing the authorized review to complete. Production-release permissions are explicitly outside this review role.
Run the relevant tests on the exact candidate patch revision and preserve the observed commands, exit statuses and failure diagnostics. A model's statement that the patch looks correct is not evidence that the changed behavior passes. This control makes the CI outcome reproducible and separates an authored recommendation from an executable validation result. A failure in a required security or regression test should block a PASS rather than be averaged with unrelated successes or overwritten by the agent's narrative.
Bind code review and edits to the actual checked-out pull-request commit and authorized diff scope, then inspect the resulting changes against that base. This avoids applying a correct-looking patch to an unrelated branch or silently changing files that the job was not authorized to modify. Explicit scope also reduces the risk that malicious contributor content steers the agent toward unrelated repository paths. The agent should preserve the target SHA and require a new review if the branch changes while work is in progress.
Incorrect Answers
Removing change logs from an automated pull-request review would destroy evidence of what the CI agent inspected, edited and tested. The workflow handles untrusted contributor code, so traceability is particularly important when a tool unexpectedly executes or a patch changes unrelated files. Record the checked-out commit, proposed diff, tool outcomes and test results using redacted logs. Automation does not justify disabling audit or weakening accountability for a change that may affect shared source code.
Organization-wide administrator credentials would give a review job disproportionate power across repositories, workflows and potentially deployment secrets. A malicious pull request could then exploit that broad capability even though the legitimate task is limited to analysis and a scoped patch. Use a short-lived repository-specific identity and isolate the build environment. The scope of a CI job does not justify unrestricted administrative access to the organization.
A fluent statement that tests passed does not grant permission to release production. This agent explicitly lacks publishing authority and should not acquire it from its own result text. Real test receipts must be checked against the target commit, and promotion remains subject to a separate authorized release gate. Allowing self-publishing would transform untrusted PR review into an uncontrolled deployment path. Keep review, patch creation and production release as distinct operations.



Claude Certified Architect - Foundations (CCA-F) Practice Tests