An excluded file in a coding assistant: excluded from what exactly?
Check file exclusions across indexing, chat, agents, terminal commands and MCP using synthetic documents.
Article language: English

In this article
A project folder contains a file labelled "Not for the assistant". The team adds it to an exclusion rule and checks code suggestions. Its contents disappear from suggestions. The next day someone runs an agent that reads files through another route. The note is still on the door, but there is a second entrance.
This fictional situation is worth considering before allowing real material into the working environment. "Excluded" does not establish whether a file was omitted from indexing, suggestions, chat attachments or command execution. These functions may use different mechanisms and permissions.
Suppose a company called Łuk is building an application for arranging exhibition displays. The assistant should help with interface code; contracts with partners are outside the task. The company will not test protections on real contracts. It prepares a separate test project containing only a synthetic document with a fictional marker. The acceptance question is how the specific exclusion behaves in the functions actually used.
One exclusion, several different promises
First ask what the file is excluded from. An index is a prepared collection that makes information easier to find in a project. Absence from the index does not automatically describe another tool's ability to read the file directly. Likewise, a lack of suggestions in an open document says nothing by itself about what an agent can do through a terminal command.
At Łuk, acceptance starts with the functions in use: inline suggestions, questions about a selection and an agent working across files. The team need not test every product on the market, but must name its editor, extension version, account, project and active mode. A result for suggestions cannot be entered as a result for the agent.
The person conducting acceptance needs a description of the active rules. A user may see the effect of an administrator's setting without being able to change it. Record the configuration owner and how to obtain its current scope. Otherwise, after changing accounts, the team cannot tell whether it tested the same rule or merely a similar-looking project.
GitHub Copilot's content exclusion documentation says exclusions are not supported in Copilot Chat's Edit and Agent modes in VS Code and other editors. It also says third-party MCP servers are not guaranteed to respect them. These are limitations of a particular feature to consider when choosing a way of working.
This does not mean every attempt will read prohibited content. It does mean the team cannot rely solely on a setting that does not cover the selected mode. If material must remain inaccessible to the agent, the control must cover its actual capabilities. Start with AI integration permissions (in Polish), then assess the particular environment.
Write the expected effect plainly: in the agreed mode, the assistant should not retrieve the synthetic document's contents from the specified path. Separately record whether the expectation covers hiding the name, preventing search, preventing reading or also preventing editing. A folder name may be visible while its contents remain inaccessible. Record "name visible" separately from "contents read".
Choose scope for the purpose. Excluding large generated files to improve suggestions need not meet requirements for confidential material. When limiting unnecessary data, first ask whether the document needs to be in the project given to the assistant at all. Data minimisation (in Polish) can remove an unnecessary copy before testing a path pattern.
Test each route used to read
Prepare two similarly structured files: one allowed and one excluded. Give each a different, invented exposure marker. The verifier knows the values and can check the result without exposing real contracts. Do not call these markers real passwords or access keys. Record when the rule changed and when its application was confirmed. A trial before settings refresh does not establish the new configuration's behaviour. If the function requires a refresh, include it in preparation and identify the state actually tested.
Keep a short record for each run: function, file, expected result, tool actually used and outcome. The synthetic document itself can remain in the prepared sample. An ordinary report needs a reference that permits repetition, not necessarily the complete contents. This helps identify a single ineffective route later.
First confirm that the allowed file is available through the function, then test the excluded one. If neither can be read, the function may be broken, the path wrong or the project missing. Without a positive control, refusal reveals little about the exclusion.
Separate an answer saying "I cannot read it" from a documented read attempt blocked by access control. A model may refuse without calling a tool, or guess the contents. If the available trace cannot establish what happened, mark the outcome unresolved and agree an additional observation with the environment owner. Do not convert lack of evidence into proof of protection.
Run separate trials for the ways of working in use:
- For suggestions, inspect both files and whether excluded content appears in a suggestion for allowed material.
- In chat, reference the specific file and ask a question requiring its contents. Retain visible source references if the function provides them.
- In agent mode, record each tool that actually reads material. The final answer alone does not describe the complete route.

Do not paste the marker into the question. Asked "Is KORA-742 in the file?", an assistant can repeat the supplied value without reading. Ask for the marker recorded in the document and compare the answer with the key outside the conversation. In a separate run, change the file's value to detect reuse of old context.
Cursor's ignore-file documentation warns that .cursorignore alone does not guarantee blocked access through the agent's terminal or MCP server tools. This does not determine the outcome of a particular attempt: other environment restrictions may also apply and need separate testing. Record the tool used rather than attributing one result to the whole editor.
The separate Cursor run-mode documentation describes command sandboxing and says some commands run outside it. Its table also says .cursorignore can hide files from the agent. Hiding a file from the agent does not guarantee that access through a terminal or MCP server is blocked. A command's execution conditions therefore belong in the result, not in an omitted footnote.
Record whether the run used a built-in read tool, a command in a restricted environment or an external server. Repeat the relevant test after changing permissions. User approval of an operation does not prove that it matches the earlier claim about an inaccessible folder. Approval records a decision; a technical control determines what can happen.
Łuk might decide that the agent works on a separate code copy without the contracts folder. That is a concrete preparation decision. It could instead establish an appropriately restricted execution environment and test it on synthetic data. Agent sandbox file and network boundaries (in Polish) require a broader review than looking at ignored paths.
The rule must survive ordinary project changes
After a successful first run, change the synthetic file's name and location within the prepared sample. A rule for one path may no longer match the moved document. That differs from a tool failing to support a correctly matched rule. Record a pattern error separately from lack of exclusion support.
When moving a project, also account for existing conversations. A new exclusion does not automatically remove a passage already present in task history. Start a separate run without old content to check current reading. Treat the history containing the synthetic marker as a second case: it shows what earlier material the assistant can still use.
For nested projects, establish where active settings come from. Do not assume a configuration in one location covers every way of opening the project. The person preparing the environment should identify active rules and how their application is confirmed. Compare the same files after reopening, not only in an ongoing conversation.
A copy is another case. Excluding the original does not describe text pasted into a question or copied into an allowed file. Decide which material may be attached and how test samples are recognised. A path rule is not an invisible label that follows every sentence.
Repeat the relevant run when adding a tool. A server may read a different folder, use another account or receive files through a separate mechanism. Reviewing changes to MCP tools (in Polish) records what actually entered the environment. An unchanged project name does not mean an unchanged access route.
Restricted access also affects the credibility of the assistant's work. If it cannot see part of the implementation or tests, it should report that limitation. It cannot claim to have checked material it did not read.
If a missing file describes project dependencies, the assistant should request permitted information needed for the task or state the limitation. Reconstructing packages from memory is no substitute for reading. Apply a check of AI-proposed dependencies (in Polish), especially when new libraries are added.
When accepting a change, compare the claim with evidence of test commands and results (in Polish), not just an assurance that everything is done.
Assign responsibility for retesting after a change of editor, extension, mode or toolset. Record the tested configuration, date and functions outside scope. If a run shows access broader than agreed, stop allowing real material and choose a narrower way of working until the issue is understood. Preserve the path, function and settings from the failed run so the fix can be checked on the same case, rather than treated as effective merely because a setting was saved.
For a discussion with Aeneia Audit, bring the task, functions in use and a synthetic sample. This lets the conversation address observable behaviour: what was read, by which tool and under what settings. A label saying "excluded" on a file list cannot answer those questions.







