Building and customizing solutions using Microsoft 365 Copilot APIs and tools
No public Copilot Studio setting or documented request process increases the 20,000,000-character BotDefinitionOverride YAML ceiling, so the immediate supported path is to reduce the serialized agent definition below that value and ask Microsoft Support to confirm whether the internal limit is adjustable for your environment.
Microsoft’s published quotas page documents adjustable message-rate quotas, but it does not list BotDefinitionOverride or an adjustment mechanism for this definition-size validation ^1^. Do not treat purchasing capacity or requesting a throughput increase as a way to raise this ceiling.
What appears to contribute to the count
Microsoft does not publicly document the serialization formula behind this error, so it is not possible to state conclusively which components are counted or whether content is duplicated during serialization.
For standard-harness agents, the supported VS Code extension exposes the agent definition as component files, including:
- Main agent configuration and settings
- Topics and triggers
- Tools, actions, and workflows
- Knowledge-source definitions and knowledge files
- Azure Bot Service skills
These are all managed as parts of the agent definition ^2^. The documented workspace also places uploaded knowledge under knowledge/files, while tools, topics, workflows, triggers, and configuration have separate files ^3^.
Your test establishes that the 1.07-million-character reference file affects the generated payload. It does not establish that the internal count equals that file’s raw character count.
Identify the largest contributors
This diagnostic applies only if the affected agent uses the standard harness, because the VS Code extension documentation is scoped to that harness.
- Install the Copilot Studio VS Code extension and clone the agent. Cloning downloads the definition and related component definitions into a structured workspace ^4^.
- In VS Code, inspect
agent.mcs.yaml,knowledge,actions,topics,workflows, andtrigger. - Remote uploaded knowledge files are not downloaded automatically. Download them explicitly from the extension’s Remote Knowledge Files window before inspecting their actual sizes ^3^.
- Compare snapshots before and after adding one large component at a time.
- Treat local file size only as a diagnostic proxy. It is not a documented calculation of the internal
BotDefinitionOverridecount.
If the agent uses another harness, do not assume this file model or tooling applies. Open a Microsoft support case with the environment, agent ID, exact error, harness type, timestamp, and the smallest reproducible agent package.
Externalize large reference libraries
SharePoint is a supported external knowledge source and is the first mitigation worth testing, but Microsoft does not document that moving a file there always removes its content from BotDefinitionOverride.
For a SharePoint site:
- Open the agent.
- Select Overview or Knowledge → Add knowledge → SharePoint.
- Enter the site or folder URL, add a precise name and description, and select Add to agent.
- Test retrieval in Preview before adding the remaining libraries.
SharePoint queries run with the chatting user’s permissions; the user needs at least Read access. Restricted SharePoint Search blocks this integration, and hyperlinks inside registered documents are not crawled automatically ^5^. An administrator can also disable SharePoint and OneDrive knowledge sources through the Power Platform admin center policy ^6^.
Observe these file-processing conditions:
- With a Microsoft 365 Copilot license in the same tenant and tenant graph grounding enabled, SharePoint generative answers support files up to 200 MB.
- Without that licensing condition, SharePoint generative answers process files only up to 7 MB under the documented configuration.
- Larger files may appear in Graph search without being processed for generative answers ^7^.
After moving the reference file, compare the resulting definition and Preview behavior. This verifies whether externalization reduces this particular serialized payload.
Architecture for multiple large domains
For a standard-harness solution, partition by business domain rather than attaching every library and tool to one agent:
- Keep the parent focused on routing and shared instructions.
- Give each child or connected agent distinct, nonoverlapping knowledge.
- Use child agents when one team owns the complete solution.
- Use connected agents when domains need independent ownership, settings, publishing, security, or ALM.
Child agents have their own orchestration and tool limits, although they add orchestration latency ^8^. Connected agents provide separate orchestration, tools, and knowledge; Microsoft recommends them for complex domains or different governance requirements ^9^.
This is a supported modular design, not a documented guarantee that the parent’s BotDefinitionOverride will fall below 20 million. Validate the serialized result after each partition. If it remains over the limit, Microsoft Support must investigate which internal component is expanding the payload and confirm whether any exception exists.
References
- Quotas and limits
- Overview of Microsoft Copilot Studio extension for Microsoft Visual Studio Code
- Edit your Microsoft Copilot Studio agent in Microsoft Visual Studio Code - Microsoft Copilot Studio | Microsoft Learn
- Clone your Microsoft Copilot Studio agent in Microsoft Visual Studio Code
- Add SharePoint as a knowledge source
- Choose knowledge sources for agents built in Copilot Studio
- SharePoint knowledge sources don't return results in Copilot Studio
- Add a child agent
- Multi-agent orchestration patterns and best practices