The IDSP policy engine (powered by OPA) utilizes short-circuit evaluation at both the rule level and the condition level.
Consolidating all IP restriction rules into a single policy—where each rule uses a context conditional to identify the target company before evaluating IP ranges—is a supported and highly efficient design.
Condition-Level Short-Circuit: If a context or company identifier check fails, the engine immediately skips the remaining conditions within that rule (including the IP range evaluation) and proceeds to the next rule.
Rule-Level Short-Circuit: Once a rule criteria is met or failed, the engine deterministically moves through the hierarchy based on defined priorities.
| Scenario | Short-Circuit? | Technical Behavior |
| Company identifier check fails | Yes | OPA short-circuits immediately when a condition fails within a rule body, skipping subsequent IP ranges on that rule. |
| Rule does not match | Yes | The engine skips to the next rule, guaranteed via rulePriority first-match semantics. |
| Policy does not match | Yes | The engine skips to the next policy, guaranteed via POLICY_PRIORITY ordering. |
Always assign sequential values (e.g., 1, 2, 3...) to ensure a deterministic rule processing order. Do not rely on implicit ordering.