
256 N.W.2d 717 (1977)
In the Matter of the Application for a Writ of Habeas Corpus for Ronald KOZAK.
No. 12204.
Supreme Court of South Dakota.
July 27, 1977.
*719 Brent A. Wilbur, Asst. Atty. Gen., Pierre, for respondent State of South Dakota; William J. Janklow, Atty. Gen., Pierre, on the brief.
*720 Charles A. Wolsky, Vermillion, for appellant Ronald Kozak.
Stephen L. Pevar, Denver, Colo., John H. Davidson, Jr., Vermillion, for amicus curiae American Civil Liberties Union.
ZASTROW, Justice.
This is an appeal from the order of the circuit court quashing its writ of habeas corpus. Because of the nature of the issues, we have expedited this appeal.
The petitioner, Ronald Kozak, and two companions were arrested in Vermillion, South Dakota, on December 9, 1976. On December 10, 1976, he was arraigned on a preliminary complaint charging him with attempted grand larceny, grand larceny and third degree burglary. Bail was set at $15,000 because petitioner was a Canadian citizen with a record of prior felony convictions. Unable to post bond, the petitioner remained incarcerated in the Clay County jail. He was subsequently indicted by the Clay County grand jury for the same offenses.
At the arraignment on December 10, 1976, R. James Krueger was appointed to represent one of the codefendants. Krueger was advised that petitioner would attempt to retain Sioux Falls attorney Dennis McFarland to represent all of the defendants. To secure funds for that purpose, the petitioner first called a friend in Chicago, using the jail extension phone. Entering the sheriff's office later that day, Krueger observed the sheriff and two city police officers listening to a tape recording of petitioner's telephone call. That recording was apparently erased by the sheriff or his deputy.
Aware of petitioner's intention to call attorney McFarland, Krueger advised McFarland of what he had seen and heard. When McFarland telephoned the petitioner, he advised Kozak:
"* * * I've been having some conversations with some other people, and now let me tell you first before we get into this thing at all, the phone in the jail is bugged, so you're speaking to a cast of thousands right now."
This telephone conversation was recorded by the sheriff and has been preserved. As a result of that conversation, McFarland came to Vermillion to consult with the petitioner. Because of his inability to secure funds, Kozak subsequently applied for court-appointed counsel. The court appointed petitioner's present counsel Charles Wolsky on December 13, 1976.
Petitioner's present counsel, aware of the possible telephone tap line, has not communicated by telephone with petitioner. However, the petitioner was apparently allowed ready access to the extension phone and he received several calls from various friends and associates. On December 17, 1976, David Wiener, a Chicago attorney, contacted the petitioner by telephone at the request of petitioner's friends. According to the affidavit of Wiener and the stipulation of the parties, Wiener was apprised by Kozak of the possibility of the wiretap. Although petitioner and Wiener had several telephone conversations, a recording of only one conversation was preserved. That conversation shows only a discussion of obtaining bail and hiring a South Dakota attorney.
On December 20, 1976, the petitioner filed a motion for the production of all conversations recorded by the sheriff. A hearing on that motion and a motion to dismiss was held on December 27, 1976. At the hearing, the sheriff testified that he had been taping the telephone conversations of inmates of the Clay County jail since he became sheriff in 1962. He further testified that this was done only when the inmate was considered to be a "security risk" and that he would not knowingly intercept calls between an inmate and his attorney. The sheriff testified that he had consulted with the state's attorney shortly after Kozak's arrest and had been advised that telephone calls from the jails could be monitored so long as they did not involve the attorney of the petitioner.
The sheriff admitted that he and his deputy taped at least fifteen of the telephone calls received by the petitioner. His reasons *721 for taping Kozak's calls were: "[T]hese people are using fictitious names and we found out what their real names was and that they are involved in drugs and other crimes. And, also, there was a feeling that they were in the Organization. And we had one guy running around loose that we didn't catch."
The sheriff then produced the only two remaining tapes, which contained the McFarland call, one of Wiener's calls, and four calls from petitioner's friends in Chicago. Transcripts of the preserved tapes were prepared and were introduced in the habeas corpus proceedings. The balance of the taped conversations had been listened to by the sheriff and/or his deputy, and were then erased. The sheriff was unable to testify as to the parties to or nature of those conversations.
The state's attorney denied that he had ever discussed the petitioner with the sheriff, but admitted that he had advised the sheriff several years before that telephone conversations of jail inmates could be monitored and recorded for security purposes but that attorney-client calls should not be taped.[1] He admitted that the city police officers had relayed to him a portion of the conversation between Kozak and his girl friend but denied receiving any information from the taped attorney-client communications. The motion to produce tapes was granted, but the trial court denied the motion to dismiss on the ground that the petitioner had failed to show any prejudice to his case.
The petitioner did not seek an intermediate appeal but instead sought a writ of habeas corpus by original proceedings in this court. That relief was denied under this court's policy of refusing original jurisdiction where similar relief may be obtained before a circuit court which possesses the facilities to hear evidence and make findings of fact and conclusions of law. This court's order denying the application for a writ of habeas corpus was entered without prejudice to any subsequent application to the circuit court.
The petitioner immediately filed a petition for a writ of habeas corpus in circuit court. Oral testimony was presented to the trial court on February 24, 1977 and March 25, 1977. Affidavits of McFarland and Wiener and transcripts of the taped conversations were introduced by stipulation of the parties. Because the sheriff and his deputy invoked the Fifth Amendment, a transcript of the sheriff's testimony of December 27, 1976, was introduced to prove the substance of the calls. There is no evidence of the participation of the deputy available, for he did not testify at the prior hearing on the motion to dismiss.
Initially, the state questions whether habeas corpus proceedings are proper under the allegations in the petition. SDCL 21-27-16 provides:
"If it appears on the return of a writ of habeas corpus that the applicant is in custody by virtue of process from any court legally constituted, he can be discharged only for one or more of the following causes:
* * * * * *
(2) Where, though the original imprisonment was lawful, yet by some act, omission, or event, which has subsequently taken place, the party has become entitled to his discharge * *."
However, this court has previously held that habeas corpus is not available before trial in the absence of exceptional circumstances. State ex rel. Poach v. Sly, 63 S.D. 162, 257 N.W. 113; Application of Painter, 1970, 85 S.D. 156, 179 N.W.2d 12.
The petitioner alleges that he is entitled to a dismissal of the charges and discharge from custody for a violation of his right to counsel under the Sixth Amendment of the United States Constitution and Art. VI, § 7 *722 of the South Dakota Constitution. Although the question of dismissal for such violations has not been previously decided by this court, the United States Supreme Court in Hoffa v. United States, 1966, 385 U.S. 293, 87 S.Ct. 408, 17 L.Ed.2d 374, though not finding it warranted in that case, recognized that:
"It is possible to imagine a case in which the prosecution might so pervasively insinuate itself into the councils of the defense as to make a new trial on the same charges impermissible under the Sixth Amendment." 385 U.S. at 308, 87 S.Ct. at 416, 17 L.Ed.2d at 385.
The factual circumstances in two cases have been held to require dismissal of charges because of the surreptitious interception of attorney-client communications by government agents. See State v. Cory, 1963, 62 Wash.2d 371, 382 P.2d 1019, 5 A.L. R.3d 1352; United States v. Orman, 1976, D.C.Colo., 417 F.Supp. 1126. Inasmuch as an absolute dismissal may result from the violation of petitioner's Sixth Amendment and Art. VI, § 7, South Dakota Constitution right to counsel, the circuit court properly issued the writ of habeas corpus under SDCL 21-27-5 and conducted a hearing as provided by SDCL 21-27-14. The facts as alleged in the petition presented to the circuit court exceptional circumstances of a violation of the petitioner's constitutional rights which, if substantiated, could entitle the petitioner to a dismissal and discharge from custody. Application of Painter, supra; State ex rel. Poach v. Sly, supra.
The petitioner contends that the state has so "pervasively insinuated" itself into petitioner's attorney-client communications so as to require a dismissal of the charges and his discharge from custody. The claim of such a constitutional violation is of serious concern, for the very essence of the Sixth Amendment right to effective assistance of counsel is the privacy of communication with counsel. Glasser v. United States, 1942, 315 U.S. 60, 62 S.Ct. 457, 86 L.Ed. 680; Weatherford v. Bursey, 1977, ___ U.S. ___, 97 S.Ct. 837, 51 L.Ed.2d 30; United States v. Rosner, 1973, 2 Cir., 485 F.2d 1213.
The latest pronouncement by the United States Supreme Court on the topic of government intrusion into attorney-client communications is Weatherford v. Bursey, supra. The Supreme Court attempts to reconcile the rather diverse holdings of the lower courts on the topic. Weatherford quite clearly establishes a distinction between cases involving the use of informants to intrude on the attorney-client privileged communications and the use of electronic eavesdropping.
The court states:
"Respondent argues that Hoffa (supra) established the same right to counsel standard for government interception of attorney-client communications by an undercover agent as for interception by electronic surveillance. Even apart from the fact that the Court was merely assuming the existence of a right to counsel violation in that case * * * we find respondent's (the government agent) argument questionable. One threat to the effective assistance of counsel posed by government interception of attorney-client communications lies in the inhibition of free exchanges between defendant and counsel because of the fear of being overheard. However, a fear that some third party may turn out to be a government agent will inhibit attorney-client communication to a lesser degree than the fear that the government is monitoring those communications through electronic eavesdropping, because the former intrusion may be avoided by excluding third parties from defense meetings or refraining from divulging defense strategy when third parties are present at those meetings. Of course, in some circumstances the ability to exclude third parties from defense meetings may not eliminate the chilling effect on attorney-client exchanges, but neither Hoffa nor any other decision of this Court supports respondent's theory that the chill is the same whether induced by electronic surveillance or by undercover agents." Footnote 4, ___ U.S. at ___, 97 S.Ct. at 843, 51 L.Ed.2d at 39.
*723 It is quite apparent that the use of electronic eavesdropping in attorney-client communications then will be the subject of future decisions and that the informant cases, though instructive, will not be controlling. It is equally apparent in Weatherford that the majority of the United States Supreme Court rejected the contention that electronic surveillance of attorney-client communications was per se prejudicial under Black v. United States, 1966, 385 U.S. 26, 87 S.Ct. 190, 17 L.Ed.2d 26, or O'Brien v. United States, 1967, 386 U.S. 345, 87 S.Ct. 1158, 18 L.Ed.2d 94, and will not automatically require a new trial. The Supreme Court ruled that "when conversations with counsel have been overheard, the constitutionality of the conviction depends on whether the overheard conversations have produced, directly or indirectly, any of the evidence offered at trial." The trial court must make a "`judicial determination'"[2] of the effect of the overheard conversations on the conviction, and if there was "`use of evidence that might otherwise be inadmissible'" the conviction should be reversed for a new trial. Weatherford v. Bursey, supra, 429 U.S. at 552, 97 S.Ct. at 842, 51 L.Ed.2d at 38.
Here, of course, the electronic surveillance of the attorney-client communications was discovered before any trial on the merits, and we must fashion a pretrial procedure to insure that the petitioner has not been and will not be denied due process and effective assistance of counsel. In essence, the position is similar to those cases where the defendant has been granted a new trial. Unfortunately, we are not cited nor have we discovered any appellate decisions concerning the pretrial procedure after a new trial has been granted. However, the procedure used to determine whether a new trial is required is instructive.
Upon a showing of probable interception of attorney-client communications by state agents, the court should require the prosecutor to take affirmative steps to determine the existence of such surveillance and certify his actions and findings to the court. See, e. g., United States v. Alter, 1973, 9 Cir., 482 F.2d 1016. If there has been surreptitious interception of the defendant's attorney-client communications, the trial court should grant broad discovery of the logs, summaries, reports, recordings and transcripts of the intercepted communications. United States v. Fannon, 1970, 7 Cir., 435 F.2d 364. If the governmental agency or agent refuses to disclose that information, the pending charges must be dismissed (unless the interception involves national security). Alderman v. United States, supra; United States v. Seale, 1972, 7 Cir., 461 F.2d 345.
A motion to suppress any evidence which has been obtained, either directly or indirectly, from the eavesdropping must be granted. Such evidence is inadmissible for several reasons: (1) if obtained by an illegal wiretap by government agents, it violates the Fourth Amendment and Art. VI, § 11 of the South Dakota Constitution as an illegal search and seizure, Katz v. United States, 389 U.S. 347, 88 S.Ct. 507, 19 L.Ed.2d 576; Berger v. New York, 388 U.S. 41, 87 S.Ct. 1873, 18 L.Ed.2d 1040, and United States v. Chavez, 416 U.S. 562, 94 S.Ct. 1849, 40 L.Ed.2d 380;[3] (2) since the interception does not comply with 18 U.S.C. Ch. 119 or SDCL, Chap. 23-13A, it is inadmissible under 18 U.S.C. § 2515 and SDCL 23-13A, United States v. Cafero, 3 Cir., 473 F.2d 489, and United States v. Giordano, *724 416 U.S. 505, 94 S.Ct. 1820, 40 L.Ed.2d 341; and, (3) because it involves attorney-client communications, it violates the Sixth Amendment and Art. VI, § 7, South Dakota Constitution.[4] It appears that the petitioner's motion to suppress has already been granted by the trial court in the criminal action.
The question now becomes whether or not the state here has so "pervasively insinuated" itself into the defense councils as to require dismissal. A companion question is, upon whom does the burden of proof fall, and to what degree. The petitioner urges that any interception of attorney-client communications is per se prejudicial on the authority of Caldwell v. United States, 92 U.S.App.D.C. 355, 205 F.2d 879; Coplan v. United States, 89 U.S.App.D.C. 103, 191 F.2d 749; Black v. United States, supra, and O'Brien v. United States, supra. The state contends that the petitioner must prove that the conduct of the sheriff was prejudicial to his case before dismissal can be granted. Because of the wilful violation of the petitioner's Sixth Amendment right to private attorney-client communications, we do not view his burden as being so great.
In light of Weatherford, it appears that the petitioner must show (1) a surreptitious electronic interception (2) by government agents (3) of attorney-client communications (4) involving defense plans and strategy or facts concerning the offense charged or under investigation. Proof of these facts is sufficient to raise a presumption of prejudice because the violation of the accused's constitutional right to private communications with his attorney "is too fundamental and absolute to allow courts to indulge in nice calculations as to the amount of prejudice arising from its denial." Glasser v. United States, supra.
The burden of persuasion then shifts to the state to prove that such interception was not prejudicial,[5] for "before a federal constitutional error can be held harmless, the court must be able to declare a belief that it was harmless beyond a reasonable doubt." Chapman v. California, 386 U.S. 18, 87 S.Ct. 824, 17 L.Ed.2d 705. See also United States v. Rosner, 2 Cir., 485 F.2d 1213, and United States v. Rispo, 1972, 3 Cir., 460 F.2d 965. The trial court then must be satisfied beyond a reasonable doubt that the suppression of the intercepted communications and any derivative evidence thereof will sufficiently prevent the exploitation of the information received by the government agents to obtain a conviction. State v. Cory, supra; State v. Grant, 9 Wash.App. 260, 511 P.2d 1013; State v. Baker, 78 Wash.2d 327, 474 P.2d 254. The fact that the information has not been divulged to the prosecutor does not prevent its exploitation, and dismissal may be required if the information intercepted may improperly be used by state witnesses. United States v. Orman, supra.
With these principles in mind, we review the evidence presented to the trial court. It is undisputed that there has been (1) a surreptitious interception (2) by government agents (the sheriff and his deputy) (3) of telephone communications between the petitioner and his attorneys. The problem arising in this instance is determining whether there is sufficient proof that those communications involved defense plans and strategy or facts concerning the charges pending or under investigation.
It appears from the testimony that the petitioner had but one telephone conversation with McFarland, which has been preserved *725 and transcribed.[6] In reviewing the transcript of that conversation, it appears that the McFarland call did not involve defense plans or strategy or facts concerning the charge pending or under investigation.
The attorney-client communications between the petitioner and Wiener are substantially more difficult to rule upon.[7] The tapes have been erased by the sheriff and his deputy, and the petitioner has been effectively foreclosed any discovery of most of the intercepted communications. If all of the tapes had been erased and the sheriff and his deputy refused to testify, the dismissal of the charges here would be in order.
However, here the state has been spared that dismissal by the candid admission of the petitioner and his attorneys that their suspicions of a wiretap caused them to forego any discussion of defense plans and strategy or the facts concerning the charges pending or under investigation. Had attorney Krueger not discovered the possible wiretapping of the sheriff at the outset, the results would most probably be different. The inability of the state to produce the recordings of intercepted attorney-client communications where the parties were not inhibited in their discussions may be particularly serious in future situations.
Although we affirm the trial court's order quashing the writ of habeas corpus, we cannot express strongly enough our condemnation of the practice of the sheriff and his deputy. We find nothing in the provisions of 18 U.S.C., Ch. 119 or SDCL, Chap. 23-13A which allows the surreptitious electronic interception of telephone *726 conversations by pretrial detainees without a court order. If the sheriff has reason to believe that a pretrial detainee presents a "security risk," he must present those facts to the circuit court and justify the tapping of the detainee's calls pursuant to the restrictions in SDCL 23-13A.
The petitioner alleges that the mere interception of his telephone calls has prejudiced his defense because he is "paranoid" of the law enforcement officials and is afraid to communicate with his present attorney. He also asserts in his appeal brief that the sheriff has retaliated against him by restricting consultation with his attorney to only those times when the sheriff is personally present at the jail.
We find nothing in the record which would substantiate his claim. If those allegations are true, the circumstances can and should be remedied by an order from the trial court. A pretrial detainee must be provided a reasonable opportunity to confer privately with his counsel for the preparation of his defense. See footnote 3.
Private attorney-client consultation with a pretrial detainee does not necessarily require the unlimited use of the jail telephones. However, when such attorney-client telephone consultation is necessary, such as upon arrest or custodial interrogation or before a lineup,[8] it must be unmonitored.
Likewise, petitioner contends that his efforts to raise bond have been effectively hampered by the prior monitoring of his telephone calls. Again, as a pretrial detainee, the petitioner is entitled to a reasonable opportunity to raise bond. However, at no time has he asked the trial court to require the sheriff to provide him with reasonable access to an unmonitored telephone; certainly, the petitioner's relief with the courts is not dismissal, unless and until it appears there is no other appropriate relief available.
The trial court's order quashing the writ of habeas corpus is affirmed.
All the Justices concur.
NOTES
[1]  Apparently on the authority of such cases as Haas v. United States, 1965, 8 Cir., 344 F.2d 56; United States v. Brown, 1973, 5 Cir., 484 F.2d 418; United States v. Morris, 1971, 8 Cir., 451 F.2d 969. We find nothing in those decisions which condones such practice but merely findings that in each case there was not a deprivation of counsel sufficient to warrant dismissal.
[2]  We assume that this hearing will take the form of the "taint hearing" described in Alderman v. United States, 394 U.S. 165, 89 S.Ct. 961, 22 L.Ed.2d 176.
[3]  The trial court's conclusion that the petitioner, a pretrial detainee, had no reasonable expectation of privacy is incorrect. A pretrial detainee loses only his right to freely come and go; his other constitutional rights are not to be infringed upon except as may be reasonably necessary to properly administer the detention facility. The monitoring of telephone calls of pretrial detainees, without a prior court sanction, cannot be justified. See, e. g., Jones v. Wittenberg, D.C.Ohio, 323 F.Supp. 93; Brenneman v. Madigan, 1972, D.C.Cal., 343 F.Supp. 128; Hamilton v. Love, 1971, D.C.Ark., 328 F.Supp. 1182; Rhem v. Malcolm, 1974, 2 Cir., 507 F.2d 333.
[4]  The trial court just be vigilant during the trial to insure that its suppression order is followed and that evidence is not introduced or sought to be introduced which is in any manner tainted by the illegal eavesdropping and the state establishes beyond a reasonable doubt that the challenged testimony was not the result of an exploitation of the surreptitious interception. Chapman v. California, 386 U.S. 18, 87 S.Ct. 824, 17 L.Ed.2d 705; see Annot., "Evidence `Fruit of the Poisonous Tree,'" 43 A.L.R.3d 385.
[5]  We do not feel that placing this burden on the state is unreasonable, for it can be avoided by the government recognition that it cannot tap the telephones of defendants without prior approval of the court under 18 U.S.C. § 2516 and SDCL 23-13A-5.
[6]  At the habeas corpus hearing, the petitioner testified as follows: "Q After you got to the Clay County Jail, did you make a telephone call to anyone? "A Yes. * * * The first call was made to Miss Barbara Speccia. * * * And there was a chap in the jail that showed me a piece of paper that there was a lawyer in Sioux Falls and I called Mr. McFarland. * * "Q Did you talk to Mr. McFarland on the telephone? "A Yes, sir. It was two conversations. (The reference being to one call to his girl friend and one to McFarland.) "Q Did he indicate to you that the telephones in the jail may be tapped? "A Yes. * * * "THE WITNESS: He told me that the Clay County telephone jail, (sic) he says, `You're talking to a cast of thousands,' he says, `so [watch] what you say.' * * * "Q On whose behalf did you talk to Mr. McFarland? "A I spoke on behalf of all three of us. We were arrested on the charge and we needed a lawyer and we needed to arrange bail and that's what I spoke to Mr. McFarland about. I told him there were three people from Canada, and I says, he says, what are the charges? I told him the charges and I said that I need a lawyer. "Q Were you able, or was he willing to discuss any merits of your case on the telephone? "A No. He was rather inhibited. And after he told me there was a cast of thousands listening, I was rather inhibited and I didn't say anything more. * * "Q Were you able to communicate with him on the telephone after that? "A No, sir. I did not phoneI had other people phone him, but I wouldn't phone him. * * *"
[7]  Wiener's affidavit contains the following: "Affiant states that he discussed (by telephone) the charges pending against the defendants with Ronald Kozak and legal defenses to the charges. Affiant also had several discussions with Ronald Kozak about raising bail money and legal defense money. Affiant states that he was advised that the telephone in the Clay County jail could be tapped, so he could not effectively talk to Ronald Kozak because of the fear of his communications being intercepted."

The petitioner testified regarding his communications with Wiener as follows: "Q All right. Now, then, after you didn't hear back from Mr. McFarland, did you talk to any other lawyers? "A * * * [I]n the second day or in the third day of our incarceration an attorney from Chicago stepped in and he was afforded funds for our defense. * * * "Q Who was this man? "A Mr. David Wiener. He's an attorney at law in Chicago. * * "Q Now, did Mr. Wiener call you on the telephone at the Clay County Jail? "A I had about fourthree or four calls from Mr. Wiener. "Q Now, did you tell Mr. Wiener you believed or indicate to him some way that the telephones were tapped at the Clay County Jail? "A Well, Mr. Wolsky, on the second or third call that I had at the Clay County Jail * * *. I ran over in my shorts for the phone. I think it was the dispatcher, Mr. Emerson, and all I heard was, you know, he made a statement that here he comes, are you ready. And I took the telephone and when I spoke to this attorney, I told him, I says, I'd rather not say too much and I need a lawyer and I need a lawyer bad here. * * * "Q Were you able to talk freely with Mr. Wiener about the facts of your case? "A No, sir. * * "Q Have I [Mr. Wolsky] called you on the telephone to discuss the case at all, Mr. Kozak? "A No, sir. No, sir."
[8]  The use of the jail telephone by a pretrial detainee on other occasions for attorney-client consultation may be restricted as necessary for the reasonable administration of the jail facilities. See generally, Annot., "Scope and Extent, and Remedy or Sanctions for Infringement, of Accused's Right to Communicate With His Attorney," 5 A.L.R.3d 1360.

See also, National Sheriffs' Association, Handbook on Inmates' Legal Rights (1974), §§ 5, 12 and 13; National Bar Association Jail Standards, Standards 10-(3) and 10-(5).
