A developer wants Copilot CLI to inspect failing tests and suggest a workflow fix. The repository is in ~/work/payment-api, but the developer starts the CLI from the home directory. What should the developer change first to apply an appropriate guardrail?
cd ~
copilot
# Prompt:
# Find the failing tests, update the GitHub Actions workflow if needed,
# commit the changes, and prepare a pull request.Choose an answer
Tap an option to check your answer.
Correct answer: Start Copilot from the trusted repository.
Why this is the answer
The correct answer is to start Copilot from the trusted repository. Copilot CLI, like many developer tools, operates within the context of the current working directory. For it to effectively analyze failing tests, suggest workflow changes, and interact with the repository (e.g., commit, create a pull request), it needs to be executed from within the repository's root directory (~/work/payment-api). Starting it from the home directory (~) means it lacks the necessary context to perform repository-specific actions, acting as a crucial guardrail to prevent unintended operations outside the intended project. Adding a pull request template is a good practice but doesn't address the immediate need for Copilot to operate within the repository context. Granting Copilot access to every workspace folder is overly broad and unnecessary, posing a security risk without solving the immediate contextual issue. Running gh pr create before local validation is premature and doesn't enable Copilot to perform the requested analysis and modifications.
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