Question 140
A team has implemented the following change: Decline trust until reviewing the repository and run the agent only within vetted directories. The original requirement was: Copilot CLI asks whether to trust the folder containing a newly downloaded unknown repository. Which ONE validation test best demonstrates the intended behavior?
- Inspect trust prompts and verify the chosen working directory contains approved files only.
- Ask the new session to summarize only the vetted target file and compare with a prior confused answer.
- Ask a factual question about a specific section and verify the file reference was used.
- Ask a harmless repository-summary question after login and verify authorized responses.
Explanation
Correct Answer
A:Inspect trust prompts and verify the chosen working directory contains approved files only.
Incorrect Answers
B:Ask the new session to summarize only the vetted target file and compare with a prior confused answer.
C:Ask a factual question about a specific section and verify the file reference was used. That check cannot demonstrate validated approved cryptographic requirements.
D:Ask a harmless repository-summary question after login and verify authorized responses. That check cannot demonstrate validated approved cryptographic requirements.
Question 141
During troubleshooting, investigators observe: A tool reads and proposes commands against untrusted downloaded code. The system context is: Copilot CLI asks whether to trust the folder containing a newly downloaded unknown repository. Which ONE cause most directly explains the observed failure?
- An authenticated Copilot entitlement was not established in the terminal session.
- The current directory was assumed safe solely because it was locally checked out.
- The actual file context was omitted from the terminal prompt.
- Conversation history polluted the context for a new independent task.
Explanation
Correct Answer
B:The remedy should therefore be: Decline trust until reviewing the repository and run the agent only within vetted directories.
Incorrect Answers
A:An authenticated Copilot entitlement was not established in the terminal session. The current directory was assumed safe solely because it was locally checked out.
C:The actual file context was omitted from the terminal prompt. The current directory was assumed safe solely because it was locally checked out.
D:Conversation history polluted the context for a new independent task. The current directory was assumed safe solely because it was locally checked out.
Question 142
The current design is: Decline trust until reviewing the repository and run the agent only within vetted directories. The prior failure was: A tool reads and proposes commands against untrusted downloaded code. Which ONE ongoing control best protects against recurrence of that specific failure?
- Start clean sessions for unrelated work and keep durable project rules in instruction files.
- Use directory trust and scoped permissions for every new agentic workspace.
- Use supported authentication methods and avoid exposing personal access tokens in shell history.
- Attach explicit approved paths and avoid unnecessary secrets in CLI prompts.
Explanation
Correct Answer
B:The current directory was assumed safe solely because it was locally checked out. Use directory trust and scoped permissions for every new agentic workspace.
Incorrect Answers
A:Start clean sessions for unrelated work and keep durable project rules in instruction files. It would leave use directory trust and scoped permissions for every new agentic workspace without the specified safeguard.
C:Shell commands from AI tools must be inspected for resolved paths and side effects before destructive execution. It would leave use directory trust and scoped permissions for every new agentic workspace without the specified safeguard.
D:Cryptographic algorithm decisions must follow authoritative security standards rather than unverified model claims. Preventing this failure involves using directory trust and scoped permissions for every new agentic workspace.
Question 143
A team reports: A release engineer wants a one-off text answer from Copilot CLI without opening the interactive full-screen session. They observe: The pipeline hangs waiting for interactive instructions from a full CLI session. Which ONE technical decision most directly corrects the cause?
- Use the supported noninteractive `copilot -p` command with a bounded harmless question.
- Use the CLI's `/login` workflow and sign in with an account granted Copilot access.
- Reference the approved file with the CLI's supported `@path` context syntax.
- Use Copilot CLI session resume features rather than assume the plain shell history contains model context.
Explanation
Correct Answer
A:Interactive invocation was selected for a noninteractive question workflow.
Incorrect Answers
B:Using the CLI's `/login` workflow and sign in with an account granted Copilot access would not meet the need for the supported noninteractive `copilot -p` command with a bounded harmless question.
C:Reference the approved file with the CLI's supported `@path` context syntax would not meet the need for the supported noninteractive `copilot -p` command with a bounded harmless question.
D:Using Copilot CLI session resume features rather than assume the plain shell history contains model context would not meet the need for the supported noninteractive `copilot -p` command with a bounded harmless question.
Question 144
A team has implemented the following change: Use the supported noninteractive `copilot -p` command with a bounded harmless question. The original requirement was: A release engineer wants a one-off text answer from Copilot CLI without opening the interactive full-screen session. Which ONE validation test best demonstrates the intended behavior?
- Ask a factual question about a specific section and verify the file reference was used.
- Ask a harmless repository-summary question after login and verify authorized responses.
- Run the command in a test directory and confirm it produces a response without an interactive prompt loop.
- Resume the chosen session and verify the earlier task description and file references are present.
Explanation
Correct Answer
C:Run the command in a test directory and confirm it produces a response without an interactive prompt loop.
Incorrect Answers
A:Ask a factual question about a specific section and verify the file reference was used. That check cannot demonstrate safe execution of generated command-line actions.
B:Ask a harmless repository-summary question after login and verify authorized responses. That check cannot demonstrate safe execution of generated command-line actions.
D:Resume the chosen session and verify the earlier task description and file references are present. That check cannot demonstrate safe execution of generated command-line actions.
Question 145
During troubleshooting, investigators observe: The pipeline hangs waiting for interactive instructions from a full CLI session. The system context is: A release engineer wants a one-off text answer from Copilot CLI without opening the interactive full-screen session. Which ONE cause most directly explains the observed failure?
- An authenticated Copilot entitlement was not established in the terminal session.
- Interactive invocation was selected for a noninteractive question workflow.
- The actual file context was omitted from the terminal prompt.
- Shell history and Copilot session state are not equivalent.
Explanation
Correct Answer
B:The remedy should therefore be: Use the supported noninteractive `copilot -p` command with a bounded harmless question.
Incorrect Answers
A:An authenticated Copilot entitlement was not established in the terminal session. Interactive invocation was selected for a noninteractive question workflow.
C:The actual file context was omitted from the terminal prompt. Interactive invocation was selected for a noninteractive question workflow.
D:Shell history and Copilot session state are not equivalent. Interactive invocation was selected for a noninteractive question workflow.
Question 146
The current design is: Use the supported noninteractive `copilot -p` command with a bounded harmless question. The prior failure was: The pipeline hangs waiting for interactive instructions from a full CLI session. Which ONE ongoing control best protects against recurrence of that specific failure?
- Differentiate one-shot CLI queries from agent sessions in automation scripts.
- Use supported authentication methods and avoid exposing personal access tokens in shell history.
- Attach explicit approved paths and avoid unnecessary secrets in CLI prompts.
- Name or identify sessions for traceable multi-step CLI investigations.
Explanation
Correct Answer
A:Interactive invocation was selected for a noninteractive question workflow. Differentiate one-shot CLI queries from agent sessions in automation scripts.
Incorrect Answers
B:Shell commands from AI tools must be inspected for resolved paths and side effects before destructive execution. It would leave differentiate one-shot CLI queries from agent sessions in automation scripts without the specified safeguard.
C:Cryptographic algorithm decisions must follow authoritative security standards rather than unverified model claims. Preventing this failure involves differentiate one-shot CLI queries from agent sessions in automation scripts.
D:Name or identify sessions for traceable multi-step CLI investigations. It would leave differentiate one-shot CLI queries from agent sessions in automation scripts without the specified safeguard.
Question 147
A team reports: An engineer wants Copilot CLI to inspect one checked-in README instead of searching arbitrary workstation files. They observe: Copilot answers using assumptions about another repository's documentation. Which ONE technical decision most directly corrects the cause?
- Reference the approved file with the CLI's supported `@path` context syntax.
- Confirm Node.js 22 or newer and install the supported `@github/copilot` package by the documented npm command.
- Use the CLI's `/login` workflow and sign in with an account granted Copilot access.
- Use the supported noninteractive `copilot -p` command with a bounded harmless question.
Explanation
Correct Answer
A:Confirm it by checking: Ask a factual question about a specific section and verify the file reference was used.
Incorrect Answers
B:Confirming Node.js 22 or newer and installing the supported `@github/copilot` package by the documented npm command would not address the need for reference the approved file with the CLI's supported `@path` context syntax.
C:Using the CLI's `/login` workflow and sign in with an account granted Copilot access would not address the need for reference the approved file with the CLI's supported `@path` context syntax.
D:Using the supported noninteractive `copilot -p` command with a bounded harmless question would not address the need for reference the approved file with the CLI's supported `@path` context syntax.
Question 148
A team has implemented the following change: Reference the approved file with the CLI's supported `@path` context syntax. The original requirement was: An engineer wants Copilot CLI to inspect one checked-in README instead of searching arbitrary workstation files. Which ONE validation test best demonstrates the intended behavior?
- Ask a harmless repository-summary question after login and verify authorized responses.
- Ask a factual question about a specific section and verify the file reference was used.
- Run the command in a test directory and confirm it produces a response without an interactive prompt loop.
- Run `copilot` and `/help` after installation in a trusted practice folder.
Explanation
Correct Answer
B:Ask a factual question about a specific section and verify the file reference was used.
Incorrect Answers
A:Ask a harmless repository-summary question after login and verify authorized responses. That check cannot demonstrate ask a factual question about a specific section and verify the file reference was used.
C:Shell commands from AI tools must be inspected for resolved paths and side effects before destructive execution. That check cannot demonstrate ask a factual question about a specific section and verify the file reference was used.
D:Generated code requires independently defined acceptance tests and review against the real program contract. That check cannot demonstrate ask a factual question about a specific section and verify the file reference was used.
Question 149
During troubleshooting, investigators observe: Copilot answers using assumptions about another repository's documentation. The system context is: An engineer wants Copilot CLI to inspect one checked-in README instead of searching arbitrary workstation files. Which ONE cause most directly explains the observed failure?
- The documented CLI runtime prerequisite was not met.
- An authenticated Copilot entitlement was not established in the terminal session.
- Interactive invocation was selected for a noninteractive question workflow.
- The actual file context was omitted from the terminal prompt.
Explanation
Correct Answer
D:The remedy should therefore be: Reference the approved file with the CLI's supported `@path` context syntax.
Incorrect Answers
A:The documented CLI runtime prerequisite was not met. The actual file context was omitted from the terminal prompt.
B:An authenticated Copilot entitlement was not established in the terminal session. The actual file context was omitted from the terminal prompt.
C:Interactive invocation was selected for a noninteractive question workflow. The actual file context was omitted from the terminal prompt.
Question 150
The current design is: Reference the approved file with the CLI's supported `@path` context syntax. The prior failure was: Copilot answers using assumptions about another repository's documentation. Which ONE ongoing control best protects against recurrence of that specific failure?
- Differentiate one-shot CLI queries from agent sessions in automation scripts.
- Attach explicit approved paths and avoid unnecessary secrets in CLI prompts.
- Use supported authentication methods and avoid exposing personal access tokens in shell history.
- Pin and update the approved Node runtime and CLI release together.
Explanation
Correct Answer
B:Attach explicit approved paths and avoid unnecessary secrets in CLI prompts.
Incorrect Answers
A:Differentiate one-shot CLI queries from agent sessions in automation scripts. Preventing this failure involves attach explicit approved paths and avoid unnecessary secrets in CLI prompts.
C:Shell commands from AI tools must be inspected for resolved paths and side effects before destructive execution. Preventing this failure involves attach explicit approved paths and avoid unnecessary secrets in CLI prompts.
D:Cryptographic algorithm decisions must follow authoritative security standards rather than unverified model claims. Preventing this failure involves attach explicit approved paths and avoid unnecessary secrets in CLI prompts.
GitHub Copilot (GH-300) Practice Tests