Human and many animals can asses the confidence of their decisions. However, little has been known about the underlying neural substrate and mechanism. Here we proposed a computational model consisting of one group of ’confidence neurons’ with adaptation, which is able to asses the confidence of decision by detecting the slope of ramping activities of decision neurons. The simulated activities of ’confidence neurons’ in our simple model capture the typical features of confidence in human and animals experiments. Our results indicate that confidence could be online formed along with the decision formation and the adaptation properties could be used to monitor the decision confidence in artificial intelligence.