A small change request is a good way to find out whether your repository instructions help GitHub Copilot stay in scope. Try a test-only task with one allowed directory and one deliverable.

Set a rule that is easy to check

GitHub supports repository-wide instructions in .github/copilot-instructions.md on supported surfaces. Keep the instruction brief. In a toy repository with a formatter, you might write that requests described as test-only should leave src/ untouched and put test code in tests/. Include the normal test command if the repository has one.

Open a clean branch or sandbox copy of the repository. Ask for one test covering the behavior when a formatter receives a blank string. Repeat the file boundary in the request, and tell Copilot what the existing behavior is supposed to be. Review any planned action before allowing it to write. A repository instruction gives the assistant context. You still own the resulting diff.

Look at the filenames before reading the test

Use your Git view or git diff --stat to see which tracked files changed. Check for an untracked new test file as well. If the proposed change touches src/, pause and ask where the test-only implementation belongs. Sometimes the actual behavior disagrees with the requested expectation, and a failing test is the useful finding.

Run the existing test command and read the new test. Success means the expected files changed, the assertion checks the stated behavior, and the test result is visible. Keep the original rule if it helps across more than one task. Put a one-off constraint in the task itself.

Sources