dig your own grave

중상급 (B2) informal

To create your own downfall.

"By leaking the information, he was essentially digging his own grave."