May one forgive a loan without telling the borrower?
One who forgives a loan is to tell the borrower that the loan is forgiven in order to refrain him from transgressing any sin. Furthermore, some Poskim rule that forgiving a loan is only legally binding if done with the knowledge of the borrower.
 The reason: As a borrower who does not pay back a loan transgresses a prohibition, as brought in Admur 4; Michaber C. M. 97/3. Now, the Gemara in Nazir 23a [brought in Rashi Matos 30:6] states that if a wife made a vow and her husband abolished it without her knowledge and she transgresses the vow, then she needs atonement. From here we learn that when one thinks he is doing a sin in his mind it is considered that he has transgressed even if in truth he did not transgress. This is aside for the fact that there are Poskim that rule a loan is not forgiven unless it is done in front of the borrower.
 See Erech Hashulchan Choshen Mishpat 12/5; Divrei Hageonim 57/1; However see Yabia Omer 3/2-5