XML requests to a Mule application were failing with the following error logged by the XML Threat Protection policy worker:
Child count has been exceeded. Maximum allowed is: 999
Affected endpoints returned a 400 Bad Request response and data did not reach the target application. The issue occurred in the PROD environment only — the same XML payload succeeded in PREPROD — indicating a configuration difference in the XML Threat Protection policy between environments.
Note: The thread name in the log may reference a different policy (for example, client-id-enforcement or spike-control). Always check the class name to confirm the source: com.mulesoft.extension.policies.threat.XMLThreatProtectionOperations indicates the XML Threat Protection policy is responsible.
CAUSE
The XML Threat Protection policy in the PROD environment was configured with a Max Child Count of 999. The inbound XML payloads contained more than 999 child elements, so the policy rejected the requests as designed. The same payload working in PREPROD confirmed a configuration difference between PREPROD and PROD.
1. In Anypoint Platform, open API Manager in the affected environment (for example, PROD) and select the API instance with the XML Threat Protection policy applied. Click Edit on the XML Threat Protection policy and increase Max Child Count from 999 to a value that covers the largest expected XML payload — for example, 5000 or another appropriate higher value. Click Apply. No application restart is required; the change takes effect immediately.
2. If the same payload works in PREPROD, first check the PREPROD XML Threat Protection Max Child Count setting and set the PROD policy to match it. If PREPROD has no XML Threat Protection policy applied, set PROD to -1 to disable the child count check if permitted by security requirements, or set a sufficiently high value with buffer. Click Apply. No application restart is required.
Tip: To determine the correct value, inspect the maximum number of sibling XML elements within a single parent node in your largest expected request payload and add a 20% buffer.
- XML Threat Protection Policy:
https://docs.mulesoft.com/gateway/1.14/policies-included-xml-threat-protection
- Applying Policies in API Manager:
https://docs.mulesoft.com/api-manager/latest/policies-overview
005459326

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.