When a borrower intends to "give the keys" to the lender, both parties will often benefit by entering into an agreement about the transaction. Here is a sample deed in lieu agreement, with some related forms attached as exhibits.