Pupillometry, the measure of pupil size and reactivity, has been widely used to assess cognitive processes. As such, changes in pupil size have been shown to correlate with arousal, locomotion, cortical state and decision-making processes. In addition, pupillary responses have been linked to the activity of neuromodulatory systems that modulate attention and perception as the noradrenergic and cholinergic systems. Due to the extent of processes reflected by the pupil, we aimed at resolving pupillary responses in context of behavioral state and task performance while recording pupillary transients of mice performing a vibrotactile two-alternative forced choice task (2-AFC). We show that pre-stimulus pupil size differentiates between states disengagement from task performance versus when actively engaged. In addition, when actively engaged, post-stimulus, pupillary dilations for correct responses are larger than for error responses with this difference reflecting response confidence. Importantly, in a delayed 2-AFC task we show that even though pupillary transients mainly reflect motor output following the response of the animal, they also reflect animal decision confidence prior to its response. Finally, in a condition of passive engagement, when stimulus has no task relevance with reward provided automatically, pupillary dilations rather reflect stimulation and reward and are reduced relative to a state of active engagement explained by shifts of attention from irrelevant task occurrences. Our results provide further evidence of how pupillary dilations reflect cognitive processes in a task relevant context, showing that the pupil reflects response confidence and baseline pupil size encodes attentiveness rather than general arousal.