When a petition filed under Welfare and Institutions Code section 827 provides a reasonable basis to believe exculpatory or impeachment evidence exists in a confidential juvenile file, the juvenile court must conduct an in camera review of the records. A petition was filed charging J.E. with petty theft and two counts of lewd conduct. The juvenile court denied J.E.’s petition under section 827 requesting that the court conduct an in camera inspection of a prosecution witness’s juvenile dependency file for Brady v. Maryland (1963) 373 U.S. 83 exculpatory and impeachment evidence. Instead, the juvenile court ruled the request should be directed to the prosecution under Penal Code section 1054.1. Counsel for J.E. filed a petition for writ of mandate challenging the order. The prosecution agreed that the court had the duty to conduct an in camera investigation. Held: Petition granted. For both policy and practical reasons, in camera review of confidential juvenile files under section 827 is a proper mechanism to resolve a defense Brady disclosure request. Although Brady disclosure obligations are typically placed on the prosecution, the requirements can also be satisfied when a trial court conducts an in camera review of confidential documents. With section 827, the Legislature has imposed an exclusive obligation on the juvenile court to shield access to juvenile records unless it determines disclosure is appropriate. The fact the Legislature has made the juvenile court the doorkeeper to these confidential records supports that the court should conduct a Brady review when good cause is shown in a section 827 petition requesting disclosure. As a practical matter, requiring the juvenile court to conduct this review also streamlines the process, as the prosecution would need to request court permission for disclosure after its Brady review.