Agents usually take authorization from group membership in the token. That is convenient and fragile. Directory attributes map into SAML attributes or OIDC claims, and the channel has practical limits: HTTP headers, URL length on redirect bindings, and the IdP's release rules.
When a user belongs to many groups, one of three things happens. The claim truncates at a fixed count, the claim moves to a separate endpoint the application must call, or the IdP refuses to release it. None produce a clean error at the agent. A truncated list leaves the agent under-permissioned, which looks like an agent bug. If the IdP fails open on over-limit claims, the agent gets broader scope than intended. Both directions log as a normal login.
How to run it. Create a test user and add groups incrementally, capturing the token each time.
for n in 50 100 150 200 300 400; do
assign_user_to_groups "$TEST_USER" "$n"
token=$(request_token "$TEST_USER")
groups=$(decode_claim "$token" "groups" | count_items)
echo "assigned=$n claimed=$groups"
done
The step where claimed stops matching assigned is your limit. Test at least one value well above it, such as 200 groups, where enterprise directory sprawl tends to land. Repeat with realistic long distinguished names, since those consume more space than short ones. Run the sweep against both a SAML attribute and an OIDC claim; they often differ. Then confirm what your application does on truncation: deny, call the directory, or grant partial access. That behavior, not the limit, is what agents live with.
Decision rule: if agents depend on group claims for authorization, do not put authorization in the claim. Use the claim to identify the agent or delegating user, then resolve permissions server-side against a directory lookup or policy service. That also gives you a revocation point that does not wait for expiry.
Non-human identity guidance agrees: record each agent's credential type, owner, purpose, connected systems, permission scope, and deprovisioning criteria, and reduce blast radius with least privilege and short-lived access (Sweet Security).
A JWT decoder and assertion viewer cover inspection. Most IdPs expose group claim configuration and an overage behavior setting under a name specific to that product. A policy engine that resolves per request rather than trusting the token is the durable fix.