Skip to main content
Dynamic groups sound elegant in principle. Instead of manually adding users, define rules. Users who match the rules are automatically included.
Simple. Automatic. Clean. That simplicity lasts about three months.

The Evolution of a Rule

Every dynamic group rule follows a predictable lifecycle. What begins as a single condition transforms into something unrecognizable.

Day 1: The Simple Rule

Clean. Everyone in Engineering is automatically added. Users matched: 150 The rule works perfectly.

Month 3: The First Exception

An Engineering Manager sends a request: “Sarah is technically in Engineering, but she’s on loan to Product for 6 months. She shouldn’t have Engineering-level access right now.”
One hardcoded exception. Not ideal, but manageable. Users matched: 149

Month 6: Location Matters

Security raises a concern: “Our India engineering team shouldn’t have access to the US customer data environment. Can you exclude them from certain groups?”
Users matched: 98 The rule now includes location logic. The group name no longer matches what it does.

Month 9: Contractors Are Different

Legal intervenes: “Contractors shouldn’t have access to production systems. Can you update the Engineering group to exclude them?”
Users matched: 72 Half the original members have been excluded by accumulating conditions.

Month 12: The Reorganization

The company reorganizes. “Engineering” splits into “Product Engineering” and “Platform Engineering.” HRIS (Human Resource Information System) updates slowly. Some employees are still labeled “Engineering,” some are “Product Engineering,” some are “Eng” (data entry error).
Users matched: 68 The rule now includes data quality workarounds.

Month 18: Seniority Requirements

Security adds another requirement: “Junior engineers (L1-L2) shouldn’t be in the production access group. Can you add a seniority check?”
Users matched: 34 Eight conditions with hardcoded exceptions.

Year 3: The Unmaintainable Rule

After 3 years of accumulated requirements:
Users matched: 23 Can anyone determine what this rule does without studying it for 10 minutes? Can anyone predict whether Sarah Chen (new Senior Engineer, Platform team, Bay Area) should be included without running a test? Can anyone explain why John (Staff Engineer, Core Engineering, 2 years tenure) is NOT included without debugging every condition? This is the hidden complexity of group membership rules.

Five Forces That Create Complexity

Edge Cases Accumulate

Every organization has exceptions: employees on loan to other teams, contractors who need employee-level access, employees who had security incidents, teams structured differently from the norm. Each exception adds a condition. Conditions accumulate. Rules grow. After 3 years, a typical rule carries 8-12 conditions.

Organizational Changes Break Rules

When companies reorganize, department names change, team structures change, reporting relationships change, job titles change. Rules that worked yesterday break today. Two options exist: update the rule (adding complexity) or create a new rule (more rules to maintain). Most teams do both, creating a patchwork of overlapping rules.

Attribute Inconsistency

HRIS data is rarely clean. “Senior Software Engineer” appears alongside “Sr. Software Engineer,” “Software Engineer III,” and “SWE Senior.” “Engineering” coexists with “Eng” and “Product Engineering.” “San Francisco” shares a database with “SF,” “Bay Area,” and “US-West.” Rules must handle all variations:
This is no longer a rule. It is a data quality workaround.

Dependencies Between Rules

Rules depend on other rules. “Production Access” requires “Engineering Base Access.” “Engineering Base Access” requires “All Employees.” “All Employees” has its own conditions.
Changing Rule A can affect 50 downstream rules.

Rule Explosion for Combinations

Access requirements often span multiple dimensions: 5 departments by 3 seniority levels by 4 locations equals 60 combinations. The options are all problematic: 60 separate rules (unmanageable), complex conditional logic (unreadable), or nested rules with inheritance (hard to debug). No good answer exists.

Real-World Rule Complexity

Production Database Access

Nine conditions. No one can evaluate this in their head.
Complex access rules create audit challenges. Auditors must understand the rule logic to verify that access grants are appropriate. When rules contain 9+ conditions with nested OR clauses, demonstrating that access follows policy becomes difficult. Simpler, declarative policies produce cleaner audit evidence.

Customer PII Access

Ten-plus conditions including time-based logic.

Finance System Access

Complex conditional logic with audit requirements layered on top.
SOX compliance requires demonstrable separation of duties and time-bound access approvals. Rules that embed approval requirements with max_age constraints satisfy control objectives, but the rule complexity makes it difficult to prove that all access grants actually meet these criteria. Policy-based systems that enforce these constraints automatically generate cleaner audit trails.

Five Problems with Complex Rules

No Way to Test Rules Before Production

When IT teams update a rule, no mechanism exists to verify correctness. Which users will be added? Removed? Will something break? Most systems lack rule testing. Teams deploy and hope. Impact: Rule changes cause incidents when users lose access unexpectedly.

No Diff View for Changes

What changed between version 1 and version 2 of a rule? Without diffing, teams cannot review changes, cannot understand why rules were modified, and cannot roll back to a known-good state. Impact: Changes occur without proper review.

Rules Conflict with Each Other

Rule A: “All Engineering gets GitHub access” Rule B: “Contractors don’t get GitHub access” Rule C: “Platform team gets GitHub admin” What happens to a contractor on the Platform team? Rule priority and evaluation order become critical. Which rule wins? Is it additive or override? Who knows? Impact: Access decisions become unpredictable.

Attribute Changes Do Not Trigger Immediately

Most systems evaluate rules periodically. Okta group rules: 1-24 hours. Azure AD dynamic groups: 15-60 minutes. Google Workspace: 24 hours. When someone’s department changes:
  1. HRIS updates (immediate)
  2. IdP (Identity Provider) syncs from HRIS (15-60 minutes)
  3. Group rules re-evaluate (1-24 hours)
  4. Downstream systems sync (additional time)
Total: 2-48 hours for attribute changes to affect access. Impact: Users have incorrect access during transition periods.

No Visibility Into Why

When users ask “Why am I not in the Production Access group?” answering requires finding the rule definition, understanding all conditions, retrieving the user’s attributes, evaluating each condition manually, and finding which condition failed. This takes 20+ minutes per investigation. Impact: IT teams spend hours debugging access issues.

Solutions (Ranked by Effectiveness)

Solution 1: Rule Linting and Validation (Low Effort)

Before deploying a rule, validate it:
This catches obvious mistakes before they reach production.

Solution 2: Rule Preview / Dry-Run (Medium Effort)

Before deploying, show the impact:
This enables teams to understand impact before committing.

Solution 3: Attribute-Based Policies Instead of Rules (High Effort, Best Results)

Instead of complex rules, define access at the policy level:
Policies are declarative (what access should exist) rather than imperative (how to calculate it). The system evaluates policies against user attributes and calculates access. Benefits: policies are readable, changes are clear, evaluation is consistent, testing is straightforward.
Declarative policies directly map to compliance frameworks. SOC 2 CC6.1 (logical access controls) and ISO 27001 A.9.2.1 (user access provisioning) require documented access policies. A Ruleset that explicitly states requirements---department, seniority, training, tenure---provides self-documenting control evidence. Complex imperative rules do not.

Solution 4: Continuous Validation and Alerting (Medium Effort)

Rather than evaluating rules once, continuously validate:
This catches when reality diverges from rules.

Solution 5: Rule Dependency Graphing (High Effort)

Visualize how rules depend on each other:
Understanding impact of changes before making them prevents cascading failures.

The Path Forward

Group membership rules do not scale. Rules start simple:
Rules become unmaintainable:
At 200+ groups with complex conditions: rules are unreadable, changes are risky, testing is manual, debugging is slow, and nobody understands the full picture. A better abstraction exists. Instead of “rules that calculate group membership,” think “Rulesets that define access requirements.” Rulesets are declarative, testable, and auditable. Rules are imperative, complex, and fragile. Choose Rulesets.
Learn how to build policy-based access: The Policy-First Approach