A team wants a safe CI-based agent entry point. Maintainers should be able to invoke the agent for selected issues, the workflow must use least-privilege permissions, and agent-created pull requests must still pass normal validation before merge. Which four actions should you perform in order? 1. Add least-privilege workflow permissions for agent tasks 2. Define the CI trigger and required workflow inputs 3. Assign every new issue to the agent automatically 4. Add branch protection requiring validation checks 5. Commit the workflow to the protected default branch 6. Store a long-lived PAT as an Actions variable
Choose an answer
Tap an option to check your answer.
Correct answer: 2 → 1 → 5 → 4.
Why this is the answer
The correct order is 2 → 1 → 5 → 4. First, 2. Define the CI trigger and required workflow inputs. This establishes how maintainers will invoke the agent (e.g., workflowdispatch event) and specifies necessary inputs like the issue number, which is crucial for a controlled entry point. Next, 1. Add least-privilege workflow permissions for agent tasks. This ensures the agent's CI workflow only has the minimum necessary permissions, aligning with security best practices and preventing over-privileged access. Then, 5. Commit the workflow to the protected default branch. This makes the workflow available for use and ensures it's protected from unauthorized changes, maintaining its integrity. Finally, 4. Add branch protection requiring validation checks. This enforces that any pull requests created by the agent must pass all defined status checks (e.g., tests, linting) before they can be merged, ensuring quality and safety. Option 3 ("Assign every new issue to the agent automatically") is incorrect because the requirement states maintainers should invoke the agent for selected issues, not all. Option 6 ("Store a long-lived PAT as an Actions variable") is generally poor security practice and not explicitly required for this setup, as GitHub Actions often use temporary GITHUBTOKENs. Other incorrect options either misorder critical steps or include unnecessary/insecure actions.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed