In Unified Modeling Language (UML) sequence diagrams, a guard condition, also called as an interaction constraint, is a Boolean conditional expression that guards an interaction operand in a combined fragment. A guard condition contains two expressions that designate the minimum and maximum number of times that a loop combined fragment executes.
In sequence diagrams, a guard condition is a semantic condition or restriction that is set in square brackets in an interaction operand in a combined fragment. When you create a combined fragment, a guard condition is created automatically. You can also manually create a guard condition in an interaction operand that does not have an existing guard condition.
A guard condition appears at the start of the interaction and contains all the information that is required to make the decision about whether to execute the traces in the interaction operand. If the guard condition tests true, the traces execute. Because a guard condition is optional, the interaction also executes if no guard condition is specified in the interaction operand.
The following figure illustrates how guard conditions are represented in an interaction.