Studies on rational imitation have provided evidence for the fact that infants as young as 12 months of age engage in rational imitation. However, the developmental onset of this ability is unclear. In this study, we investigated whether 9- and 12-month-olds detect voluntary and implicit as well as nonvoluntary and explicit constraints in the head touch task. Three groups of infants watched video sequences, which displayed a person illuminating a lamp using the head. The hands of the model were either free, occupied by voluntarily holding a blanket, or nonvoluntarily restrained by being tied to the table. An additional control group of infants watched the model turning on the lamp by using the hand. Given that the majority of infants imitated the head touch when the model's hands were free, there was evidence for rational imitation in comparison to the condition in which the model's hands were tied to the table, but not in comparison to the condition in which the hands were occupied by holding a blanket. Nine-month-olds showed no differences in their behavior according to the condition. These findings clarify the onset of rational imitation by showing that 12-month-olds (but not 9-month-olds) take into account a situational constraint only when the constraint is nonvoluntary and explicit.