
107 Cal.App.3d 218 (1980)
165 Cal. Rptr. 701
WILLIAM JOSEPH FOSTER, Petitioner,
v.
THE SUPERIOR COURT OF SANTA CLARA COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. 48223.
Court of Appeals of California, First District, Division One.
June 23, 1980.
*221 COUNSEL
Craig M. Brown and Singleton & Brown for Petitioner.
*222 No appearance for Respondent.
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, Edward P. O'Brien, Assistant Attorney General, William D. Stein and Eugene W. Kaster, Deputy Attorneys General, for Real Party in Interest.
OPINION
GRODIN, J.
Petitioner Foster confronts trial on a charge of indecent exposure (Pen. Code, § 314, subd. 1). The essence of the charge is that while in the employ of Santa Clara County and performing maintenance work in the vicinity of that court's juvenile hall, he exposed himself to minors who were housed in the hall at the time. Two minors, Tanya and Arlene, are the alleged victims and sole complaining witnesses against defendant. At the preliminary hearing defense counsel sought to cross-examine Tanya regarding the length of and the reason for her detention in the hall, but the trial court sustained the People's objection on relevancy grounds absent an offer of proof. Petitioner subsequently moved in superior court to dismiss the information (Pen. Code, § 995) because of the magistrate's denial of opportunity to cross-examine Tanya, for appointment of a psychiatrist to examine the complaining witnesses (Ballard v. Superior Court (1966) 64 Cal.2d 159 [49 Cal. Rptr. 302, 410 P.2d 838, 18 A.L.R.3d 1416]), and for discovery of their juvenile court and juvenile department records. All three motions were denied. Subsequently petitioner requested the superior court sitting as a juvenile court pursuant to Welfare and Institutions Code section 827 to examine the files and records pertaining to the three complaining witnesses, and that request, after hearing, was also denied. Petitioner then filed this petition for writs of mandate or prohibition, seeking to compel the superior court to dismiss the charges against him or, in the alternative, to grant him opportunity for cross-examination, psychiatric examination, or discovery. We granted the alternative writ, staying trial pending hearing and determination.

I. The Ballard Motion

In Ballard v. Superior Court, supra, 64 Cal.2d 159, the Supreme Court held that a trial court has discretion to order the complaining *223 witness in a case involving sex violations to submit to a psychiatric examination "if the circumstances indicate a necessity for an examination. Such necessity would generally arise only if little or no corroboration supported the charge and if the defense raised the issue of the effect of the complaining witness' mental or emotional condition upon her veracity." (Id., at pp. 176-177.) As explained in People v. Russel (1968) 69 Cal.2d 187 [70 Cal. Rptr. 210, 443 P.2d 794], the question before the trial court is "whether, in light of the totality of circumstances revealed, it is necessary or proper that psychiatric knowledge in general be utilized in order to aid the trier of fact in its assessment of credibility. This decision must rest for the most part on the court's judgment as to whether an emotional or mental condition is involved which a body of laymen either would be unable to detect or would be unable to relate in terms of effect to the matter of credibility." (Id., at p. 195.) Other relevant factors include considerations of time, expense, and the convenience of witnesses, as well as the court's own assessment of the accuracy of techniques and methods proposed to be utilized in the examination. (Id., at p. 196, fn. 9.)
(1) In support of his contention that the trial court abused its discretion in denying his Ballard motion, petitioner contends that the fact that the two girls reside at juvenile hall itself suggests the presence of psychological instability, and that this suggestion is enforced by other facts: the opinion of a juvenile hall counselor (expressed in a declaration) that she suspected the two girls were playing a game or "setting up" the counselor to whom they reported the incident; and the fact that there was some inconsistency in the girls' testimony, one of them admitting and the other denying that they had "flashed" the defendant at his request. Petitioner points to a statement in People v. Lang (1974) 11 Cal.3d 134, 140, footnote 3 [113 Cal. Rptr. 9, 520 P.2d 393], to the effect that a psychiatric examination "would seem a minimum protection for a defendant charged with molesting a child, and only the rarest of cases would excuse counsel from obtaining one."
We find petitioner's arguments on this point unpersuasive. The suggestion that all juveniles housed in juvenile hall need psychological evaluation before their testimony may be admitted is clearly overbroad. The two prosecuting witnesses in Lang were nine-year-old twins. Using almost identical words, each told of unsuccessfully resisting separate but identical assaults by the defendant in the presence of from 6 to 12 persons, none of whom saw either assault. The prosecution offered no *224 corroborating testimony, neither twin witnessed or even mentioned the other's molestation, and no medical testimony was introduced to establish the possibility of such assault. (11 Cal.3d at p. 139.) The court, considering a claim of incompetency of counsel, opined that "a strong argument could have been made that the twins' testimony was inherently improbable and insubstantial" (ibid.), and it was in this context that the court referred to the alleged failure of the defendant's trial counsel to obtain psychiatric examinations of the twins as evidence of incompetency. (Id., at p. 140.) Here, by contrast, the 2 prosecuting witnesses are considerably older (16 and 19), both claim to have observed the same events, and the testimony of each is substantially corroborative of the other. The refusal of one girl to admit she "flashed" in response to the defendant's invitation may well have been attributable to embarrassment on her part, and the testimony of one counselor who suspected the girls of lying was offset by the testimony of another counselor who believed them. We find no abuse of discretion on the part of the trial court based upon this evidence in denying petitioner's Ballard motion.

II. The Section 995 Motion

(2a) Petitioner's section 995 motion is based on the following exchange which occurred at the preliminary hearing when petitioner's counsel began to examine Tanya: "[By Mr. Brown, counsel for petitioner] Q. Tanya, how long had you been in Juvenile Hall at the time this happened? MR. BALDWIN [deputy district attorney]: Objection, irrelevant. THE COURT: Mr. Brown, any relevance? MR. BROWN: Pardon me? THE COURT: Do you have anything to say to the matter of relevance? MR. BROWN: No, Your Honor. THE COURT: Sustained. Q. (By Mr. Brown): What were you there for? MR. BALDWIN: Objection, irrelevant. THE COURT: Any offer of proof on that? I would sustain it, otherwise. MR. BROWN: Well, I believe that with respect to the credibility of the witness, it's not an inappropriate question. MR. BALDWIN: Well, Your Honor, I would  THE COURT: I'll sustain the objection, ask that offer of proof that it would be relevant."
(3) Where it appears that during the course of a preliminary hearing examination the defendant has been denied a substantial right, the commitment is unlawful within the meaning of Penal Code section 995, and must be set aside upon timely motion. (People v. Elliot (1960) 54 Cal.2d 498, 502-503 [6 Cal. Rptr. 753, 354 P.2d 225].) Improper limitations upon the defendant's opportunity to cross-examine adverse *225 witnesses at a preliminary hearing may constitute denial of a substantial right under that rule. (Jennings v. Superior Court (1967) 66 Cal.2d 867 [59 Cal. Rptr. 440, 428 P.2d 304].) While Jennings involved cross-examination for the purpose of establishing an affirmative defense (id., at pp. 877-880), the principle extends to cross-examination for the purpose of impeachment as well. (Alford v. Superior Court (1972) 29 Cal. App.3d 724, 728 [105 Cal. Rptr. 713].) It is not a valid objection that the examination may lead to discovery (McDaniel v. Superior Court (1976) 55 Cal. App.3d 803, 805 [126 Cal. Rptr. 136]), or that the cross-examiner is unable to predict what testimony will develop. (Alford v. Superior Court, supra, at p. 728.) And, according to the United States Supreme Court's decision in Davis v. Alaska (1974) 415 U.S. 308 [39 L.Ed.2d 347, 94 S.Ct. 1105], a defendant's constitutional right of confrontation is paramount to a state's policy of protecting a juvenile offender against disclosure of his juvenile record, where the offender is a prosecution witness and the defendant seeks to show possible bias deriving from the witness' probationary status as a juvenile delinquent (id., at p. 320 [39 L.Ed.2d at p. 355]; see also Alford v. United States (1931) 282 U.S. 687, 691-692 [75 L.Ed. 624, 627-628, 51 S.Ct. 218]; People v. Allen (1978) 77 Cal. App.3d 924 [144 Cal. Rptr. 6]).
While Davis v. Alaska may not confer "a right in every case to impeach the general credibility of a witness through cross-examination about his past delinquency adjudications or criminal convictions" (415 U.S. at p. 321 [39 L.Ed.2d at p. 356], Justice Stewart, conc.), it does protect a defendant's interest in making "[a] more particular attack on the witness' credibility... by means of cross-examination directed toward revealing possible biases, prejudices, or ulterior motives of the witness as they may relate directly to issues or personalities in the case at hand." (Id., at p. 316 [39 L.Ed.2d at p. 354].)
(2b) On the basis of these authorities, petitioner had a right to probe for possible bias on the part of Tanya. Under all the circumstances, however, the magistrate's refusal to allow the particular questions posed by counsel at the preliminary hearing did not require that the trial court grant petitioner's motion for dismissal under section 995. This is so for two reasons.
First, it is by no means clear that the magistrate's ruling constituted error. In Davis v. Alaska, upon which petitioner places principal reliance, defendant was precluded from bringing to the jury's attention the *226 fact that a juvenile witness for the prosecution was on probation; and this fact, the court reasoned, might be viewed by the jury as giving rise to an "inference of undue pressure because of [the witness'] vulnerable status as a probationer" (415 U.S. at p. 318 [39 L.Ed.2d at p. 354]). Here, Tanya's status as a detainee in juvenile hall was part of the prosecution case. In what manner the length of her stay or the reasons for her being there might affect her credibility or lead to evidence affecting her credibility were not at all apparent. We do not mean to suggest that they might not prove relevant, in light of other evidence, and petitioner's counsel was in no position to make an "offer of proof" in the technical sense (see Evid. Code, § 354) but under the circumstances some explanation of petitioner's theory of relevance, on the issue of credibility, would have been appropriate (People v. Burton (1961) 55 Cal.2d 328, 344-345 [11 Cal. Rptr. 65, 359 P.2d 433]; People v. Coleman (1970) 8 Cal. App.3d 722, 730-731 [87 Cal. Rptr. 554]).
In any event, if there was error it was not prejudicial to the validity of the magistrate's holding order. Petitioner did not otherwise pursue an attack on Tanya's credibility based upon her status as an offender, and he made no attempt to question Arlene along similar lines. Arlene, as previously mentioned, confirmed Tanya's version of the events in most significant respects, and her testimony certainly provided adequate basis for the holding order. Under the circumstances, petitioner was not denied "substantial rights" as that term is used in Jennings v. Superior Court, supra, 66 Cal.2d at pages 879-880.

III. The Discovery Motion

(4a) Petitioner's discovery motion, seeking to obtain "all investigation reports, Juvenile Probation reports, and records of Juvenile Court or Juvenile Probation Department proceedings relating to each of the two minor victims," was initially brought in the superior court along with his motions for dismissal and appointment of a psychiatrist. Prior to hearing on those motions, petitioner made a request to the superior court as a juvenile court, pursuant to Welfare and Institutions Code section 827, to examine essentially the same records, all of which (petitioner alleged) "would more fully describe the reasons for their being housed in the Juvenile Hall facility and would fully describe the history of each of them in terms of antisocial conduct which has brought them under the jurisdiction of the juvenile authorities." Petitioner asserted he needed the records "in order to make the requisite showing to the Superior *227 Court to justify the appointment of a psychiatrist, in order to determine whether or not any of the minors might be prone to fabrication or fantasy, in order to impeach their credibility as accusing witnesses at the time of trial, in order to explore potential reasons for bias, and in order generally to provide defendant FOSTER with a meaningful opportunity to confront and cross-examine these accusers in the same fashion as he might be able to deal with adult accusers...." The juvenile court, after independently reviewing the requested files in camera, denied petitioner's request; and the superior court in the criminal proceeding denied petitioner's discovery motion as well. The record does not reflect the reasons for the court's action in either proceeding.
(5) Criminal discovery is based on the "fundamental proposition that [an accused] is entitled to a fair trial and an intelligent defense in light of all relevant and reasonably accessible information." (Pitchess v. Superior Court (1974) 11 Cal.3d 531, 535 [113 Cal. Rptr. 897, 522 P.2d 305].) A showing "`that the defendant cannot readily obtain the information through his own efforts will ordinarily entitle him to pretrial knowledge of any unprivileged evidence, or information that might lead to the discovery of evidence, if it appears reasonable that such knowledge will assist him in preparing his defense. ...'" (Ballard v. Superior Court, supra, 64 Cal.2d at p. 167.) (6) And discovery for the purpose of obtaining information for possible use to impeach or cross-examine an adverse witness is generally appropriate, since "`[a]bsent some governmental requirement that information be kept confidential for the purposes of effective law enforcement, the state has no interest in denying the accused access to all evidence that can throw light on the issues in the case, and in particular it has no interest in convicting on the testimony of witnesses who have not been as rigorously cross-examined and as thoroughly impeached as the evidence permits.'" (Hill v. Superior Court (1974) 10 Cal.3d 812, 816 [112 Cal. Rptr. 257, 518 P.2d 1353, 95 A.L.R.3d 820].) The same policy applies to information not in the prosecution's possession but available at his request from other agencies which are part of the criminal justice system. (Engstrom v. Superior Court (1971) 20 Cal. App.3d 240, 243 [97 Cal. Rptr. 484].) Thus, subject to the reasonable exercise of discretion by the trial court, a criminal defendant may have access to the "rap sheet" containing felony convictions of a prosecution witness. (Hill v. Superior Court, supra.) And, since the evidence sought to be discovered need not be admissible at trial, it has been held that a defendant may be entitled to discovery of a juvenile codefendant's "rap sheet" as *228 well. (In re Ricky B. (1978) 82 Cal. App.3d 106, 114 [146 Cal. Rptr. 828].)
(4b) On the other hand, there exists in this state a strong public policy protective of the confidentiality of juvenile court records and proceedings. As the Supreme Court observed in T.N.G. v. Superior Court (1971) 4 Cal.3d 767 [94 Cal. Rptr. 813, 484 P.2d 981], "several sections [of the Juvenile Court Law] explicitly reflect a legislative judgment that rehabilitation through the process of the juvenile court is best served by the preservation of a confidential atmosphere in all of its activities. Section 827 carefully prohibits the inspection of any `petition filed in any juvenile court proceeding, reports of the probation officer, and all other documents filed in any such case' by anyone other than court personnel, the juvenile, his parents, and his attorney, except with the express approval of the juvenile court judge.[[1]] Section 676 provides that juvenile court proceedings are not open to the public. And section 781 insures that a juvenile may obtain an order, five years after his detention or when he becomes 21, which seals his juvenile court record even from inspection by juvenile court personnel and which requires the destruction of all records pertaining to the case in the custody of `any other agencies, including law enforcement agencies, and public officials ... [which] have custody of such records.' [¶] These factors justify the conclusion that the Juvenile Court Law and particularly Welfare and Institutions Code sections 625, 676, 781, and 827 establish the confidentiality of juvenile proceedings and vest the juvenile court with exclusive authority to determine the extent to which juvenile records may be released to third parties." (4 Cal.3d at pp. 776-778.) The opinion states further that "[i]n determining what information should be released, the juvenile court is in a position to determine whether disclosure would be in the best interests of the youth." (Id., at p. 781.)
The Supreme Court in T.N.G. was concerned with the release of juvenile arrest and detention records or information to prospective employers or educational institutions, and consequently did not have occasion *229 to consider whether or under what circumstances the principle of confidentiality established by the Juvenile Court Law might have to give way to the constitutional rights of an accused. That issue was confronted and resolved, however, by the United States Supreme Court in Davis v. Alaska, supra: "The claim is made that the State has an important interest in protecting the anonymity of juvenile offenders and that this interest outweighs any competing interest this petitioner might have in cross-examining Green about his being on probation.... [¶] We do not and need not challenge the State's interest as a matter of its own policy in the administration of criminal justice to seek to preserve the anonymity of a juvenile offender. [Citation.] ... Whatever temporary embarrassment might result to Green or his family by disclosure of his juvenile record  if the prosecution insisted on using him to make its case  is outweighed by petitioner's right to probe into the influence of possible bias in the testimony of a crucial identification witness.... [¶] The State's policy interest in protecting the confidentiality of a juvenile offender's record cannot require yielding of so vital a constitutional right as the effective cross-examination for bias of an adverse witness. The State could have protected Green from exposure of his juvenile adjudication in these circumstances by refraining from using him to make out its case; the State cannot, consistent with the right of confrontation, require the petitioner to bear the full burden of vindicating the State's interest in the secrecy of juvenile criminal records." (415 U.S. at pp. 319-320 [39 L.Ed.2d at pp. 355-356].)
(7) It follows that the principle of confidentiality, where it conflicts with a defendant's constitutional rights of confrontation and cross-examination, must give way. But it does not follow that the trial court erred in refusing to grant petitioner's discovery motion. The discretion which a trial court has under Ballard to order a psychiatric examination of a complaining witness in a case involving sex violations does not rise to a constitutional level. Consequently, petitioner's interest in obtaining information in aid of his Ballard motion does not in itself require that the protective screen be pierced. (4c) It is petitioner's interest in obtaining information in aid of effective cross-examination that furnishes the appropriate standard by which limitations on the principle of confidentiality are to be measured. By that standard, the trial court was justified in denying petitioner's overbroad request. An accused is "not entitled to inspect material as a matter of right without regard to the adverse effects of disclosure and without a prior showing of good cause" (Hill v. Superior Court, supra, 10 Cal.3d 817), and "the *230 court retains wide discretion to protect against the disclosure of information which might unduly hamper the prosecution or violate some other legitimate governmental interest ... [and] to deny discovery in the absence of a showing which specifies the material sought and furnishes a `plausible justification' for inspection." (Joe Z. v. Superior Court (1970) 3 Cal.3d 797, 804 [91 Cal. Rptr. 594, 478 P.2d 26].) Here, as in People v. Gaulden (1974) 36 Cal. App.3d 942, 961 [111 Cal. Rptr. 803], "there is a legitimate public interest in protecting against wholesale disclosure of the matters here asked for."
The relief now sought by petitioner will, therefore, be denied without prejudice to the right of petitioner to seek limited discovery on a more specific showing in accordance with the views expressed in this opinion.[2]
Racanelli, P.J., and Newsom, J., concurred.
NOTES
[1]  Welfare and Institutions Code section 827 provides as follows: "Except as provided in Section 828, a petition filed in any juvenile court proceeding, reports of the probation officer, and all other documents filed in any such case or made available to the probation officer in making his report, or to the judge, referee or other hearing officer, and thereafter retained by the probation officer, judge, referee, or other hearing officer, may be inspected only by court personnel, the minor who is the subject of the proceeding, his parents or guardian, the attorneys for such parties, and such other persons as may be designated by court order of the judge of the juvenile court upon filing a petition therefor."
[2]  We offer the following observations for the guidance of the trial court in the event that petitioner renews his pretrial discovery motion. Petitioner appears entitled without further showing to discovery of the prosecuting witnesses' "rap sheets" (In re Ricky B., supra, 82 Cal. App.3d 106, 113-114). Upon a showing which "specifies the material sought and furnishes a `plausible justification' for inspection" (Joe Z. v. Superior Court, supra, 3 Cal.3d 797, 804), petitioner may be entitled to discovery of other records as well. We are reluctant to approve blanket screening of information by the trial court in camera, since defense counsel is ordinarily in a better position to evaluate the significance of particular information to his client's case; but in camera screening on the basis of guidelines furnished by defense counsel, and subject to appellate review, may be an appropriate means in some cases of balancing the competing policies of confidentiality and cross-examination. (Cf. People v. Woolman (1974) 40 Cal. App.3d 652, 655 [115 Cal. Rptr. 324]; State v. Brown (1975) 132 N.J. Super. 584 [334 A.2d 392, 394].) Where information is furnished to defense counsel it may, of course, be subject to appropriate protective orders, and to excision of confidential and irrelevant information. (Joe Z. v. Superior Court, supra.)
