Nesting depth is the length of the longest membership chain above or below a group. Chains beyond three or four levels are where inheritance surprises live: nobody holds a five-level chain in their head, so nobody predicts what a change at level one does at level five.
Step 1: measure what you have#
Depth is another graph computation over membership edges: for each group, the longest path to a leaf through nested group members. Manually this means walking group members recursively, counting levels, and keeping the maximum per root. On a large tenant, budget for Graph throttling and long runtimes.
Step 2: pick a threshold your organization can defend#
There is no universal correct maximum. What matters is that the number is chosen deliberately, written into your governance policy, and enforced continuously. Teams commonly land between three and five levels: deep enough for real structure, shallow enough that a human can still reason about a chain.
Step 3: make it a trend, not a cleanup#
A one-off depth cleanup decays immediately, because the habits that created deep chains continue. The durable version is a policy check that runs continuously and ranks violations, so new deep chains surface the week they appear instead of at the next audit.
VisualizerEngine
How VisualizerEngine does it
Depth analysis is built into nesting intelligence: set the maximum depth your organization tolerates and see every violation, ranked. The policy engine encodes the threshold as a governance rule, computes a live compliance percentage, and plots drift over time, so depth stays a trend you watch instead of an annual archaeology dig.