Building and customizing solutions using Microsoft 365 Copilot APIs and tools
A SharePoint folder does not consume only one slot: the 100-file limit applies to the files within the selected folder or site, including files reached through its subfolders.
How counting and subfolders work
- Each SharePoint file counts toward the 100-file maximum per agent. The folder is a way to define the knowledge scope, not a single-file slot. Microsoft documents both “SharePoint files, folders, or sites — 100 files” and, more specifically, “Select up to 100 SharePoint files for each agent.” ^1^
- Subfolders are included automatically when the folder is added by URL. Agent Builder searches the supplied URL and its subpaths. Therefore, files in nested folders fall within that source’s scope and its file limit. ^1^
- Selecting a SharePoint site does not include its SharePoint lists. A list must be selected separately and has its own limit of one list per agent. ^1^
For example, if a selected folder contains 30 files directly and its subfolders contain another 70, that scope reaches 100 files. Adding another file would exceed the documented SharePoint-file limit.
Excluding subfolders
Microsoft 365 Copilot Agent Builder does not document a basic “exclude this subfolder” control. To keep a subfolder out of scope, use an inclusion-based configuration:
- Open the agent and go to Configure → Knowledge.
- Remove the broad parent-folder or site source.
- Select Browse → Attach cloud files.
- Add only the individual files or narrower folders that the agent should use.
- On Preview, test a question whose answer exists in an included location and another whose answer exists only in the omitted subfolder.
Referencing only relevant files rather than a broad folder is also Microsoft’s recommended retrieval practice. ^2^
If the agent is managed in Copilot Studio
Copilot Studio has a separate filtering capability under a SharePoint or OneDrive source’s Advanced settings → Filter this knowledge source. Availability is conditional:
- Filter controls are read-only by default.
- They become editable only when the SharePoint additional search terms persistence feature is enabled for the environment.
- Available properties include file name, title, author, dates, file type, and file size; folder path is not listed as a filter property. ^3^
Consequently, Copilot Studio filtering should not be assumed to provide subfolder exclusion in Microsoft 365 Copilot Agent Builder. Selecting only the required files or narrower folders is the documented, dependable way to exclude an unwanted branch.
References