Less than two weeks after Angelina Jolie filed for divorce from Brad Pitt and asked for sole custody of their six children, the two have reached a temporary agreement which requires therapy and drug testing.

According to TMZ, sources have confirmed that the famous parents agreed to the terms laid out by the Los Angeles County Department of Children and Family Services.

Under the terms, Jolie will have physical custody of the children and Pitt will get visitation. Those visits will be supervised unless a therapist decides that he can have unsupervised visits with the children at some point. The actor will also have to undergo random drug and alcohol testing and the entire family will see a family counselor together.

These terms go into effect immediately and will be in place for at least the next three weeks.

An insider told Us Weekly that Jolie is satisfied with the deal.

“She did get what she wanted out of this. Now she wants to do what’s best for the kids. Yes, she is still upset but focused on family right now and got most of what she asked for.”