Metacognition refers to the capacity to access, monitor, and control aspects of one’s mental operations and is central to the human condition and experience. Disorders of metacognition are a hallmark of many psychiatric conditions and the training of metacognitive skills is central in education and in many psychotherapies. This paper provides first steps towards the development of a formal neurophenomenology of metacognition. To do so, we leverage the tools of the active inference framework, extending a previous computational model of implicit metacognition by adding a hierarchical level to model explicit (conscious) meta-awareness and the voluntary control of attention through covert action. Using the example of mind-wandering and its regulation in focused attention, we provide a computational proof of principle for an inferential architecture apt to enable the emergence of central components of metacognition: namely, the ability to access, monitor, and control cognitive states.