(Numbers 22:34:) Then Balaam said to the angel of the LORD: "I have sinned, for I did not know." This is to make known that he was completely wicked. He knew that nothing stands before [averts] the punishment except repentance, for anyone who sins and says, "I have sinned," the angel has no permission to touch him.
Why Balaam's Confession Proves He Was Wholly Wicked
Midrash Tanchuma Buber, Balak 14:6
ויאמר בלעם אל מלאך ה' חטאתי כי לא ידעתי (שם שם לד). להודיע כי הוא רשע גמור, ידע כי אינו עומד בפני הפורענות אלא תשובה, שכל מי שיחטא ואומר חטאתי אין רשות למלאך ליגע בו.