Dan Bang's paper isolating decision confidence from its component parts has recently been published in PNAS - congratulations Dan! An open access preprint can be found here, and code/data supporting the study are on our lab GitHub site.
In this paper we devised a novel psychophysical task that allowed us to independently manipulate the certainty about the perceptual input (the direction of a cloud of moving dots) and the difficulty of the decision (how close the dots were to a reference line). Both factors influenced confidence. Using fMRI, we found that some brain regions previously implicated in the encoding of decision confidence actually tracked either perceptual certainty (such as the parietal cortex) or decision difficulty (such as pre-SMA), whereas confidence was uniquely tracked in medial PFC (see image below). This may explain why prefrontal damage is regularly associated with dysfunction in metacognition (higher-level estimates of task performance), without affecting "lower level" encoding of beliefs.