
91 Cal.App.3d 660 (1979)
154 Cal. Rptr. 563
In re THOMAS BRINDLE et al. on Habeas Corpus.
Docket No. 3840.
Court of Appeals of California, Fifth District.
April 5, 1979.
*665 COUNSEL
Evelle J. Younger, Attorney General, Jack R. Winkler, Chief Assistant Attorney General, Arnold O. Overoye, Assistant Attorney General, Joel E. Carey and Arthur G. Scotland, Deputy Attorneys General, for Appellant.
David H. Fielding, under appointment by the Court of Appeal, Richard A. Carsel, Public Defender, and Patricia Nemec Ashbaugh, Deputy Public Defender, for Respondents.
Walter L. Gorelick, Public Defender, as Amicus Curiae on behalf of Respondents.
OPINION
CREEDE, J.[*] 

STATEMENT OF THE CASE
The public defender for San Luis Obispo County filed a petition for writ of habeas corpus in San Luis Obispo County Superior Court on June 13, 1978, on behalf of respondents Thomas Brindle, Dennis Hall, Todd Young, Richard Mroczko and Joseph Seide, inmates of the California Mens Colony, seeking relief from alleged interference by prison officials with their access to the public defender. In issuing the writ returnable the following day the public defender was appointed to represent all petitioners. The petition was heard on June 14, 1978, and was granted. The court ordered that all law enforcement agencies and correctional institutions within the confines of San Luis Obispo County allow the public defender access to any persons incarcerated, being interrogated or under investigation in any criminal matter. The order further directed the designated agencies and institutions to permit the public defender to personally consult with such persons to ascertain if they desired his *666 assistance and for a determination whether they qualified for the services of the public defender.[1] Appellant appeals from the order. (Pen. Code, § 1506.) Upon appellant's petition, this court stayed enforcement of the trial court's order pending appeal, except insofar as it grants relief to the named respondents.


*667 STATEMENT OF THE FACTS
On June 2, 1978, James B. Maguire III, assistant public defender, learned while visiting a client at the Mens Colony that inmates Thomas Brindle, Richard Mroczko, Dennis Hall and two other inmates were being held in administrative segregation as suspects during an investigation of the killing of another inmate. Maguire contacted the acting assistant superintendent of the facility, requested to see the five suspects in the homicide and was told he would be contacted on June 5, 1978, as to granting or denying the request. No response was received.
The public defender's office received letters from Hall and Brindle requesting the public defender to represent them; the letters also stated Todd Young and Richard Mroczko were being held in administrative segregation as suspects in the homicide. Lee Whipple, a deputy public defender, went to the Mens Colony on June 5, 1978, and was allowed to interview Hall, Brindle, Young and Todd. Whipple learned another inmate, Joseph Seide, was held in segregation as a suspect but had been released back into the general population of the facility.
On June 12, 1978, Hall contacted Whipple by phone and asked to see her. Whipple arrived at the facility but her request to see Hall and Seide was denied. She was advised by a Mens Colony official that the San Luis Obispo District Attorney and prison administrators had decided the public defender should not be permitted to see the inmates until appointed to represent them by the court. Although the inmate initiated the contact, Whipple was informed the Mens Colony was following the guidelines established by the San Luis Obispo County District Attorney's office and she would have to contact the district attorney for access to a prisoner prior to a formal order of appointment. The public defender was told access to a prisoner would be denied if no charges had been filed even in cases of an inmate's request to confer with the public defender.
The declaration of Patricia Nemec Ashbaugh established that the Department of Corrections was acting under title 15, California Administrative Code, section 3175, subdivision (d), pertaining to attorney visitation and consultation. No counterdeclarations were filed, but an unsworn statement was made during the habeas corpus proceedings by Lieutenant Loren Birra, head of the security squad at the California Mens Colony, concerning his efforts to obtain a policy clarification.
*668 The public defender filed a petition for a writ of habeas corpus on June 13, 1978, seeking access to the respondents and the removal of the restraints on the right to consult with counsel. On June 13 the court appointed the public defender to represent the respondents, renewed the appointment on June 14, and after a hearing consisting of oral argument granted the petition. The district attorney made an offer of proof that Hall, Young and Seide were no longer in administrative segregation and had been released to reside with the general prison population. There was no motion for continuance, request to offer testimony or leave to file counterdeclarations. The factual records consist of the declarations filed in support of the petition.

THE TRIAL COURT PROPERLY GRANTED RELIEF TO PETITIONERS WHO REQUESTED THE PUBLIC DEFENDER TO REPRESENT OR CONSULT WITH THEM.
The public defender received letters from respondents Hall and Brindle requesting representation on June 5, 1978. A deputy public defender was allowed to interview Hall, Brindle and two other suspects that day. However, on June 12, 1978, the deputy public defender was not allowed to see Hall or Seide on the specious ground that the public defender had not yet been appointed by the court to represent them. The prison officials did not adhere to the administrative regulations of the Department of Corrections, title 15, California Administrative Code, section 3175.[2] The denial of access was not placed on lack of timely notice of the attorney's visit under section 3175, subdivision (c).
*669 Appellant does not challenge the trial court's order insofar as it affords relief to Hall and Brindle, who had requested the public defender's services. Government Code section 27706, subdivision (a), requires that "upon request of the defendant or upon order of the court" the public defender shall defend qualified defendants "at all stages of the proceedings" and "give counsel and advice to such person about any charge against him" for any offense triable in the superior, municipal or justice courts. Section 27706, subdivision (g),[3] specifies upon request he may represent any indigent person "in a proceeding of any nature relating to the nature or conditions of detention, of other restrictions prior to adjudication...." The public defender is to make the initial determination of the eligibility of a defendant who requests to be represented. (§ 27707; Ingram v. Justice Court (1968) 69 Cal.2d 832, 838 [73 Cal. Rptr. 410, 447 P.2d 650, 36 A.L.R.3d 1391].)
(1) The function of habeas corpus has evolved from the traditional remedy for release of a prisoner to include a declaration of rights of a prisoner not entitled to outright release. (See e.g., In re Ochse (1951) 38 Cal.2d 230, 232 [238 P.2d 561]; Witkin, Cal. Criminal Procedure (1963) Habeas Corpus and Other Extraordinary Writs, §§ 788-789, pp. 762-763.) The writ of habeas corpus may be used to secure fundamental rights of a person lawfully in custody. (In re Newbern (1961) 55 Cal.2d 500, 503 [11 Cal. Rptr. 547, 360 P.2d 43]; see In re Henderson (1972) 25 Cal. App.3d 68, 74 [101 Cal. Rptr. 479].) A person is not deprived of his constitutional rights by reason of his incarceration for a felony, although reasonable regulation of those rights is permitted. (In re Jones (1962) 57 Cal.2d 860, 862 [22 Cal. Rptr. 478, 372 P.2d 310]; In re Hutchinson (1972) 23 Cal. App.3d 337, 341 [100 Cal. Rptr. 124].)
(2) Once the court has issued a writ of habeas corpus it has the power to dispose of the matter "as the justice of the case may require." (Pen. Code, § 1484; In re Crow (1971) 4 Cal.3d 613, 619 [94 Cal. Rptr. 254, 483 P.2d 1206]; In re Hochberg (1970) 2 Cal.3d 870, 875, fn. 4 [87 Cal. Rptr. 681, 471 P.2d 1].) "The very nature of the writ demands that it be *670 administered with the initiative and flexibility essential to insure that miscarriages of justice within its reach are surfaced and corrected." (Harris v. Nelsen (1969) 394 U.S. 286, 291 [22 L.Ed.2d 281, 286, 89 S.Ct. 1082].) (3) Extraordinary relief by mandamus or habeas corpus has been utilized to correct prior conditions or to declare the rights of unnamed and future petitioners by decisions designed to affect the prospective administration of the criminal justice system. (In re Walters (1975) 15 Cal.3d 738, 744 [126 Cal. Rptr. 239, 543 P.2d 607]; In re William M. (1970) 3 Cal.3d 16, 23 [89 Cal. Rptr. 33, 473 P.2d 737]; Reaves v. Superior Court (1971) 22 Cal. App.3d 587, 592-593 [99 Cal. Rptr. 156].) "Where questions of general public concern are involved, particularly in the area of the supervision of the administration of criminal justice [the court] may reject mootness as a bar to the decision on the merits." (In re Walters, supra, 15 Cal.3d at p. 744.) Although the petitioner may have received the relief prayed for, the court nevertheless may decide a question arising from a recurring problem important to insure the basic rights of prisoners. (In re Fluery (1967) 67 Cal.2d 600, 601 [63 Cal. Rptr. 298, 432 P.2d 986].) Habeas corpus is an appropriate procedure to be used by petitioners "to obtain a declaration of rights in the prevailing circumstances." (In re Walters, supra, 15 Cal.3d at p. 744; see also In re Harrell (1970) 2 Cal.3d 675, 682, 706 [87 Cal. Rptr. 504, 470 P.2d 640]; In re Fluery, supra, 67 Cal.2d at p. 601.) Thus, the trial court properly granted the public defender the right of access to Brindle and Hall at the Mens Colony.

THE TRIAL COURT ERRONEOUSLY EXTENDED RELIEF TO OTHER INCARCERATED PERSONS PROSPECTIVELY WHO HAD NOT REQUESTED THE PUBLIC DEFENDER TO REPRESENT THEM.
It should first be noted that before entering its written order the trial court appointed the public defender to represent all of the respondents. Thus, the court's order properly granted relief to Mroczko, Young and Seide (who had not initially requested the public defender to represent them) because at the time petitioners were ordered to have access to the public defender there was a formal order appointing the public defender to represent them. Since the public defender is now appointed by the court to represent respondents, they have a right, as prisoners, to confer with their attorney at all reasonable times. Appellant challenges the court's appointment of the public defender for any potential infraction of prison rules or during the investigation stage before any charge is made. This contention overlooks the fact the public defender was appointed as counsel in the habeas corpus proceedings. (§ 27706, subds. (a), (g).) The *671 appeal is taken from the order granting the writ of habeas corpus and not from the order appointing counsel to represent the petitioners.
(4) Appellant asserts there is no evidence Young, Mroczko and Seide requested the services of the public defender and therefore the trial court's order granting them relief was improper. We disagree. They appeared in court with the public defender as counsel and the court must assume the public defender had undertaken or entered into the attorney-client relationship either pursuant to its order or upon request. The appearance in court with counsel acting on one's behalf is itself presumptive evidence of the existence of the relationship and the trial court properly did not attempt to go behind it. (Ingram v. Justice Court, supra, 69 Cal.2d at pp. 840-841.)
(5) This case had its origin in the demand by the public defender to be allowed access to prisoners who were not then represented by the public defender and who had not requested such representation.[4] The trial court considered the problem as being one of long standing in San Luis Obispo County and therefore on appeal it should be considered in broader prospective than on the mere basis of the order of appointment which preceded the ruling on the petition.[5]
The order of the trial court, in part, commands all law enforcement and correctional institutions within its jurisdiction to "allow the Public Defender ... upon request, access to meet and confer with any person or persons in their care, custody or control, when such person or persons are incarcerated or under interrogation or under investigation in any criminal matter...." In addition to the question of validity of a writ of habeas corpus affecting prospective prisoners when such relief was not prayed for, nor evidence produced that others similarly situated have or will experience any similar deprivation, the order is fatally defective for two other distinct but related flaws.
First, the order purports to grant the public defender the right to consult with any incarcerated person under investigation or interrogation *672 in any criminal matter without regard to the inmate's desire to confer with the public defender or have counsel. The purpose of the creation of the public defender was to protect the right to counsel of the citizen who could not otherwise afford to hire an attorney. (See § 27706.) As the United States Supreme Court stated in Miranda v. Arizona (1966) 384 U.S. 436, 480 [16 L.Ed.2d 694, 727, 86 S.Ct. 1602, 10 A.L.R.3d 974], "If the individual desires to exercise his privilege, he has the right to do so. This is not for the authorities to decide." The order of the trial court in this case allows the public defender to make the decision for the individual as to whether that person should consult an attorney in the first instance by directing that the public defender have immediate access to inmates who have not communicated with him, directly or indirectly, or requested either the appointment of or consultation with counsel.
The far-reaching relief ordered contravenes the basic principle that the right to counsel belongs to the individual. The underlying rationale of Miranda and other cases is that the individual must be given an opportunity to exercise this right which requires that he be so informed. (Miranda v. Arizona, supra, 384 U.S. at p. 479 [16 L.Ed.2d at pp. 726-727].) Once the individual has been advised of his rights, he may "knowingly and intelligently waive these rights." "A suspect may indicate [his] wish in many ways. He may, as in [People v.] Fioritto [(1968) 68 Cal.2d 714 (68 Cal. Rptr. 817, 441 P.2d 625)], refuse to sign a waiver of his constitutional rights; he may simply refuse to continue an interrogation already in progress; or he may, as in the instant case, ask for an attorney." (People v. Ireland (1969) 70 Cal.2d 522, 535 [75 Cal. Rptr. 188, 450 P.2d 580, 40 A.L.R.3d 1323].)
Faretta v. California (1975) 422 U.S. 806 [45 L.Ed.2d 562, 95 S.Ct. 2525] established that a defendant competent to waive counsel has an affirmative right to represent himself. (See also Ferrel v. Superior Court (1978) 20 Cal.3d 888, 891 [144 Cal. Rptr. 610, 576 P.2d 93]; People v. Teron (1979) 23 Cal.3d 103, 113 [151 Cal. Rptr. 633, 588 P.2d 773].) Faretta is illustrative of the rule that a defendant has a federal constitutional right not to have counsel thrust upon him after charges are filed and criminal proceedings commenced if he voluntarily and intelligently elects either to represent himself or to proceed without counsel. A similar and perhaps more extensive right of self-representation exists prior to the accusatory stage.
Therefore, insofar as the trial court's order purports to grant the public defender the power to unilaterally decide to confer with prisoners who have not requested counsel or who have waived their right to counsel, it is *673 contrary to established principles.[6] (6) The right to counsel secured by the Sixth Amendment and applied to the states by the Fourteenth Amendment is the right of the individual to be represented by counsel, and not the right of the public defender to confer with any person in custody or under investigation by law enforcement authorities at any time without request. The contention of the public defender here is not unlike that urged by the "next friend" seeking to act on behalf of a prisoner without his concurrence which was rejected by the California Supreme Court in In re Harrell, supra, 2 Cal.3d at pp. 688-689. Furthermore, section 27706, subdivision (a), reflects this element of personal choice by providing that the public defender's duties arise only upon "request of the defendant or upon order of the court." Since the issue is of "such importance to the administration of justice throughout the state and to the petitioner[s], that we are persuaded to express our views thereon despite the fact that this question too is moot" because the trial court appointed counsel and correctly granted petitioners the relief sought. (In re Newbern, supra, 55 Cal.2d at p. 505.)
The second major flaw in the trial court's order is that it overlooks the point at which the right of counsel attaches. The plain wording of the Sixth Amendment "encompasses counsel's assistance whenever necessary to assure a meaningful `defence'"; it applies only to "critical" stages of the proceedings. (United States v. Wade (1967) 388 U.S. 218, 224-225 [18 L.Ed.2d 1149, 1156, 87 S.Ct. 1926]; Escobedo v. Illinois (1964) 378 U.S. 478, 485-486 [12 L.Ed.2d 977, 982-983, 84 S.Ct. 1758].) If the individual states that he wants an attorney the interrogation must cease until an attorney is present. (People v. Ireland, supra, 70 Cal.2d at p. 536; Miranda v. Arizona, supra, 384 U.S. at p. 474 [16 L.Ed.2d at pp. 723-724].)
(7) The courts have considerably broadened the concept of what is a "critical stage" of criminal proceedings. "... it is now established that the `assistance of counsel' is not limited to courtroom advocacy. A suspect before being placed in a lineup for identification purposes is entitled to counsel [citations] and before questioning by officials, in the accusatory stage [citations]. He is entitled to consultation with counsel while in jail [citations]." (Ligda v. Superior Court (1970) 5 Cal. App.3d 811, 824 [85 *674 Cal. Rptr. 744].) However, the right to counsel of a person who has not so requested does not arise when he is "under investigation," but rather the right attaches when the process has shifted from being one of investigation to one of accusation. (Escobedo v. Illinois, supra, 378 U.S. at p. 492 [12 L.Ed.2d at pp. 986-987]; People v. Dorado (1965) 62 Cal.2d 338, 348 [42 Cal. Rptr. 169, 398 P.2d 361].) The trial court's order purports to provide the public defender access to persons who have not requested counsel and whose rights have not been infringed "at a critical stage of the proceedings." The all-encompassing context requires reversal to the extent the order grants prospective class relief.

DUE PROCESS WAS DENIED TO THE INSTITUTIONS AND AGENCIES WHICH WERE NOT AFFORDED NOTICE.
The order granting the petition for writ of habeas corpus was served on (1) Robert N. Tait, District Attorney of San Luis Obispo County, (2) Donald D. King, probation officer, (3) George S. Whiting, sheriff, (4) director of the local mental health department, (5) D.J. McCarthy, Superintendent of the California Mens Colony, (6) Atascadero State Hospital, (7) Chiefs of Police of the Cities of Arroyo Grande, Morro Bay, Paso Robles, Pismo Beach, Grover City and San Luis Obispo, and (8) was directed to "all employees, officers, agents, deputies and staff of said agencies and institutions." The petition and writ of habeas corpus were directed to D.J. McCarthy, Superintendent of the California Mens Colony. It is not clear for whom the district attorney appeared but presumably it was on behalf of the superintendent of the Mens Colony who had a staff representative present and apparently acquiesced in the representation. "It appears that the district attorney of a county wears two hats. He acts as both a county officer and a state officer in the exercise of the powers for which he has been elected." (Pitchess v. Superior Court (1969) 2 Cal. App.3d 653, 657 [83 Cal. Rptr. 41].) Even in the dual role as state and county officer and in his capacity as public prosecutor (§ 26500) it cannot be assumed that the district attorney appeared for the county as a political subdivision, the municipalities in San Luis Obispo County or the State Department of Mental Health. (8) The issuance of an all-inclusive order, after a hearing on notice of 24 hours or less, directing compliance by political subdivisions, municipalities and agencies which did not have petitioners in actual or constructive custody, without notice or an opportunity to be heard, violates the essence of due process requiring reversal of the order insofar as it is directed to other governmental agencies than the California Mens Colony.[7]
*675 (9) The writ of habeas corpus is available to "every person unlawfully imprisoned or restrained." (Pen. Code, § 1473.) (10) The petition for the writ must be very specific as to the person seeking the writ, the persons confining or restraining the petitioner and the facts making the imprisonment illegal. (Pen. Code, § 1474.) The party seeking the writ must be under actual or constructive custody. (See In re Smiley (1967) 66 Cal.2d 606, 612-613 [58 Cal. Rptr. 579, 427 P.2d 179].) Only under "very exceptional circumstances" may a petition for habeas corpus be brought by someone other than the prisoner seeking release. (In re Harrell, supra, 2 Cal.3d at p. 689.) (11) Habeas corpus may not be used to challenge anticipated future actions or to secure declaratory relief. (In re Drake (1951) 38 Cal.2d 195, 198 [238 P.2d 566].) "But if a pending case poses an issue of broad public interest that is likely to recur, the court may exercise an inherent discretion to resolve that issue even though an event occurring during its pendency would normally render the matter moot." (In re William M., supra, 3 Cal.3d at p. 23.)
Irrespective of mootness, a habeas corpus petition is "an acceptable vehicle for a general declaration of the procedural rights of individuals detained" involving an issue of general public concern, particularly if it pertains to the administration of criminal justice. (In re Walters, supra, 15 Cal.3d at p. 744, fn. 3.) The trial court attempted to exercise such authority because of an apparently recurring problem in San Luis Obispo County. We deem the issue of access to the public defender to be one of statewide interest and of importance to the orderly administration of criminal justice, as did the trial judge.
In argument, the public defender asked the court to go beyond the relief for petitioners and to cause the district attorney to cease a concerted course of action calculated to deprive persons in custody of his services. No such relief was prayed for in the petition. If the court had before it a petition for writ of habeas corpus seeking class relief with supporting declarations establishing a persistent or recurring deprivation of access to the public defender with service of the petition and notice to all affected agencies in San Luis Obispo County, the court could have granted *676 prospective or class relief. While the trial judge undoubtedly knew of other instances involving disputes between the district attorney, law enforcement or prison officials and the public defender concerning access, the details do not appear in the evidence as distinguished from the rhetoric in argument. The salutary purpose of the trial judge in seeking to insure the constitutional right to counsel of the inmates of correctional institutions or those under investigation, and to resolve an apparently vexing, recurring and time-consuming problem could not be fulfilled because of the basic procedural defect of lack of notice to other affected agencies on a petition which did not request class relief. Declaratory and class relief was granted in a far-reaching order set on 24 hours' notice. The record does not show service of the petition on the Attorney General. (§ 12511.) While the abbreviated notice was justified by the urgent circumstances so far as the Mens Colony was concerned, appellant correctly urges that the order affords excessive relief in view of the parties, evidence and circumstances before the court.

THE GRANTING OF PROSPECTIVE CLASS RELIEF TRANSFERRED THE RIGHT OF DECISION FROM THE INDIVIDUAL TO THE PUBLIC DEFENDER.
The central issue underlying this case is a contention by the public defender that law enforcement agencies in San Luis Obispo County are denying prisoners and suspects rights secured by Miranda and related cases. By the very nature of the extraordinary writ of habeas corpus, the court's order is improper insofar as it purported to protect the rights of future prisoners in the absence of the existence of a "class claim of constitutional deprivation" constituting a "... class of public interest actions which merit decision notwithstanding solution of the individual petitioner's plight." (Frias v. Superior Court (1975) 51 Cal. App.3d 919, 923 [124 Cal. Rptr. 616].) The record does not establish that all persons arrested, detained or incarcerated in San Luis Obispo County or any substantial number thereof are members of such class.
Nor was the method chosen by the court (giving the public defender a unilateral right of access to all prisoners and suspects) a proper method to protect these rights. The protection of the right to counsel at the earliest stage in the criminal process can be assured without giving the public defender a judicial fiat to forage at will in every police station, custodial facility, or individual police cars for that matter, to personally contact persons who had not requested counsel to advise of the availability of and their eligibility for his services.
*677 While acknowledging the high professional standards maintained by public defenders and with due respect for their vital role in assuring citizens of the right to counsel and the reality that they already have an abundance of clients and responsibilities, nevertheless, the order is so expansive as to be a potential license to the overzealous to listen to the police radio and respond with an on-the-scene offer of public defender services. The need for counsel at various stages of criminal proceedings recognized by the United States Supreme Court in Argersinger v. Hamlin (1972) 407 U.S. 25 [32 L.Ed.2d 530, 92 S.Ct. 2006]; United States v. Wade, supra, 388 U.S. 218; Miranda v. Arizona, supra, 384 U.S. 436; and Gideon v. Wainwright (1963) 372 U.S. 335 [9 L.Ed.2d 799, 83 S.Ct. 792, 93 A.L.R.2d 733], does not contemplate a roving public defender with the right to personally consult with, as distinguished from being available upon request, any detained persons "under investigation in any criminal matter ... to make his services known, ... and to determine whether said persons are eligible for the services of the Public Defender."[8] We recognize such eventualities are remote in view of the existing burdens and responsibilities of public defenders' offices throughout the state and merely illustrate the breadth of the trial court's order.
The public defender is not afforded by statutory authority or decisional law the wide range of authority to personally consult with all detained persons "under investigation in any criminal matter" in the absence of a request for counsel communicated directly or through a third party acting on behalf of persons detained or under the control of San Luis Obispo County law enforcement agencies. This conclusion does not relegate to the "jailer" the right to determine the legal or professional responsibility of the public defender. To do so would be to make law enforcement the arbiter of the public defender's legal and ethical obligations. There are means, other than depriving persons of the right to consult counsel, to correct any conduct in excess of statutory or professional guidelines. (12) To remove law enforcement from regulating the performance of the public defender, a function they are neither legally mandated nor necessarily equipped to perform, we hold that when the public defender requests to consult with a person in custody, he should be advised the public defender is present or accessible, and a determination made whether the individual wishes to consult with such counsel. If the Department of Corrections is the custodial authority, it may require that the request to consult with the public defender be made in writing on forms which presumably are readily available to comply with title 15 California Administrative Code, section 3175, subdivision (d). To conclude *678 otherwise would be to relegate a determination of whether a person in custody or being detained is entitled to consult an attorney to law enforcement and correctional authorities rather than the individual.
In offering to be available to persons under interrogation or investigation of serious crimes, the public defender is acting in accordance with the American Bar Association Standards and the model law for the conduct of their office and not inconsistent with their statutory responsibilities under Government Code section 27700 et seq.[9]
The issue before us is similar to that considered by the Supreme Court in Ingram v. Justice Court, supra, 69 Cal.2d 832, 837, i.e., in whom has the Legislature vested the authority to determine whether an individual should receive the services of the public defender? There are two ways an indigent person under investigation or charged with a crime may obtain the services of the public defender: by applying directly to the public defender himself, and the other by appearing unrepresented at arraignment and receiving a court-ordered appointment of counsel. (Ingram v. Justice Court, supra, at p. 837.) "For half a century the office of public defender has been a creature of statute." (Id., at p. 836.) Ingram held the public defender is as administratively equipped as the courts to determine the preliminary question of indigency and the right to the services of his office. On similar logic, it is more appropriate for the statutory, *679 professional and ethical responsibilities of the public defender to be determined by him rather than relegating such authority to law enforcement or correction officials having temporary or long-term custody of the person in need of the public defender's assistance. The authority of the public defender to assist a person charged with a crime who has requested assistance rather than wait for his first court appearance is implicit in the command of subdivision (a) of section 27706 that "Upon request of the defendant" the public defender shall represent any indigent accused "at all stages of the proceedings, ..." The period prior to arraignment must be deemed such a "stage," as recent decisions have recognized it is a period in which the right to counsel is often of critical importance. (See, e.g., Escobedo v. Illinois, supra, 378 U.S. 478; Miranda v. Arizona, supra, 384 U.S. 436; United States v. Wade, supra, 388 U.S. 218; Gilbert v. California (1967) 388 U.S. 263 [18 L.Ed.2d 1178, 87 S.Ct. 1951].)
Subdivision (g) of section 27706 was added in 1975 to provide: "[U]pon the request of the person involved, he may represent any person who is not financially able to employ counsel in a proceeding of any nature relating to the nature or conditions of detention, of other restrictions prior to adjudication, of treatment, or of punishment resulting from criminal or juvenile proceedings." The Legislature clearly intended to expand the circumstances under which the public defender could provide services beyond defense after a charge or formal accusation is made.
In refusing to allow the public defender to see prisoners who have come directly to the public defender for assistance through correspondence or by the assistance of third persons authorized to communicate such request on behalf of the inmate, the officials of California Mens Colony have conferred upon the district attorney greater discretion and judgment than the public defender. "In this respect, the public defender is endowed with no less discretion and independence in the performance of his duties than is the district attorney." (Ingram v. Justice Court, supra, 69 Cal.2d at p. 841.) (13) Neither the local district attorney nor the Department of Corrections has authority to oversee the independent statutory function of the public defender's office.

THE PUBLIC DEFENDER PROPERLY EXERCISED HIS STATUTORY AUTHORITY BY MAKING THE SERVICES OF HIS OFFICE AVAILABLE TO INDIGENT PERSONS IN CUSTODY OR DETENTION WHO REQUEST CONSULTATION.
Finally, we consider whether a different conclusion must be reached where petitioner has not applied to the public defender for a "defense" to *680 a pending charge, but rather for assistance when he is the subject of investigation or interrogation. Appellant contends the order authorizing the public defender to meet and confer with any person under the "control" of a law enforcement agency when such person is "under investigation in any criminal matter" enables the public defender to confer with a person who is merely being detained in a criminal investigation, even though such investigation may not have "focused" on such person who then has no constitutional right to counsel. It is further argued that the right to counsel should not be "construed in a manner that would hamper legitimate police investigation when no substantial right of the accused is involved." (People v. Dorado, supra, 62 Cal.2d at p. 348; see also People v. Lopez (1963) 60 Cal.2d 223, 243 [32 Cal. Rptr. 424, 384 P.2d 16]; People v. Duck Wong (1976) 18 Cal.3d 178, 187 [133 Cal. Rptr. 511, 555 P.2d 297].) In summary, appellant asserts the order confers authority which exceeds the statutory duties of the public defender by providing petitioners and others in detention or custody with legal representation not statutorily or constitutionally authorized or mandated.
(14) The right to counsel is a fundamental constitutional right which is carefully guarded by the courts. (People v. Douglas (1964) 61 Cal.2d 430, 434 [38 Cal. Rptr. 884, 392 P.2d 964]; In re James (1952) 38 Cal.2d 302, 310 [240 P.2d 596].) (15) Under Escobedo and Dorado, the accusatory stage or that stage when the suspect is entitled to counsel has been reached when the investigation has begun to focus on the suspect, he is in custody and the police have undertaken a process of interrogation that lends itself to eliciting incriminating statements. (People v. Morse (1969) 70 Cal.2d 711, 722 [76 Cal. Rptr. 391, 452 P.2d 607].)
We agree with appellant that the trial court's ruling is in error in conferring upon the public defender rather than the individual the determination of whether the right to counsel should be exercised. Our Supreme Court has held in People v. Duck Wong, supra, 18 Cal.3d at page 187, that after advice of and waiver of right to counsel a suspect may be questioned "in the investigatory stage ... before the institution of any criminal charge," and that no "reasons of policy, required the presence of defendant's counsel during the interview." (Ibid.) "Following the commission of a possible crime, it is essential that the police not be unduly hampered in their investigation." (Ibid.; see also People v. Dorado, supra, 62 Cal.2d at p. 348.) The court rejected the proposed extension of the right to counsel so that "interrogation of suspects could be delayed indefinitely while the officers attempted to locate the suspect's counsel, *681 notify him of the proposed interview, and either obtain his consent thereto or permit his participation therein." (People v. Duck Wong, supra, 18 Cal.3d at p. 187.)
The right to counsel commences "at or after the time that adversary judicial proceedings have been initiated against [defendant]"  whether by way of formal charge, preliminary hearing, indictment, information or arraignment. (Kirby v. Illinois (1972) 406 U.S. 682, 688 [32 L.Ed.2d 411, 416-417, 92 S.Ct. 1877].) "First, the Court in retrospect perceived that the `prime purpose' of Escobedo was not to vindicate the constitutional right to counsel as such, but like Miranda `to guarantee full effectuation of the privilege against self-incrimination....' (Johnson v. New Jersey, 384 U.S. 719, 729. Secondly, and perhaps even more important for purely practical purposes, the Court has limited the holding of Escobedo to its own facts...." (Kirby v. Illinois, supra, 406 U.S. at p. 689 [32 L.Ed.2d at p. 417].)
(16) In determining whether to provide the services of his office, the public defender "exercises an original power vested in him by statute, not superior to but coequal with the power of the court" to determine whether a person is entitled to be represented by the public defender. (Ingram v. Justice Court, supra, 69 Cal.2d at p. 841.) The "Upon request" condition of section 27706, subdivision (a), is an important alternative circumstance to formal court appointment to entitle a person to representation by the public defender and cannot be read out of the statute as is the effect of the trial court's order. (Ingram, supra, at p. 839.) Since the court cannot challenge the public defender's decision that a person is entitled to be represented by him, the district attorney, prison officials and law enforcement agencies on similar logic do not possess the discretion conferred independently by statute upon the public defender to determine who should receive his services. Moreover, police or correctional officials are not by law the arbiters of the conduct of the public defender.
Appellant has chosen the wrong procedure and an inappropriate forum to examine the public defender's compliance with his statutory, legal and ethical responsibilities. As the court said in Ingram v. Justice Court, supra, 69 Cal.2d at page 842: "The overwhelming majority of public defender offices in this state are appointive, and Government Code section 27703 declares that in such event the public defender `shall be appointed by the board of supervisors to serve at its will.' [Original emphasis.] If a holder of that office abuses his powers by consistently undertaking to represent at *682 county expense persons who are not in fact indigent [entitled to his services], the board of supervisors may take such remedial steps as are deemed necessary, including his reprimand, suspension or discharge, or the institution of appropriate court action." (Fn. omitted.) The Legislature has recognized "... `If abuses develop in individual cities or counties of the state, it appears to us that the proper avenue of appeal is to the judicial council or the county board of supervisors.'" (Ibid.)[10] Business and Professions Code section 6152, subdivision (d), referring to unlawful solicitation of business by attorneys was amended in 1976 to provide: "Nothing in this section shall be construed to mean that a public defender ... may not make known his or her services as a criminal defense attorney to persons unable to afford legal counsel whether such persons are in custody or otherwise." This constitutes a declaration of legislative intent that the public defender may make his services known with the concomitant limitation that the decision to consult with the public defender remains with the individual. We need not reach a consideration of the Rules of Professional Conduct rules 2-101 and 2-104(A) and (F) or American Bar Association canon 2 because Business and Professions Code section 6152, subdivision (d), specifically removes the public defender from the restraints on solicitation.
The foregoing review of the administrative and procedural safeguards demonstrates that it is not for law enforcement in a station house confrontation or corrections at the prison gate to exceed their responsibilities by seeking to determine whether the public defender is complying with his statutory duties. Upon the arrival of the public defender, the individual inmate or person being detained or in custody should be advised of his presence. Then it is the personal decision of the individual whether he wishes to talk with counsel, not that of the public defender to confer with him in the absence of such request. Such a balancing of interests would enable the public defender to perform his duty to be available to indigent persons who may be in need of his services while maintaining the individual's right to decide whether to consult with, waive counsel, or to initiate a request to consult with the public defender. This balancing of rights and interests will not interfere with police investigation unless some substantial and now very well-established right of the accused becomes involved, i.e., a request to consult with or have counsel present before or during interrogation.
*683 The stay of enforcement of the order is dissolved. The order granting writ of habeas corpus is affirmed insofar as it grants the relief prayed for by petitioners. It is reversed in all other respects.
Franson, Acting P.J., and Hopper, J., concurred.
A petition for a rehearing was denied May 4, 1979, and the opinion was modified to read as printed above.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
[1]  The formal order reads:

"The above-entitled matter came on regularly for hearing on June 14, 1978, before the Hon. Richard C. Kirkpatrick, Judge presiding. Present in Court were Petitioner, Richard A. Carsel, Public Defender, Deputy Public Defenders Patricia Nemec Ashbaugh and Lee Whipple, all of whom appeared on behalf of Thomas Brindle, Dennis Hall, Todd Young, Richard Mroczko and Joseph Seide, each of whom were also present in Court. D.J. McCarthy, Superintendent of the California Mens Colony, San Luis Obispo, California, was not present in Court but was represented by the office of Robert N. Tait, District Attorney, appearing by Daniel A. Hilford, Deputy District Attorney.
"The Court, having heard the argument of counsel and having read and considered all of the documents, records and papers on file herein, and the matter having been submitted by counsel, now makes the following rulings:
"IT IS HEREBY ORDERED that the Petition for Writ of Habeas Corpus on file herein is hereby granted.
"IT IS FURTHER ORDERED that all law enforcement agencies and correctional institutions located within the geographical confines of San Luis Obispo County, State of California, and all employees, officers, agents, deputies and staff of said agencies and institutions, and all persons acting in concert with them or under the direction and control of said agencies and institutions shall henceforth allow the Public Defender of San Luis Obispo County, his deputies or authorized representatives, upon request, access to meet and confer with any person or persons in their care, custody or control, when such person or persons are incarcerated or under interrogation or under investigation in any criminal matter and, further, that said Public Defender, his deputies or authorized representatives, shall be permitted to personally consult with said persons in order to make his services known, and to determine if said persons desire those services, and to determine whether said persons are eligible for the services of the Public Defender.
"IT IS FURTHER ORDERED that no law enforcement agency or correctional institution located within the geographical confines of San Luis Obispo County, State of California, nor any employee, officer, agent, deputy, or staff member of said agencies and institutions, nor any persons acting in concert with them or under the direction and control of said agencies and institutions, shall deny or attempt to deny the above-described access to the Public Defender or his deputies or authorized representatives to any of the persons above-described upon the grounds that said person has not requested the services of counsel, or that said person has waived their [sic] rights to counsel or that the Public Defender has not been appointed to represent said person by a court of competent jurisdiction.
"IT IS FURTHER ORDERED that the Public Defender of San Luis Obispo County shall forthwith serve a certified copy of this Order upon the offices of the District Attorney of San Luis Obispo County, the Probation Officer of San Luis Obispo County, the Sheriff of San Luis Obispo County, the Superintendent of the California Mens Colony (San Luis Obispo), the Arroyo Grande Police Department, the Morro Bay Police Department, the Paso Robles Police Department, the Pismo Beach Police Department and the San Luis Obispo Police Department, and shall thereafter provide proof of service of same with this Court in the manner provided by law. The purpose of this paragraph is to place the above-named agencies and institutions on actual notice as to the contents of this Order. The omission of any other law enforcement agency or correctional institution from this paragraph shall not operate to exclude an omitted entity from the provisions of this Order."
[2]  "3175. Attorney Visitation and Consultation. Inmates have a basic right of access to an attorney. It is the policy of this department to facilitate both correspondence and personal consultation for this purpose.

"(a) Attorney visitation for the purpose of a private consultation with an inmate will be permitted during the institution's regularly scheduled visiting days and hours. Where regular visiting is scheduled on weekdays and weekends, attorney visits should be scheduled on the weekdays so as not to detract from the available resources needed for the greater volume of weekend visits by friends and relatives.
"(b) When an attorney, or a person authorized to act for an attorney, does not desire or require private consultation accommodations, the attorney or representative may visit an inmate on any scheduled visiting day without a prior appointment or notice to the institution. Such unannounced visits will be subject to the same requirements, accommodations, and services as nonattorney visits.
"(c) When private consultation accommodations are desired, the attorney or the attorney's representative should contact the institution by a letter or telephone call sufficiently in advance of the desired date and time to permit scheduling of available staff and facilities for that purpose. When a prior appointment is made, the institution will have the inmate available for interview at the scheduled time. One week advance notice is desired, with 24 hour advance notice as the minimum required for such service. In an emergency, appointment requests may be cleared through the warden, superintendent or regional administrator.
"(d) In order for an attorney to visit an inmate for the purpose of a private consultation, the attorney need only provide proof of identity, registry with a state bar association, and the written consent of the inmate, in addition to the requested appointment or notice spoken to [sic] in subsection (c). Wardens, superintendents and regional administrators are authorized to require proof that an inmate has designated the attorney as his or her `attorney of record' or that a court has made such appointment when there is reason to believe the attorney is not acting in that capacity or is otherwise abusing the privilege of private consultation with the inmate."
[3]  All references are to Government Code unless otherwise noted.
[4]  Although the record is not clear as to specifics, it is possible that when the public defender met with some or all of these respondents they signed cards requesting representation. Such fact is not presently before the court because it was not set forth in the supporting declarations. If so, subsequent denial of counsel's request to confer with them would require the same analysis.
[5]  The extent of the recurring problem is gained from argument but is without evidentiary support in the declarations except as it relates to the named petitioners. No testimony was offered on behalf of any party.
[6]  Respondents argue that the language of the order as to persons who have waived counsel is required because otherwise "every person who initially waived his rights at the stationhouse would not be entitled to court appointed attorney for any further stages in the proceeding." Such an argument ignores the rule that a defendant may revoke his waiver and indicate "in any manner and at any stage of the process" that he wishes to invoke his rights. (Miranda v. Arizona, supra, 384 U.S. at pp. 444-445 [16 L.Ed.2d at p. 707].)
[7]  The petition was served upon the district attorney's office at 11:35 a.m. and on D.J. McCarthy, Superintendent of the California Mens Colony, at 1:15 p.m. on June 13, 1978. The writ was returnable June 14, 1978, at 1:30 p.m. Section 12511 provides: "The Attorney General has charge, as attorney, of all legal matters in which the State is interested, ..." Penal Code section 1477 states: "The writ must be directed to the person having custody of or restraining the person on whose behalf the application is made, ..." It must be served upon such person. (Pen. Code, § 1478.)
[8]  See footnote 1.
[9]  The American Bar Association standard 5.1 states: "Counsel should be provided to the accused as soon as feasible after he is taken into custody, when he appears before a committing magistrate, or when he is formally charged, whichever occurs earliest. The authorities should have the responsibility to notify the defender or the official responsible for assigning counsel whenever a person is in custody and he requests counsel or he is without counsel."

Standard 5.1(b) notes: "Since it is a positive goal of society to see that the accused is provided with counsel at the earliest feasible opportunity, implementation should not be limited to providing a means for the accused himself to contact a lawyer. Of course, this opportunity should be afforded, and, to make it meaningful for the person without sufficient means, he should be enabled, without personal expense, to reach by telephone the defender or the responsible officer of the assigned counsel system.... This is sufficient reason to place the responsibility on the authorities to take the initiative in notifying those responsible for providing legal representation that the accused is in custody and is without counsel." (ABA Project on Standards for Crim. Justice, Providing Defense Services (Approved Draft 1968) pp. 43-46.)
The Uniform Law Commissioners' Model Defense of Needy Persons Act, section 2, subdivision (b)(1), provides a needy person being detained by a law enforcement officer is entitled "to be counseled and defended at all stages of the matter beginning with the earliest time when a person providing his own counsel would be entitled to be represented by an attorney...." Section 3, subdivision (a), specifies that "the law enforcement officers concerned, upon commencement of detention, ... shall: (1) clearly inform him of the right of a needy person to be represented by an attorney at public expense: and (2) if the person detained or charged does not have an attorney, notify the public defender, non-profit organization, or trial court concerned, as the case may be, that he is not so represented." (Id. Appen. E. p. 79.)
[10]  In counties in which the public defender is elected rather than appointed the boards of supervisors retain certain budgetary control and the incumbent of that office must stand for reelection every four years (§ 27704) and in the meanwhile is subject to recall (Elec. Code. § 27210; see Ingram v. Justice Court, supra, 69 Cal.2d at p. 842, fn. 6).
