Chris Brown better not pull any stunts when he leaves lockdown rehab this weekend to attend a charity event ... because TMZ has learned, if he so much as steps out of line ... the rehab facility will kick him out for good.
TMZ broke the story ... CB obtained permission to attend the 3-hour celebrity toy drive on Melrose Avenue Sunday because the rehab facility -- where he's getting help for anger management -- thought the experience would be good for his treatment.
But sources tell us, the Malibu rehab facility is keeping the singer on an extremely tight leash during the excursion.
We're told Chris only has permission to attend the event from 1pm to 4pm ... as soon as it's over, he has to hightail it back to rehab. The facility is giving him just enough extra time to travel to and from West Hollywood, but that's it. ZERO free time to hang with friends before or after the event.
If he's late to rehab Sunday evening, Chris is out ... which would be real bad ... because rehab's the main reason he's not in jail right now. You'll recall, the judge in his Rihanna beating case revoked his probation, but decided not to toss him in the pokey because he was making good progress in treatment.
We're told the rehab facility will also be drug testing Chris when he gets back ... so he better not think about blazing either.