Well, if your lender documents everything accordingly and everything is in plain english then it's your call. I would still draft a hold harmless agreement but the fact of the matter is that cash back at closings have been big news lately for fraud.
What I don't understand is that you came on asking about legality, and when it seems that most everyone here is telling you that there are some definite concerns you back track and say that you've got the answers.
I'm not sure what the situation is exactly, and I'm not making any assumptions but I've been doing this for a long time and have not seen a situation where a lender was "ok" with cash back to a buyer at closing.