dig your own grave

Obere Mittelstufe (B2) informal

To create your own downfall.

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