Unless I'm mistaken, it sounds like you're actually interested in meta-cognition and type-2 signal detection theory (the form of SDT that Speldosa has pointed to is type-1 signal detection theory). It's used to study our ability to reflect on our own knowledge, or what we think about what we think.
This wikipedia article might get you started on meta-cognition in general.
A type-2 SDT task might involve asking participants to detect a stimulus, as would be the case in a type-1 SDT task, giving hits and false alarms. However, the difference is that, in a type-2 SDT task, after reporting whether they thought the stimulus was present or absent, participants are then asked a second question. This second question asks them how confident they were that they were right in their decision.
With this additional information, type-2 SDT tasks can then probe the extent to which participants can tell the difference between when they have the correct answer and when they have the incorrect answer, which I believe is what you are interested in.
Here's a sample paper that explores this in detail, albeit related to a different task, but should be enough to get you started:
Higham, P.A. (2007) No Special K! A signal detection framework for the strategic regulation of memory accuracy. Journal of Experimental Psychology: General, 136(1): 1-22.