CA Penal Code § 236.23 (2021)
2021 California Code|Penal Code - PEN|PART 1 - OF CRIMES AND PUNISHMENTS|TITLE 8 - OF CRIMES AGAINST THE PERSON|CHAPTER 8 - False Imprisonment and Human Trafficking|Section 236.23.

236.23.  (a) In addition to any other affirmative defense, it is a defense to a charge of a crime that the person was coerced to commit the offense as a direct result of being a human trafficking victim at the time of the offense and had a reasonable fear of harm. This defense does not apply to a violent felony, as defined in subdivision (c) of Section 667.5.(b) A defendant asserting the affirmative defense specified in subdivision (a) has the burden of establishing the affirmative defense by a preponderance of the evidence.(c) Certified records of a federal, state, tribal, or local court or governmental agency documenting the person’s status as a victim of human trafficking at the time of the offense, including identification of a victim of human trafficking by a peace officer pursuant to Section 236.2 and certified records of approval notices or enforcement certifications generated from federal immigration proceedings, may be presented to establish an affirmative defense pursuant to this section. Information contained in governmental agency reports, which is relevant to the identification of a victim of human trafficking by a peace officer pursuant to Section 236.2, may be presented pursuant to this subdivision even if a peace officer did not make an identification pursuant to Section 236.2.(d) The affirmative defense may be asserted at any time before the entry of a plea of guilty or nolo contendere or admission to the truth of the charges and before the conclusion of any trial for the offense. If asserted before the preliminary hearing held in a case, the affirmative defense shall, upon request by the defendant, be determined at the preliminary hearing.(e) If the defendant prevails on the affirmative defense provided under subdivision (a), the defendant is entitled to all of the following relief:(1) (A) The court shall order that all records in the case be sealed pursuant to Section 851.86.(B) Records that have been sealed pursuant to this paragraph may be accessed, inspected, or utilized by law enforcement for subsequent investigatory purposes involving persons other than the defendant.(2) The person shall be released from all penalties and disabilities resulting from the charge, and all actions and proceedings by law enforcement personnel, courts, or other government employees that led to the charge shall be deemed not to have occurred.(3) (A) The person may in all circumstances state that they have never been arrested for, or charged with, the crime that is the subject of the charge or conviction, including without limitation in response to questions on employment, housing, financial aid, or loan applications.(B) The person may not be denied rights or benefits, including, without limitation, employment, housing, financial aid, welfare, or a loan or other financial accommodation, based on the arrest or charge or their failure or refusal to disclose the existence of or information concerning those events.(C) The person may not be thereafter charged or convicted of perjury or otherwise of giving a false statement by reason of having failed to disclose or acknowledge the existence of the charge, or any arrest, indictment, trial, or other proceedings related thereto.(f) If, in a proceeding pursuant to Section 602 of the Welfare and Institutions Code, the juvenile court finds that the offense on which the proceeding is based was committed as a direct result of the minor being a human trafficking victim, and the affirmative defense established in subdivision (a) is established by a preponderance of the evidence, the court shall dismiss the proceeding and order the relief prescribed in Section 786 of the Welfare and Institutions Code.(Amended by Stats. 2021, Ch. 695, Sec. 2. (AB 124) Effective January 1, 2022.)