Is there a name for the trope where a character betrays himself/herself when they say or do something they shouldn't know? For example, somewhere in the series Homeland, Carrie offers Nicholas some tea from his favorite tea brand. This gives away to Nicholas that she has been spying on him.
Some interesting options are given in the comments; however, none of them exactly cover it. The desired term would cover the example I gave and the terms "I never told you my name" and "I never said it was poison," as well as other similar terms/examples.
The terms "saying too much" and "loose lips" are too broad because they do not necessarily entail giving yourself away involuntarily with a detail you shouldn't not know. A drunk babbling away would also be covered by these terms.