"The Bear" and "Shameless" star Jeremy Allen White is open to proving he's not boozing in order to spend time with his kids ... and if he slips up, he won't be able to see them.
According to new legal docs, obtained by TMZ, Jeremy agreed to alcohol testing as part of a custody agreement with his estranged wife, actress Addison Timlin.
Jeremy will be tested for booze up to five times a week when he has custody of their two daughters ... Ezer and Dolores ... and if he's found to be drinking, he loses custody ASAP.
If Jeremy has a positive test for alcohol, he gets to retest again 15 minutes later to make sure the test is accurate.
The docs say Jeremy and Addison agreed to share joint physical and legal custody ... but Jeremy's custodial time has strings attached, and he's also got to attend at least one Alcoholics Anonymous meeting a week, plus other therapy.
TMZ broke the story ... Addison filed for divorce back in May after 3 years of marriage.
The exes seemed to get along fine in August when they were both at their kids' soccer practice ... but they have yet to finalize their divorce.
Meanwhile, Jeremy seems to have already moved on to a new relationship with model Ashley Moore, they were spotted making out in public.