
199 Cal.App.3d 1087 (1988)
245 Cal. Rptr. 293
DEPARTMENT OF CORRECTIONS et al., Petitioners,
v.
THE SUPERIOR COURT OF SAN DIEGO COUNTY, Respondent; RONALDO M. AYALA, Real Party in Interest.
Docket No. D007217.
Court of Appeals of California, Fourth District, Division One.
March 25, 1988.
*1089 COUNSEL
John K. Van de Kamp, Attorney General, Steve White, Chief Assistant Attorney General, Robert B. Shaw and Frederick R. Millar, Jr., Deputy Attorneys General, for Petitioners.
*1090 No appearance for Respondents.
Elisabeth Semel and Robert E. Boyce for Real Party in Interest.
OPINION
KREMER, P.J.
The California Department of Corrections (CDC) and the Attorney General of the State of California (Attorney General) seek a peremptory writ of mandate and prohibition after Ronaldo M. Ayala (Ayala) sought certain records from the CDC by subpoena duces tecum and obtained an ex parte protective order from the Superior Court of San Diego County. The order directed, inter alia, that the subpoena duces tecum, the accompanying declaration of counsel, and the supporting memorandum of points and authorities be sealed, and prohibited the CDC and the Attorney General's office from discussing the contents of the sealed documents with, or providing copies of the subpoenaed documents to, the San Diego District Attorney's office. We grant the petition.

FACTUAL AND PROCEDURAL BACKGROUND
In this capital case, Ayala is charged with murdering three individuals and with the robbery and attempted murder of a fourth individual. The District Attorney of San Diego County (District Attorney) is prosecuting the case against Ayala, and is alleging special circumstances pursuant to Penal Code[1] sections 190.2(a)(3) and 190.2(a)(17)(i). In its First Amended Notice of Aggravating Circumstances, section 190.3(b), the prosecution notified Ayala's counsel it intended to introduce evidence that Ayala, while an inmate at Folsom Prison, fatally stabbed another inmate, John Joe Casas (Casas). Apparently during its investigation, the District Attorney's office interviewed inmate Walter Lewis (Lewis) who claimed he was an eyewitness to the Casas killing and identified Ayala as the person responsible.
To investigate the allegations concerning Casas' death and to determine Lewis's credibility, Ayala subpoenaed Lewis's prison records and records pertaining to Casas' death from the CDC. At Ayala's request in ex parte proceedings, the superior court issued a protective order on October 21, 1987 (October 21 Order) sealing the subpoena, supporting declaration of counsel, and supporting points and authorities. The October 21 Order additionally provided the documents in question were to be delivered under seal *1091 to the court. The October 21 Order further designated a named deputy attorney general as legal representative of the CDC (the designated representative) and directed the designated representative and the CDC not to discuss with other law enforcement agencies, including the San Diego District Attorney's office, the contents of the sealed documents or the materials produced. The designated representative was also prohibited from providing copies of the subpoenaed documents to other law enforcement agencies.
The CDC through the Attorney General moved the court to vacate its October 21 Order. At oral argument, the court clarified the October 21 Order and acknowledged that the language of the order was overly broad. The court explained that the order did not prevent notification to Lewis that his files were being subpoenaed. Additionally, the court modified the October 21 Order to allow the CDC to respond if the District Attorney inquired about the subpoenaed material as long as the District Attorney's inquiry did not in any way arise from Ayala's subpoena. In other words, the CDC could provide the same documents to the District Attorney if the District Attorney requested them independent of Ayala's request. The court also modified the October 21 Order so that the designated representative and the CDC were not precluded from communicating with the District Attorney's office about any documents the District Attorney might independently request. However, the court did not alter the order insofar as it precluded the CDC and the designated representative from discussing the subpoena duces tecum and supporting documents or providing copies of Ayala's subpoenaed documents to the District Attorney. On December 1, 1987, the court entered a revised order reflecting its modifications to the October 21 Order.
These proceedings ensued. At the request of the CDC and the Attorney General we issued a stay of proceedings related to the execution and enforcement of the subpoena duces tecum.

DISCUSSION

I
(1a) Here, the superior court, in ex parte proceedings,[2] issued an order sealing the subpoena duces tecum and supporting documents seeking prison records. Additionally, the court in these ex parte proceedings issued what *1092 amounted to a gag order to the two public agencies involved in producing the requested public records. We are confronted with the question whether under the circumstances of this case the court was justified in issuing its order on an ex parte basis without the participation of the District Attorney's office. For the reasons discussed below, we conclude it was not.[3]
(2) "`The fundamental requisite of due process of law is the opportunity to be heard' [citation], a right that `has little reality or worth unless one is informed that the matter is pending and can choose for himself whether to ... contest.' [Citations.]" (Goss v. Lopez (1975) 419 U.S. 565, 579 [42 L.Ed.2d 725, 737, 95 S.Ct. 729].) In the context of the opportunity to be heard, it is not just the defendant but also the People who are entitled to due process in a criminal proceeding. (People v. Dennis (1986) 177 Cal. App.3d 863, 873 [223 Cal. Rptr. 236]; see Stein v. New York (1953) 346 U.S. 156, 197 [97 L.Ed. 1522, 1549, 73 S.Ct. 1077], overruled on other grounds in Jackson v. Denno (1964) 378 U.S. 368 [12 L.Ed.2d 908, 84 S.Ct. 1774, 1 A.L.R.3d 1205].)
To assure due process, open proceedings involving the participation of both parties are the general rule in both criminal and civil cases. (See, e.g., Cal. Rules of Court, rule 379; McDonald v. Severy (1936) 6 Cal.2d 629, 631 [59 P.2d 98].)
"[I]n an adversary proceeding where an order may affect the rights of an adverse party, notice must be given to protect the adverse party's right to be heard on the issue as a matter of due process of law. [Citations.]" (People v. Wilshire Ins. Co. (1975) 46 Cal. App.3d 216, 222 [119 Cal. Rptr. 917].) Ex parte proceedings have been specifically disapproved in various contexts in criminal cases. (See, e.g., People v. Dennis, supra, 177 Cal. App.3d at pp. 872-873 [motion for new trial]; McGown v. Superior Court (1977) 75 Cal. App.3d 648, 652 [142 Cal. Rptr. 262] [change of venue motion].)
Our Supreme Court recognized two elementary procedural shortcomings inherent in ex parte proceedings in United Farm Workers of America v. Superior Court (1975) 14 Cal.3d 902, 908-909 [142 Cal. Rptr. 262].[4] First, without the presence of the adversary party the court has a shortage of factual and legal contentions on which to base its decision. (Id. at p. 908.) *1093 Second, with only the moving party present to assist in drafting the court's order there is a danger the order may sweep "more broadly than necessary." (Id. at p. 909.) This second shortcoming is amply demonstrated in this case where the court had to amend the October 21 Order because it arguably prevented the People from obtaining CDC documents even upon independent request.
(1b) The Attorney General has set forth several ways in which the People's rights may be adversely affected by the court's order. Discovery proceedings involving third parties can potentially result in sanctions being applied against the People should the third party refuse to produce the documents requested. (See Dell M. v. Superior Court (1977) 70 Cal. App.3d 782, 788 [144 Cal. Rptr. 418] [suppressing evidence of altercation between arresting officer and defendant because of the police department's refusal to turn over records].) The secrecy of the proceedings also prevents the District Attorney from knowing facts which might influence his decision to challenge the assigned judge or to defeat a challenge to the judge by Ayala. The ex parte proceedings may result in delays of the trial, thereby interfering with the People's right to speedy trial guaranteed under section 1050. We conclude that the ex parte proceedings violated the People's right to due process of law. Further, the nondisclosure order that resulted from the ex parte proceedings prevented the People from having an opportunity to be heard even after the fact and served to compound and perpetuate the due process violation.

II
Ayala contends that the ex parte proceedings were consistent with California Rules of Court, rule 379, which provides that an application for an order may be made ex parte if it appears by declaration that a "party should not be required to inform the opposing party or the opposing party's attorney." Ayala argues that since it was necessary for him to make a showing of good cause in support of the subpoena duces tecum (see Millaud v. Superior Court (1986) 182 Cal. App.3d 471, 475 [227 Cal. Rptr. 222]), and since that showing included "privileged information," ex parte proceedings were necessary to prevent the type of compulsory, self-incriminating disclosure prohibited in Prudhomme v. Superior Court (1970) 2 Cal.3d 320, 325-326 [85 Cal. Rptr. 129, 466 P.2d 673].
In Prudhomme the Supreme Court held that a defendant's right against self-incrimination "forbids compelled disclosures which could serve as a `link in a chain' of evidence tending to establish guilt of a criminal offense...." (Id. at p. 326.) Prudhomme prohibits compelled discovery of defense information that conceivably might lighten the load the People must *1094 shoulder in proving their case-in-chief. (Ibid.) Ayala contends that revealing the subpoena duces tecum and the supporting documents would lighten the prosecutor's burden by "throw[ing] open the Defense files and strategies for the prosecution's perusal."
(3) We are mindful that ex parte proceedings may be necessary to protect the constitutional rights of a defendant or to protect the attorney's work product. (See, e.g., Keenan v. Superior Court (1982) 31 Cal.3d 424, 430 [180 Cal. Rptr. 489, 640 P.2d 108] [providing for confidentiality of a defense motion for appointment of a second attorney to avoid undue disclosure of defense strategy].) (4) Here, however, the order sweeps too broadly. Even if, as Ayala argues, he is required to divulge privileged information to make a showing of good cause in support of the subpoena duces tecum, it is unnecessary to totally exclude the District Attorney's office from the proceedings. Rather, the court may review the supporting documents in camera on an ex parte basis to determine if any specific information constitutes privileged information. The court may then seal those specific items. In this manner the court will protect the defendant's constitutional rights and the attorneys' work product while, to the extent possible, still providing for open proceedings.
People v. Worthy (1980) 109 Cal. App.3d 514 [167 Cal. Rptr. 402], cited by Ayala, is consistent with this approach. In Worthy the trial court denied the defendant's discovery motion. The Court of Appeal affirmed the denial and in dicta stated that: "[A] balance must be struck between the requirement that the defendant make a plausible justification for requested discovery and the limitations on prosecutorial discovery. It is conceivable that if too much is required of a defendant, he could be forced to reveal anticipated defense strategy. However, in the face of such danger, the court could hold an ex parte in camera hearing to establish the relevancy of requested information." (Id. at p. 525, fn. 3.) Nothing in Worthy requires the complete exclusion of the prosecution or the protective order in issue here.

III
Ayala also argues the court's order prohibiting disclosure by the CDC and the designated representative is necessary to prevent prosecutorial discovery and to prevent Ayala's forced election between constitutional rights. (5) Courts have the inherent power to provide for discovery in a criminal case including the issuance of protective orders. (See Millaud v. Superior Court, supra, 182 Cal. App.3d 471 at pp. 475-476.) A trial court's orders may be set aside only if they constitute an abuse of discretion. (See, e.g., Corenevsky v. Superior Court (1984) 36 Cal.3d 307, 321 [204 Cal. Rptr. *1095 165, 682 P.2d 360].) We conclude the court's order is not supported by the law and constitutes an abuse of discretion.

The Order Prohibiting Disclosure Is Not Required by the Prohibition Against Prosecutorial Discovery
(6) California cases prohibiting prosecutorial discovery are rooted in the defendant's privilege against self-incrimination found in both the federal and state Constitutions. (See, e.g., In re Misener (1985) 38 Cal.3d 543, 545, 558 [213 Cal. Rptr. 569, 698 P.2d 637]; Prudhomme v. Superior Court, supra, 2 Cal.3d 320 at p. 326.) The privilege requires the state to carry the entire burden of convicting the defendant and forbids "compelled disclosures from the defendant that will aid the prosecution." (In re Misener, supra, 38 Cal.3d at p. 558, italics added.)
(7) Here, under the court order, the CDC and the designated representative may not disclose to other law enforcement agencies, including the District Attorney's office, either (1) the contents of the subpoenaed records (absent an independent request) or (2) the contents of the subpoena duces tecum and supporting documents.
As to the CDC records, we conclude the prohibition against prosecutorial discovery does not prevent the CDC from voluntarily supplying those records to the prosecution. Information in the possession of a third party is not impressed with the defendant's privilege against self-incrimination simply because it is subpoenaed by the defendant. Neither self-incrimination nor compulsion is involved when a third party voluntarily turns over its own documents to a prosecutor.
The fact the order allows the CDC to provide the records to the prosecution upon independent request does not change our conclusion. If the prosecution is limited to obtaining third party records or information only upon independent request, defendants would be able to prevent third parties from voluntarily turning over information to the prosecution by serving a subpoena and nondisclosure order before the third party acted to provide the information to the prosecution. The prohibition against prosecutorial discovery does not require such a result.
Ayala urges that even if third parties normally should not be prevented from disclosing subpoenaed information to the prosecution, a different rule should apply when the third party is a government agency.[5] That is, a *1096 protective order is necessary to prevent one state agency from "spying" on the proceedings of a defense investigation via another state agency. We find no justification to treat government agencies differently from any other third-party recipient of a subpoena duces tecum.
As to the disclosure of the documents prepared by the defense, we believe Ayala's privilege against self-incrimination will be satisfied by the trial court conducting an ex parte in camera review discussed in the previous section. Following such review the court may seal any portions of the documents containing privileged information or the attorneys' work product and prohibit the CDC and the designated representative from disclosing that information.

Vacating the Protective Order Does Not Impermissibly Require Ayala to Choose Between Constitutional Rights
(8) Ayala argues that vacating the nondisclosure order will violate his Sixth Amendment right to counsel by allowing the prosecution access to his attorneys' work product, defense strategies, and confidential communications between the attorneys and the client. Without the nondisclosure order, Ayala contends he will be forced to choose between waiving his right to counsel and sacrificing his due process right to discover information important to his case.
Ayala relies upon Simmons v. United States (1968) 390 U.S. 377 [19 L.Ed.2d 1247, 88 S.Ct. 967], to support his argument. However, the Simmons reasoning upon which Ayala relies has been substantially undercut by McGautha v. California (1971) 402 U.S. 183, 211-213 [28 L.Ed.2d 711, 728-729, 91 S.Ct. 1454], a capital murder case. In McGautha, the defendant, after a unitary trial determining both guilt and punishment, cited Simmons and argued he was entitled to bifurcated trials on the issues of guilt and punishment. He contended that under the unitary trial system his due process right to be heard on the issue of punishment conflicted with his constitutional right not to be compelled to testify against himself. The court, in holding there was no constitutional violation in requiring him to undergo a unitary trial, stated: "The criminal process, like the rest of the legal system, is replete with situations requiring `the making of difficult judgments' as to which course to follow. [Citation.] Although a defendant may have a right, even of constitutional dimensions, to follow whichever course he chooses, the Constitution does not by that token always forbid requiring him to choose. The threshold question is whether compelling the election impairs to an appreciable extent any of the policies behind the rights involved." (Id. at p. 213 [28 L.Ed.2d at p. 729].)
*1097 With prosecutorial access to the subpoenaed records, Ayala is faced with a difficult decision whether to subpoena the records and run the risk of bringing possibly adverse information to the attention of the prosecutor or to forgo seeking information that could be beneficial to his defense. However difficult that decision may be, we do not see it as impairing the policies behind Ayala's right to counsel. In essence it is Ayala's position that the prosecution, by examining the records and knowing they have been subpoenaed by the defense, will have access to his attorneys' work product because the prosecutor will be able to "glean" the attorneys' thought processes and determine defense strategy. There is no basis in the law for interpreting attorneys' work product so broadly.
To the extent defense counsel may have revealed either privileged information or attorneys' work product in the documents prepared in support of the subpoena duces tecum, the trial court would protect Ayala's rights by conducting an ex parte hearing and sealing portions of the documents as previously discussed.
An alternative writ or order to show cause would add nothing to the presentation. A peremptory writ is proper. (Code Civ. Proc., § 1088; United Nuclear Corp. v. Superior Court (1980) 113 Cal. App.3d 359 [169 Cal. Rptr. 827], cert. den. sub nom. General Atomic Co. v. United Nuclear Corp. (1981) 454 U.S. 878 [70 L.Ed.2d 187, 102 S.Ct. 358]; Goodenough v. Superior Court (1971) 18 Cal. App.3d 692, 697 [96 Cal. Rptr. 165].)

DISPOSITION
Let a peremptory writ issue directing the superior court to hold an in camera ex parte hearing to determine what, if any, portions of the supporting documents are privileged or constitute attorneys' work product and to seal the documents accordingly. The District Attorney should be allowed to participate in future proceedings in this matter, except where sealed matters are involved. The designated representative and the CDC are free to discuss subpoenaed records with, or provide copies of the records to, the District Attorney. The stay is vacated. Pursuant to California Rules of Court, rule 24(d), this decision is final immediately.
Benke, J., concurred.
*1098 WIENER, J.
I dissent.
Despite its disclaimer, the majority sanctions the disclosure of defense strategies and Ayala's attorneys' work product to the prosecution. The prosecution has served notice that it intends to seek the death penalty against Ayala and further intends to use Ayala's alleged murder of John Joe Casas as an aggravating circumstance supporting the death penalty. The only way that Ayala's counsel can reasonably investigate and defend against this allegation is to subpoena records in the possession of the California Department of Corrections (CDC). To establish good cause for the subpoena Ayala's counsel must set forth with specificity the importance of the records to the defense. The majority believes the attorneys' work product can be adequately protected by deleting specific statements from counsel's declaration. I disagree. The fact Ayala has subpoenaed these specific records reveals the defense's thought process. The prosecution will obtain the records themselves as a result of the defense's efforts.
The majority expresses concern that the nondisclosure order allows the defense to prevent a third party from voluntarily providing records that he would have otherwise turned over to the prosecution. There is nothing in the record to indicate the CDC had any intention of providing the subpoenaed records to the prosecution absent request. It is only the defense request for the documents that has triggered the CDC's and the Attorney General's interest in providing the records to the prosecution. Moreover, although I might be reluctant to prohibit a nongovernmental third party from voluntarily disclosing defense subpoenaed records to the prosecution, the special relationship between this third party and the prosecution gives rise to the need for special caution. The fact the District Attorney's Office, the Attorney General's Office, and the CDC are all government agencies, and in particular are associated with law enforcement, makes it clear the CDC and the Attorney General's Office will serve as a conduit to the prosecution absent court protection. Ayala's counsel are therefore placed in the intolerable position where they must either forego seeking records necessary to adequately investigate the prosecution's allegations and to prepare Ayala's defense or they must throw their investigation open to prosecutorial scrutiny.
A trial court has wide latitude in fashioning discovery orders that will protect the interests of the parties involved and further the administration of justice. (See, e.g., Millaud v. Superior Court (1986) 182 Cal. App.3d 471, *1099 475-476 [227 Cal. Rptr. 222].) Its orders should be vacated only upon a showing of abuse of discretion. (See Corenevsky v. Superior Court (1984) 36 Cal.3d 307, 321 [204 Cal. Rptr. 165, 682 P.2d 360].) The nondisclosure order does not prevent the prosecution from actively pursuing its own discovery and obtaining exactly the same records from the CDC that are sought by the defense. What it does prevent is prosecutorial access to the defense discovery. The order is well-reasoned and protects the interests of both parties. It does not constitute an abuse of discretion. I would deny the petition.
NOTES
[1]  All statutory references are to the Penal Code unless otherwise specified. When referring to statutory subparts we omit repetition of the word "subdivision."
[2]  Ayala's contention the proceedings are not ex parte because the CDC and its representative, the Attorney General, have had ample opportunity to appear and be heard is without merit. The adverse party in these criminal proceedings is the People of the State of California, not the CDC, a third party from whom documents have been subpoenaed. The San Diego District Attorney's office, the representative of the People, has had no opportunity to appear and be heard.
[3]  Because we believe the court was not justified in issuing the order on an ex parte basis we do not reach the numerous other arguments raised by the CDC and the Attorney General.
[4]  In United Farm Workers of America, the trial court, without notice to, or an opportunity to be heard by, the defendant labor union, issued a temporary restraining order limiting labor picketing. The court's analysis accordingly emphasized the need for caution where First Amendment rights were involved. Although the issues here may differ, the procedural defects noted in ex parte proceedings are equally applicable.
[5]  Taking Ayala's position to its logical conclusion, a defendant could even prevent one division of the District Attorney's office, possessing records subpoenaed by the defense, from providing the records to another division prosecuting the defendant.
