This is an appeal by the Commonwealth from the dismissal with prejudice by a District Court judge of the defendants’ cases on the ground that the prosecutor had entered into plea negotiations directly with the pro se defendants without a written waiver of counsel form having been *604filed with the court as required by S.J.C. Rule 3:08, PF 8.2 We reverse.
The law is well settled that dismissal with prejudice is appropriate in cases of egregious prosecutorial misconduct or upon a showing of prejudice or substantial threat thereof. Commonwealth v. Hernandez, 421 Mass. 272, 277 (1995). Commonwealth v. Perrot, 38 Mass. App. Ct. 478, 481 (1995). There was no such showing in the present case. Here, the judge sitting in a pretrial session simply dismissed each case when it was called after he ascertained that the defendant had discussed his or her case with a prosecutor and no written waiver of counsel by the defendant had been filed. The judge made no findings that the defendants had not waived counsel3 or suffered any prejudice as a result of their discussions with the prosecutor. Absent any such findings, the sanction of dismissal with prejudice was not warranted. Commonwealth v. Hernandez, 421 Mass, at 278-279.
While a judge should zealously guard a defendant’s legal right to representation, the judge’s zeal in this case was misguided. The primary responsibility for insuring that a written waiver of counsel form has been executed and filed lies with the court. S.J.C. Rule 3:10, § 2, as appearing in 397 Mass. 1217 (1986). While rule 3:10, § 2, does not excuse the prosecutor’s responsibility in ascertaining that the waiver has been filed before talking to a defendant, reliance upon this rule could well account for the prosecutor’s conduct in this case. *605Needless to say, adherence to these rules will avoid the repetition of this sort of incident.
The judgments of dismissal are reversed, and the cases are to stand for further proceedings.
So ordered.
Supreme Judicial Court Rule 3:08, PF 8(a), as appearing in 382 Mass. 801 (1981), provides: “It is unprofessional conduct for a prosecutor to engage in plea discussions directly with an accused before the accused has a reasonable opportunity to obtain counsel, or to engage in such discussions with an accused who is represented by counsel except with that counsel’s approval. If the accused has elected to proceed without counsel and a form established by S.J.C. Rule 1:01 A or Mass. R. Crim. P. 8 has been duly filed, the prosecutor may properly discuss disposition of the charges directly with the accused. The prosecutor would be well advised, however, to request that a lawyer be designated by the court or some appropriate central agency, such as a legal aid or defender office or bar association, to be present at such discussions.”
The record indicates that five of the defendants had indicated their intention to represent themselves, and the prosecutor represented that the remaining two had also done so.