Opinion
SCOTLAND, P. J.This appeal presents the question whether a prosecutor can withdraw from a plea agreement before it is submitted to, and approved by, the trial court. At issue is an agreement that the prosecutor would move to dismiss this juvenile delinquency proceeding if the minor agreed to take a polygraph examination and passed it, and the minor further agreed to admit the charge as a misdemeanor if he failed the polygraph test. After the minor paid for and passed the test, the prosecutor refused to move for dismissal.
U.nder the circumstances of this case, we conclude that the prosecution could not renege on its plea agreement. As we shall explain, the need for public confidence in the integrity of the prosecutor’s office requires the prosecution to abide by its promise if the accused has relied detrimentally upon the agreement. Nevertheless, because a plea agreement requires judicial approval, the trial court is not bound by it.
Background
Kenneth H. (the minor) was charged in a delinquency petition (Welf. & Inst. Code, § 602) with inflicting cruelty upon an animal, a felony (Pen. Code, § 597, subd. (a)).
Prior to the date set for the contested jurisdiction hearing, the minor and his counsel entered into an agreement with Deputy District Attorney Leonard Goldkind: If the minor passed a polygraph examination administered by Department of Justice polygraph examiner Douglas Mansfield, the prosecution would move to dismiss the case; if the minor failed the examination, he would admit the charge as a misdemeanor.
After interviewing the minor, Mansfield concluded that the minor “was too small to test on the polygraph instrument” Mansfield had with him, and that the minor “had no early in life transgressions to establish control *146questions.” Accordingly, Mansfield did not perform a polygraph examination of the minor.
Goldkind then suggested the minor hire Sam Lister, a private polygraph examiner, to do the examination with the understanding that the prosecution would move to dismiss the case if the minor passed or he would admit the charge as a misdemeanor if he failed the examination.
Lister administered a polygraph examination and concluded that the minor answered truthfully in denying the allegations underlying the charge of cruelty to animals.
When he was told the minor “passed” the polygraph examination, Gold-kind advised the minor’s counsel that the delinquency petition would be dismissed “upon DOJ Examiner Mansfield reviewing the data.”
According to the minor’s counsel, Goldkind later decided “the matter could no longer be dismissed because the District Attorney’s Office had received various calls from the community concerned about the dismissal of this case.”
Goldkind informed the court that, when he suggested Lister perform the polygraph examination, Goldkind “was not aware that the inability of Mr. Mansfield to test the minor was based not only on his small size, but also on the absence of ‘early [in] life transgressions to establish control questions’ . . . .” Goldkind declared: “When Mr. Ramsey [the district attorney] became aware of the circumstances attendant on the polygraph and the offer and the discussions with respect thereto, he instructed me to proceed with the trial.”
The minor’s counsel then moved for specific enforcement of the agreement. Goldkind opposed the motion.
After conducting a hearing on the minor’s motion for specific enforcement of the agreement, the juvenile court denied the motion, stating: “There is no question but that there has been some miscommunication and some misunderstanding with the case. The purported plea bargain, as any other plea bargain, is subject to Court approval. We certainly never got to this point, but that’s not the basis for the Court’s ruling. I am going to have to deny the motion. [H] I admit [that the minor’s counsel,] [the minor] and his parents may have relied on what was recommended, but what we had was miscommunication that prevented a meeting of the minds. So Mr. Goldkind, I believe, was operating under a misapprehension as to what in fact transpired *147with respect to the meeting with the minor and Mr. Mansfield. So the Court feels that although we may have reliance, we never had an agreement. So let’s go ahead and proceed with it at this point in time.”
The delinquency petition was amended to charge the offense as a misdemeanor and, following a contested jurisdiction hearing, the court sustained the charge. The minor was placed on probation with, among other things, a drug search condition.
Discussion
On appeal, the minor contends (1) the juvenile court “erred in allowing the People to renege on the agreement regarding the dismissal of the case,” and (2) “the ‘search’ condition of probation was improperly imposed.”
The People concede “the record ... is devoid of any justification for the imposition of a search/drug testing condition” and further acknowledge: “[Ajppellant did not waive his right to appeal as to this issue. He did in fact object to the condition below and the court indicated a willingness to remove it. The failure to do so appears to have been an inadvertent oversight.”
As to the motion for specific enforcement of his agreement with Deputy District Attorney Goldkind, the minor contends it should have been granted because he relied upon the agreement to his detriment by giving up his Fifth Amendment right against self-incrimination and paying $350 for the polygraph examination.
The People disagree, arguing the agreement is unenforceable because it “was not actually a plea bargain” and had not been approved by the juvenile court. The People point out that, since the minor had not waived his constitutional rights, “there was no mutual benefit to give impetus to completing the agreement and no way for the district attorney or the court to enforce it against the minor had the minor failed the [polygraph] examination. . . . [A]s this agreement was not mutually enforceable, it should not be enforceable against the district attorney.” Asserting that the “only enforcement mechanism [was] the integrity of the parties,” and that “ ‘The Due Process Clause is not a code of ethics for prosecutors[,]’ ” the People conclude the juvenile court correctly declined to interfere with the prosecution’s decision to renege on the agreement.1
The minor has the better argument.
*148The question “whether a prosecutor can withdraw from a plea bargain before the bargain is submitted for court approval” recently was addressed in People v. Rhoden (1999) 75 Cal.App.4th 1346, 1351-1352 [89 Cal.Rptr.2d 819] (Rhoden).) Noting that the question “appears to be an issue of first impression in California courts,” Rhoden reviewed cases from other jurisdictions, as well as secondary authority (id. at pp. 1352-1355), and concluded “a prosecutor may withdraw from a plea bargain before a defendant pleads guilty or otherwise detrimentally relies on that bargain.” (Id. at p. 1354, italics added.) “ ‘Absent detrimental reliance on the bargain, the defendant has an adequate remedy by being restored to the position he occupied before he entered into the agreement.’ ” (Id. at p. 1356, quoting State v. Beckes (1980) 100 Wis.2d 1, 7 [300 N.W.2d 871, 874].)
We are persuaded that Rhoden correctly states the rule which should be applied in California. However, we also are mindful that a plea agreement will not resolve a case unless, and until, it is approved by the court. “It is well settled that a plea bargain is a tripartite agreement which requires the consent of the defendant, the People and the court.” (People v. Yu (1983) 143 Cal.App.3d 358, 371 [191 Cal.Rptr. 859]; Pen. Code, §§ 1192.3, 1192.4, 1192.5.) Therefore, although a prosecutor may be bound by a plea agreement once the accused relies detrimentally upon the agreement, the court is not bound to approve it. (Ibid.; Welf. & Inst. Code, § 782.)
The fact that the court is not bound by a plea agreement entered into by the prosecutor and the accused, and the fact that a plea agreement made by the parties before it is submitted for court approval is akin to an executory contract which does not bind the accused, do not undermine the principle that the prosecutor should be bound by the agreement if the accused has relied detrimentally upon it. The integrity of the office of the prosecutor is implicated because a “ ‘pledge of public faith’ ” occurs when the prosecution enters into an agreement with an accused. (Butler v. State (Fla.Dist.Ct.App. 1969) 228 So.2d 421, 424 [36 A.L.R.3d 1274].) A court’s subsequent approval or disapproval of the plea agreement does not detract from the prosecutorial obligation to uphold “our historical ideals of fair play and the very majesty of our government. . . .” (Id. at p. 425.) The “failure of the [prosecutor] to fulfill [his] promise . . . affects the fairness, integrity, *149and public reputation of judicial proceedings.” (U.S. v. Goldfaden (5th Cir. 1992) 959 F.2d 1324, 1328.)
Moreover, the People are in a poor position to complain about their inability to enforce the agreement against the minor; after all, the terms of the agreement were established by the prosecution.
Here, the minor relied upon the agreement by waiving his Fifth Amendment right to remain silent and by paying $350 to take the polygraph examination. The People believe this is insufficient to warrant enforcement of the agreement. They argue: “Although by submitting to a polygraph examination [the minor] may have given up his Fifth Amendment right to remain silent, his statements were not used for any purpose in adjudication or disposition. The only other detriment [the minor] suffered was financial— the $350 fee paid for the test. . . . [Attempting to recoup this kind of loss is better addressed in a civil action under principles of contract law. It does not involve a denial of due process or abridgment of liberty and cannot warrant dismissal of a juvenile petition charging criminal behavior.” We are unpersuaded.
“ ‘A defendant relies upon a [prosecutor’s] plea offer by taking some substantial step or accepting serious risk of an adverse result following acceptance of the plea offer. [Citation.] Detrimental reliance may be demonstrated where the defendant performed some part of the bargain. [Citation.]’ ” (Rhoden, supra, 75 Cal.App.4th at p. 1355, quoting Reed v. Becka (1999) 333 S.C. 676 [511 S.E.2d 396, 403].)
By paying for, and submitting to, the polygraph examination, the minor took a substantial step toward fulfilling his obligation under the agreement, and accepted a serious risk that he might suffer an adverse result, i.e., fail the examination, which he would not have been required to take but for the agreement.
Accordingly, we conclude that the prosecution should be bound by its agreement.
However, when a “section 602 petition is pending before the juvenile court, the juvenile court has the sole power to determine whether or not to dismiss the petition, and neither the district attorney, the minor’s counsel nor the probation officer can interfere with this exercise of judicial power.” (Raymond B. v. Superior Court (1980) 102 Cal.App.3d 372, 378-379 [162 Cal.Rptr. 506].)
Therefore, the most that the People can be required to do is to move for dismissal. While the juvenile court is not compelled to grant the motion, it *150may not refuse to do so for the reason previously stated by the court. (See fn. 1, ante.)
Disposition
The juvenile court’s order denying the minor’s motion to compel specific performance by the prosecution of its plea agreement with the minor is reversed, and the jurisdictional finding and dispositional order are vacated. The matter is remanded to the juvenile court with directions to reconsider the minor’s motion as a request by the district attorney to dismiss the case. If the court grants the motion, it shall dismiss the petition. (Welf. & Inst. Code, § 782.) If, after making a record adequate for review, the court denies the motion, it shall reinstate the jurisdictional finding and dispositional order, except that the court shall strike the drug search condition.
Raye, J., and Hull, J., concurred.
On April 25, 2000, the opinion was modified to read as printed above.
The People wisely do not attempt to defend the juvenile court’s rationale for denying the minor’s motion for specific performance, i.e., (1) Deputy District Attorney Goldkind “was operating under a misapprehension as to what in fact transpired with respect to the meeting *148with the minor and [polygraph examiner] Mansfield,” (2) consequently, there “was miscommunication that prevented a meeting of the minds,” and (3) “although we may have [had] reliance [by the minor], we never had an agreement."
Nothing in the record supports a conclusion that the agreement was entered into based upon a misunderstanding. The agreement was simple—if the minor submitted to, and passed, a polygraph examination administered by Lister, the People would move to dismiss the petition. The minor complied with his part of the agreement, but the prosecution reneged on its promise.