paint yourself into a corner

To paint yourself into a corner means to do something that has put you into a very difficult situation and will limit the ways you are able to get out of this situation. Literally, to be put in a corner leaves you vulnerable and open for attack with little to no ways to get out of it. When used figuratively, this phrase refers to the same thing where you have managed to get yourself in a situation with little ways of escaping it.