Any process in which a protein is maintained in the nucleus and prevented from moving elsewhere. These include sequestration within the nucleus, protein stabilization to prevent transport elsewhere and the active retrieval of proteins that escape the nucleus.