
    [No. S103761.
    May 29, 2003.]
    THE PEOPLE, Plaintiff and Respondent, v. RANDY LLOYD BUTTRAM, Defendant and Appellant.
    
      Counsel
    Amanda F. Doerrer, under appointment by the Supreme Court, for Defendant and Appellant.
    
      Bill Lockyer, Attorney General, David P. Druliner and Robert R. Anderson, Chief Assistant Attorneys General, Gary W. Schons, Assistant Attorney General, Laura Whitcomb Halgren, Robert M. Foster, Steven T. Oetting, Sabrina Y. Lane-Erwin and A. Natasha Cortina, Deputy Attorneys General, for Plaintiff and Respondent.
   Opinion

BAXTER, J.

We address a conflict in the Courts of Appeal about the proper application of Penal Code section 1237.5 and rule 31(d) of the California Rules of Court. These provisions allow an appeal from a judgment entered on a guilty plea only if (1) the defendant obtains a certificate of probable cause from the trial court or (2) the appeal falls within the two categories of grounds that do not require a certificate. One “noncertificate” category involves postplea claims, including sentencing issues, that do not attack the validity of the plea.

In People v. Panizzon (1996) 13 Cal.4th 68 [51 Cal.Rptr.2d 851, 913 P.2d 1061] (Panizzon), we held that one who agreed to a specific sentence in return for his plea must obtain a certificate of probable cause in order to claim on appeal that the agreed sentence constitutes cruel and unusual punishment. We explained that while such an appeal may appear to involve a sentencing issue arising after the plea, in substance it challenges the very bargain on which the plea was rendered, and thus the validity of the plea itself. Addressing an analogous principle, we confirmed in People v. Hester (2000) 22 Cal.4th 290 [92 Cal.Rptr.2d 641, 992 P.2d 569] (Hester) that “defendants are estopped from complaining of sentences to which they agreed.” (Id., at p. 295.)

Here, defendant pled guilty to felony drug charges, and admitted two prior serious or violent felonies, in return for an agreed maximum sentence, or “lid.” The agreement included no waiver of defendant’s right to appeal sentencing issues. At a contested sentencing hearing, the trial court denied defendant’s request for diversion to a drug treatment program, and it imposed the negotiated maximum. Without a certificate of probable cause, defendant appealed, urging that the trial court abused its sentencing discretion. In a published decision, the Court of Appeal majority dismissed the appeal for lack of a certificate. The majority concluded, under Hester and Panizzon, that by appealing the very sentence he agreed could be imposed, defendant effectively was attacking the plea’s validity.

The instant Court of Appeal majority declined to follow People v. Cole (2001) 88 Cal.App.4th 850 [106 Cal.Rptr.2d 174] (Cole), which reached a contrary result in similar circumstances. Another recent Court of Appeal decision, People v. Stewart (2001) 89 Cal.App.4th 1209 [107 Cal.Rptr.2d 830] (Stewart) purported to distinguish Cole, but essentially concluded, as did the Court of Appeal majority here, that a probable cause certificate is required to argue on appeal that the trial court abused its discretion by imposing a sentence within a negotiated maximum.

The issue is close, but on these particular facts, we find Cole’s reasoning and result more persuasive on the narrow issue presented here. Unless it specifies otherwise, a plea agreement providing for a maximum sentence inherently reserves the parties’ right to a sentencing proceeding in which (1) as occurred here, they may litigate the appropriate individualized sentence choice within the constraints of the bargain and the court’s lawful discretion, and (2) appellate challenges otherwise available against the court’s exercise of that discretion are retained. An appellate challenge to the exercise of the discretion reserved under the bargain is therefore a postplea sentencing matter extraneous to the plea agreement. Such a claim may rarely have merit, but it does not attack the validity of the plea. For that reason, a probable cause certificate is not required.

Accordingly, we will reverse the judgment of the Court of Appeal. We will also disapprove Stewart, supra, 89 Cal.App.4th 1209, to the extent that decision is inconsistent with the views expressed in this opinion.

Facts

An information charged defendant with two felonies, possession for sale of heroin (Health & Saf. Code, § 11351) and possession for sale of methamphetamine (id., § 11378). Under the “Three Strikes” law (§§ 667, subds. (d), (e)(2), 1170.12, subds. (b), (c)(2)), it was further alleged that defendant had suffered two prior violent or serious felony convictions. On June 1, 2000, defendant entered a plea of guilty to both counts and admitted the priors, with an indicated maximum term of six years. Neither the written change-of-plea form initialed and signed by defendant, nor any plea terms discussed in open court, specified that defendant was affirmatively waiving his right to appeal any sentencing issue that might otherwise properly arise within the negotiated maximum.*

On September 15, 2000, the court held a sentencing hearing. At the outset, the court stated it had before it the preplea sentencing report. The court indicated it had also received letters from Teen Challenge International (Teen Challenge), a drug treatment program in which defendant had begun participating while free on bail, and from Dorman Buttram, defendant’s father. Defense counsel then launched an extensive argument that the court had “options,” and that while it “could just maintain the six years as indicated,” it alternatively could and should consider exercising its discretion to dismiss both prior “strikes” and refer defendant, a 51-year-old lifelong drug abuser with a. 30-year record of offenses, to a drug treatment program such as Teen Challenge or the California Rehabilitation Center (CRC). Stressing his intent to protect the record, counsel suggested there was authority to the effect that “this could not be raised on appeal if counsel at sentencing did not raise the issue.”

At one point, counsel admitted there have always been limits on a CRC referral “because of length of period of custody,” and that CRC was “not as in vogue as in the past.” The court itself then interjected that questions had been raised about CRC’s effectiveness, and that there was doubt whether CRC would consider defendant suitable, because “[m]y understanding is [that] it’s more for the novice [offender]” than for one with a long criminal history facing a “multiple drug sales charge.” The court indicated it had not used CRC “for quite awhile.”

The prosecutor did not object that arguments for a drug treatment disposition violated the maximum-term provision of the plea agreement. Instead, before submitting the matter, she made a brief response on the merits. She noted indications in the preplea report that defendant’s drug addiction was well established and of long duration, that his prognosis was guarded, and that he required deeper and more structured treatment than Teen Challenge could provide. Moreover, the prosecutor argued, defendant’s extensive criminal history required a more punitive disposition.

In weighing its options, the court noted, in defendant’s favor, the remorse indicated by his guilty plea, the relatively small quantity of drugs involved in the current charges, defendant’s recent efforts at rehabilitation, and the age of his prior “strike” convictions. On the other hand, the court observed, the case “as filed” was a “third strike” matter with exposure to a maximum life sentence. In addition, the court emphasized, defendant had a more recent record of numerous theft and drug offenses, with their attendant affects on society, that were committed for the purpose of feeding his “voracious” multi-drug addiction. Defendant’s need for long-term treatment, the court opined, would exceed the limited duration of a residential program. The competing factors, said the court, thus weighed in favor of a state prison term, “though not a lengthy one.”

Accordingly, the court exercised its discretion to dismiss one of the prior “strikes,” and to impose concurrent three-year sentences on the two possession-for-sale convictions. These terms, doubled to reflect defendant’s sentencing status as a “two strike” offender, produced the indicated maximum sentence of six years. Judgment was entered accordingly.

The same day, defendant noticed an appeal. On the standard form notice, a box was checked indicating that the appeal followed a plea of guilty or nolo contendere. However, the notice neither included a probable cause certificate nor indicated a noncertificate ground for the appeal.

The superior court clerk prepared the record on appeal, and it was filed in the Court of Appeal. After the jurisdictional time for appeal had passed, defendant’s appellate counsel moved to amend the notice of appeal to comply with rule 31(d). The Court of Appeal granted the motion, and the notice was amended to include “sentencing” as a noncertificate ground of appeal. Defendant subsequently filed his brief on the merits, arguing that the sentencing court had abused its discretion, and had provided an inadequate statement of reasons, when it refused to initiate civil narcotic addict proceedings. The People’s responsive brief urged that no abuse of discretion had occurred.

At oral argument, the Court of Appeal, acting on its own motion, requested supplemental briefing on whether defendant required a certificate of probable cause to raise these sentencing issues. After receiving supplemental briefs, the Court of Appeal, in a two-to-one decision, dismissed the appeal for lack of a certificate. In essence, the majority ruled that when a defendant negotiates a maximum sentence in return for his plea, any sentence imposed within the maximum satisfies the bargain. Hence, the majority reasoned, an appellate challenge to the sentence imposed in such circumstances is an attack on the validity of the plea itself, and thus requires a certificate of probable cause. The majority rejected the contrary reasoning of Cole, supra, 88 Cal.App.4th 850.

The dissenting opinion embraced Cole. The dissent reasoned that when a plea agreement sets a maximum sentence, but reserves trial court discretion to determine whether the maximum should be imposed, a challenge to the exercise of the discretion reserved by the agreement does not seek to vitiate the plea, and thus requires no certificate.

We granted review. We now reverse the Court of Appeal’s judgment.

Discussion

Section 1237.5 provides in relevant part that “[n]o appeal shall be taken by the defendant from a judgment of conviction upon a plea of guilty or nolo contendere . . . except where both of the following are met: ft[] (a) The defendant has filed with the trial court a written statement, executed under oath or penalty of perjury showing reasonable constitutional, jurisdictional, or other grounds going to the legality of the proceedings, [f] (b) The trial court has executed and filed a certificate of probable cause for such appeal with the clerk of the court.”

Despite this broad language, we have held that two types of issues may be raised on appeal following a guilty or nolo plea without the need for a certificate: issues relating to the validity of a search and seizure, for which an appeal is provided under section 1538.5, subdivision (m), and issues regarding proceedings held subsequent to the plea for the purpose of determining the degree of the crime and the penalty to be imposed. (Panizzon, supra, 13 Cal.4th 68, 74-75; People v. Jones (1995) 10 Cal.4th 1102, 1106 [43 Cal.Rptr.2d 464, 898 P.2d 910], and cases cited.)

Rule 31(d) implements both the requirement of section 1237.5 and its exceptions. The first paragraph of rule 31(d) provides that within 60 days after the judgment entered on a guilty or nolo plea, the defendant shall file, as an intended notice of appeal, the statement of grounds required by subdivision (a) of section 1237.5, but that the appeal “shall not be operative” unless, within 20 days after the statement is filed, the trial court executes a certificate of probable cause. But the second paragraph of rule 31(d) provides that the statement and certificate required by section 1237.5 shall not be necessary if the appeal is “based solely upon grounds (1) occurring after entry of the plea which do not challenge its validity or (2) involving a search or seizure, the validity of which was contested pursuant to section 1538.5 . . . .” (Italics added.)

“The purpose for requiring a certificate of probable cause is to discourage and weed out frivolous or vexatious appeals challenging convictions following guilty and nolo contendere pleas. [Citations.] The objective is to promote judicial economy ‘by screening out wholly frivolous guilty [and nolo contendere] plea appeals before time and money is spent preparing the record and the briefs for consideration by the reviewing court.’ [Citations.]

“It has long been established that issues going to the validity of a plea require compliance with section 1237.5. [Citation.] Thus, for example, a certificate must be obtained when a defendant claims that a plea was induced by misrepresentations of a fundamental nature [citation] or that the plea was entered at a time when the defendant was mentally incompetent [citation]. Similarly, a certificate is required when a defendant claims that warnings regarding the effect of a guilty plea on the right to appeal were inadequate. [Citation.]” (Panizzon, supra, 13 Cal.4th 68, 75-76.)

“In determining whether section 1237.5 applies to a challenge of a sentence imposed after a plea of guilty or no contest, courts must look to the substance of the appeal: ‘the crucial issue is what the defendant is challenging, not the time or manner in which the challenge is made.’ {People v. Ribero (1971) 4 Cal.3d 55, 63 [92 Cal.Rptr. 692, 480 P.2d 308].) Hence, the critical inquiry is whether a challenge to the sentence is in substance a challenge to the validity of the plea, thus rendering the appeal subject to the requirements of section 1237.5. (People v. McNight (1985) 171 Cal.App.3d 620, 624 [217 Cal.Rptr. 393] [(McNight)].)” (Panizzon, supra, 13 Cal.4th 68, 76.)

In Panizzon, a defendant pled no contest to multiple serious felonies in return for a specified sentence of life with the possibility of parole, plus 12 years. He received that exact sentence, but then sought to appeal without obtaining a certifícate of probable cause, on grounds that the negotiated sentence constituted cruel and unusual punishment. We concluded a certificate was necessary. As we explained, “[although defendant purports not to contest the validity of the negotiated plea,” but rather a sentence imposed after the plea, “he is in fact challenging the very sentence to which he agreed as part of the plea. Since the challenge attacks an integral part of the plea, it is, in substance, a challenge to the validity of the plea, which requires compliance with . . . section 1237.5 and rule 31(d).” (Panizzon, supra, 13 Cal.4th 68, 73.)

Panizzon relied heavily on the reasoning of McNight, supra, 171 Cal.App.3d 620. There, in return for the defendant’s plea, the prosecutor agreed to recommend a specified sentence of 21 years. After the trial court imposed the recommended sentence, defendant appealed. He urged that his counsel should have raised, and the trial court should have considered, mitigating circumstances favoring a more lenient sentence. The Court of Appeal ruled that this claim required a certificate of probable cause. As the court indicated, “appellant received exactly the sentence promised in the agreement. His contention that consideration of mitigating circumstances should have resulted in imposition of a sentence less than the agreed-upon 21 years goes to the heart of the plea agreement itself.” (Id., at p. 624.) Hence, in substance, it was an attack on the validity of the plea, for which a certificate was required.

In Hester, supra, 22 Cal.4th 290, a case decided after Panizzon, we addressed the analogous question of sentencing issues waived on appeal by a plea bargain. There the defendant pled no contest to charges of burglary, felony assault with a deadly weapon enhancement, misdemeanor battery, and misdemeanor vandalism, all arising from a single attack by the defendant upon his former girlfriend. He entered a similar plea to a charge that he later attempted to dissuade the victim and her new boyfriend from testifying. In return, the defendant agreed to a four-year prison term. In accordance with the agreement, the court imposed a four-year sentence for the burglary count, concurrent three-year terms for the assault and dissuading counts, and concurrent jail terms for the misdemeanors.

The defendant appealed, urging the trial court erred by failing to stay the assault sentence pursuant to section 654’s prohibition of double punishment for a single criminal act or omission. As the defendant conceded, rule 412(b) specifically provided that by agreeing, personally and by counsel, to a specified sentence, a defendant who received that sentence or a shorter one abandoned any claim that any component of the sentence violated section 654. The defendant argued, however, that rule 412(b) was invalid because it conflicted with section 654.

A majority of this court concluded that rule 412(b) applied to the defendant’s case, and was not invalid. As we explained, rule 412(b) simply codified one application of a principle long recognized by California cases, i.e., that while unauthorized sentences may generally be challenged on appeal even if there were no objections below, “[wjhere the defendants have pleaded guilty in return for a specified sentence, appellate courts will not find error even though the trial court acted in excess of jurisdiction in reaching that figure, so long as the trial court did not lack fundamental jurisdiction. The rationale behind this policy is that defendants who have received the benefit of their bargain should not be allowed to trifle with the courts by attempting to better the bargain through the appellate process. [Citations.]” (Hester, supra, 22 Cal.4th 290, 295.) In other words, Hester indicated, rule 412(b) merely applied the long-standing rule that “defendants are estopped from complaining of sentences to which they agreed.” (Hester, supra, at p. 295.)

On the other hand, we have made clear that where the terms of the plea agreement leave issues open for resolution by litigation, appellate claims arising within the scope of that litigation do not attack the validity of the plea, and thus do not require a certificate of probable cause. In People v. Ward (1967) 66 Cal.2d 571 [58 Cal.Rptr. 313, 426 P.2d 881] (Ward), the defendant pled guilty to murder. Neither the degree of the offense nor the punishment was specified, and the plea agreement included provisions for how court proceedings on those reserved issues would be conducted. Ultimately, the court found the murder to be of the first degree and imposed a life sentence.

The defendant noticed an appeal, apparently seeking to raise errors in these trial court proceedings, but he filed no timely probable cause certificate. On that basis, the Court of Appeal dismissed the appeal, but we reversed. We held that the certificate requirement does not apply when the defendant “is not seeking to vacate the plea,” but “assertfs] only that errors occurred in the . . . adversary hearings conducted by the trial court for the purpose of determining the degree of the crime and the penalty to be imposed.” (Ward, supra, 66 Cal.2d 571, 574.)

In People v. Lloyd (1998) 17 Cal.4th 658 [72 Cal.Rptr.2d 224, 951 P.2d 1191] (Lloyd), the defendant pled no contest, without a bargain, to charges and enhancements that rendered him eligible for treatment as a “third strike” offender. The court postponed sentencing to await appellate guidance— presumably from our pending decision in Romero, supra, 13 Cal.4th 497—as to whether it had discretion to dismiss one or more “strikes.” When no such decision was forthcoming after six months, sentencing proceeded. After concluding it lacked authority to vacate prior “strikes,” the court imposed a “third strike” sentence. At the defendant’s behest, however, the court stated on the record that it would have considered dismissing one or more “strikes” if it had that discretion.

The defendant noticed an appeal. The notice stated the appeal was from the “sentence,” and it also included a handwritten notation to “Rule 31(d).” No probable cause certificate was filed. While the appeal was pending, we decided Romero, supra, 13 Cal.4th 497, concluding that sentencing courts do have discretion to dismiss “strikes” in the interest of justice. After the defendant filed his opening brief, the People moved successfully to dismiss the appeal for lack of a certificate.

We reversed. We found that the notice of appeal sufficiently indicated noncertificate grounds for the appeal, and thus made the appeal initially “operative” under rule 31(d). We further concluded that dismissal of the appeal for lack of a certificate was error. We explained that the appeal did not attack the validity of the plea, but simply sought to assert Romero error in sentencing proceedings that occurred after the plea. Citing Panizzon, supra, 13 Cal.4th 68, we affirmed that an appeal following conviction on a guilty or no-contest plea must be dismissed absent a certificate “if, in substance, it challenges the validity of the plea. (People v. Panizzon, supra, 13 Cal.4th at p. 76.) It does so if the sentence was part of a plea bargain. (Id. at p. 79.) It does not if it was not (id. at p. 78)—especially so if the claim or claims in question were ‘reserved as part of the plea agreement’ (id. at p. 78, fn. 8).” (Lloyd, supra, 17 Cal.4th 658, 665.)

In this case, defendant argues that a negotiated plea term which provides for a maximum sentence, rather than a specified sentence, necessarily contemplates further adversary proceedings, as occurred here, in which the court must exercise its discretion to determine the appropriate sentence within the constraints of the bargain. Hence, he reasons, claims based on abuses of this sentencing discretion were “ ‘reserved as part of the plea agreement’ ” (Lloyd, supra, 17 Cal.4th 658, 665; Panizzon, supra, 13 Cal.4th 68, 78, fn. 8) and constitute, in substance, no attack upon the plea itself that would require a probable cause certificate.

The instant Court of Appeal accepted the People’s contrary argument that absent an express reservation of issues, the defendant’s agreement to a maximum sentence includes his agreement to any sentence within the maximum. Hence, the Court of Appeal reasoned, a challenge to any sentence below the negotiated maximum requires a certificate of probable cause, because it is an attack on “the very sentence to which [the defendant] agreed as part of the plea” (Panizzon, supra, 13 Cal.4th 68, 73), and thus, in substance, upon the validity of the plea.

We find defendant’s argument more persuasive. The parties to a plea agreement are free to make any lawful bargain they choose, and the exact bargain they make affects whether a subsequent appeal, in substance, is an attack on the validity of the plea. When the parties negotiate a maximum sentence, they obviously mean something different than if they had bargained for a specific or recommended sentence. By agreeing only to a maximum sentence, the parties leave unresolved between themselves the appropriate sentence within the maximum. That issue is left to the normal sentencing discretion of the trial court, to be exercised in a separate proceeding.

In general, a trial court’s exercise of its sentencing discretion is reviewable on appeal where the issue was properly preserved on the record. (E.g., People v. Scott (1994) 9 Cal.4th 331, 353 [36 Cal.Rptr.2d 627, 885 P.2d 1040] (Scott).) This exercise of discretion is not made standardless and unreviewable simply because its exercise is confined to a specified range by the terms of a plea bargain that included no express waiver of appeal. In such a circumstance, when the claim on appeal is merely that the trial court abused the discretion the parties intended it to exercise, there is, in substance, no attack on a sentence that was “part of [the] plea bargain.” (Lloyd, supra, 17 Cal.4th 658, 665.) Instead, the appellate challenge is one contemplated, and reserved, by the agreement itself.

Cole, supra, 88 Cal.App.4th 850, is directly on point, and its reasoning is convincing. Defendant Cole, driving a stolen car, led police on a high-speed chase and caused an injury accident. He pled guilty to three felonies arising from the incident, and he admitted two prior “strikes.” In return, the court indicated, with the prosecutor’s concurrence, that it would impose a maximum sentence of 25 years to life and would decide whether to dismiss one or more “strikes” so as to permit a lesser term. At a later sentencing hearing, the court considered Cole’s written motion to dismiss “strikes,” as well as the probation report and counsel’s arguments. The court declined to dismiss “strikes” and sentenced Cole to a term of 25 years to life on each count, the terms to be served concurrently.

Cole’s notice of appeal claimed reliance only on postplea issues under rule 31(d). He obtained no certificate of probable cause. His appellate briefs argued that (1) his plea was induced by the court’s misleading promise to consider dismissing “strikes,” (2) his sentence constituted cruel and unusual punishment, (3) the court’s refusal to dismiss one of his prior “strikes” was an abuse of discretion, and (4) the court’s failure to stay two of the three sentences violated section 654.

The Court of Appeal ruled that issue (1), seeking withdrawal of the plea, was an obvious attack on the validity of the plea, and thus required a certificate. Applying Panizzon, supra, 13 Cal.4th 68, it found a similar certificate requirement for issue (2), the cruel and unusual punishment claim. Applying Hester, supra, 22 Cal.4th 290, it further found that issue (4), asserting error under section 654, was barred by rule 4.412(b). (Cole, supra, 88 Cal.App.4th 850, 854, 867-869, 872-873.) We have no occasion here to consider the validity of Cole's rulings on these issues, and we do not do so.

Our concern is with issue (3). On this point, Cole, supra, 88 Cal.App.4th 850, concluded that, without obtaining a certificate of probable cause, defendant could attack on appeal the sentencing court’s failure to dismiss the prior “strike.”

After reviewing such cases as Ward, supra, 66 Cal.2d 571, McNight, supra, 171 Cal.App.3d 620, Panizzon, supra, 13 Cal.4th 68, and Lloyd, supra, 17 Cal.4th 658, the court reasoned that “when the question of whether to impose the negotiated maximum is left to the court’s discretion at an adversary hearing, an appeal challenging the court’s exercise of that discretion is not, in substance, an attack on the validity of the plea. As Panizzon observed in construing Ward, the rationale of section 1237.5 applies when ‘a separate adversary hearing is unnecessary and the prosecution need not meet the traditional burden of proof in order to determine the proper penalty to be imposed.’ (People v. Panizzon, supra, 13 Cal.4th [68,] 79.) By implication from Panizzon, and by express holding in Ward, where adversary proceedings are held on the question of punishment, the rationale for limiting the right to appeal under section 1237.5 does not apply.” (Cole, supra, 88 Cal.App.4th 850, 871.)

We agree. Here, as in Cole, the parties could have negotiated a specified sentence, but they did not do so. Instead, their bargain provided that defendant would not be vulnerable to a sentence above the agreed limit. It thus left open a variety of sentencing choices within that limit.

The record makes clear that the bargain contemplated separate sentencing proceedings in which the appropriate sentencing choice, within the agreed maximum term, would stem from adversarial debate between the parties and the exercise of sentencing discretion by the trial court. At the time of the plea, the court indicated it would consider a disposition below the maximum. While the court ultimately imposed the agreed maximum, it did so only after a noticed sentencing hearing in which both sides argued their views of the appropriate disposition. The court considered the preplea sentencing report and carefully stated on the record its reasons for its chosen disposition.

Indeed, until the Court of Appeal raised the issue on its own motion, the People—who were a party to the bargain—never suggested that the agreement foreclosed defendant’s right, either in the trial court or on appeal, to debate the proper exercise of sentencing discretion within the agreed maximum term.

Defendant thus seeks only to raise issues reserved by the plea agreement, and as to which he did not expressly waive the right to appeal. Accordingly, his appeal does not, in substance, attack the validity of the plea. It follows that no certificate of probable cause is required.

To the extent Stewart, supra, 89 Cal.App.4th 1209, reached a contrary result on the narrow issue before us, we are not convinced by its reasoning. In Stewart, the defendant pled guilty to two counts of molestation involving his wife’s children; in return, six other counts were dismissed, and it was agreed that he would “ ‘serve a 6 year lid with the possibility of probation.’ ” (Id. at p. 1213.) As part of the bargain, the court indicated it would consider probation, but only ‘“[i]f the section 288.1 report [was] positive ....’” (Ibid., italics omitted.) The defendant indicated he understood this condition.

Both the probation report and the section 288.1 report were unfavorable. The latter indicated that the defendant was dangerous and not amenable to treatment. At the sentencing hearing, the defendant argued for probation, while the prosecutor urged the court to follow the probation officer’s recommendation of a prison term. Noting the dangerousness found by the section 288.1 report, and expressly adhering to the limit set by the plea bargain, the court imposed a six-year sentence.

Without obtaining a probable cause certificate, the defendant appealed, urging that the court had erred by (1) relying on the probation and section 288.1 reports, and (2) failing to state adequate reasons for denying probation and imposing the six-year term. The defendant also claimed the court’s refusal to grant probation was an abuse of discretion.

The Court of Appeal dismissed the appeal. It reasoned as follows: The defendant’s challenge to consideration of the probation report was waived by his failure to make a specific and timely objection. (Citing Scott, supra, 9 Cal.4th 331, 352-353.) His claim that the sentencing court should not have relied on the section 288.1 report was similarly precluded by his express acceptance, at the time he entered his plea, of the sentencing significance of this report. The court was not required to state reasons for denying probation and imposing a six-year term, because his plea included his agreement that the trial court had power to sentence him to a term of at least that length. (Citing rule 4.412(a) and People v. Villanueva (1991) 230 Cal.App.3d 1157, 1162 [281 Cal.Rptr. 688].) Finally, the defendant could not argue that his sentence was an abuse of discretion—i.e., that it “ ‘exceeded] the bounds of reason’ ” under the circumstances (Stewart, supra, 89 Cal.App.4th 1209, 1215, quoting People v. Giminez (1975) 14 Cal.3d 68, 72 [120 Cal.Rptr. 577, 534 P.2d 65])—because his agreement to be vulnerable to a term of up to six years was “tantamount to a stipulation that [a sentence of that length] was within the range of reasonableness for the crimes [he] had committed.” (Stewart, supra, at p. 1215.)

Stewart purported to distinguish Cole, supra, 88 Cal.App.4th 850, on the basis of perceived factual differences, including, in particular, the section 288.1 report that was central to the bargain in Stewart. But the fundamental reasoning of the two cases is incompatible, and, as indicated, we conclude that Cole's analysis is the sounder one.

As a practical matter, a defendant may rarely succeed with an argument that it was arbitrary or unreasonable to impose a sentence within an agreed maximum. However, we are not persuaded that a bargain for a maximum sentence necessarily constitutes acceptance, without complaint of any kind, of any sentencing decision within the maximum. As we have indicated, when the parties agree to a specified sentence, any challenge to that sentence attacks a term, and thus the validity, of the plea itself. However, by negotiating only a maximum term, the parties leave to judicial discretion the proper sentencing choice within the agreed limit. Unless the agreement itself specifies otherwise, appellate issues relating to this reserved discretion are therefore outside the plea bargain and cannot constitute an attack upon its validity.

Stewart, supra, 89 Cal.App.4th 1209, found support for its holding in People v. Young (2000) 77 Cal.App.4th 827 [91 Cal.Rptr.2d 916], but Young is distinguishable in a crucial respect. Defendant Young, a “third strike” offender charged with multiple offenses, pled no contest to all charges and “strike” allegations in return for a maximum sentence of 25 years to life and the right to ask the trial court to dismiss one or more “strikes.” After the trial court declined this request and imposed the negotiated maximum term, Young tried to appeal, without a probable cause certificate, on grounds that the sentence was cruel and unusual, and thus unconstitutional. The Court of Appeal noted it need not address whether Young would need a certificate in order to attack the trial court’s discretionary refusal to dismiss “strikes.” However, relying directly on Panizzon, supra, 13 Cal.4th 68, the Court of Appeal concluded that Young could not raise the constitutional issue without a certificate. The Young court reasoned that “[b]y arguing that the maximum sentence is unconstitutional, [the defendant] is arguing that part of his plea bargain is illegal and is thus attacking the validity of the plea.” (Young, supra, at p. 832, italics added.)

We need not decide in this case whether a certificate of probable cause is necessary under the particular circumstances presented in People v. Young, supra, 77 Cal.App.4th 827. Defendant here does not argue that the maximum sentence provided in his plea bargain was invalid because it exceeded the legally authorized sentence for his convictions. He simply seeks to implement the full terms of the bargain by raising appellate challenges to the exercise of individualized sentencing discretion within the agreed maximum that were reserved by the agreement itself. In doing so, we conclude, he need not obtain a certificate of probable cause.

Section 1237.5 and rule 31(d) are intended to weed out frivolous and vexatious appeals from pleas of guilty or no contest, before clerical and judicial resources are wasted. (Panizzon, supra, 13 Cal.4th 68, 75-76; People v. Hoffard (1995) 10 Cal.4th 1170, 1179 [43 Cal.Rptr.2d 827, 899 P.2d 896].) And it is true that application of the certificate requirement has involved difficult, and sometimes confusing, line-drawing. (Lloyd, supra, 17 Cal.4th 658, 667-669 (dis. opn. of Brown, J.).) But the statute and rule do not base the certificate requirement directly upon the dubious merit of a postplea appeal. Instead, under our case law, they require an individual analysis whether the appellate claim at issue constitutes, in substance, an attack on the validity of the plea.

Applying this test, we conclude that, absent contrary provisions in the plea agreement itself, a certificate of probable cause is not required to challenge the exercise of individualized sentencing discretion within an agreed maximum sentence. Such an agreement, by its nature, contemplates that the court will choose from among a range of permissible sentences within the maximum, and that abuses of this discretionary sentencing authority will be reviewable on appeal, as they would otherwise be. Accordingly, such appellate claims do not constitute an attack on the validity of the plea, for which a certificate is necessary. People v. Stewart, supra, 89 Cal.App.4th 1209, and People v. Tucker, supra, 187 Cal.App.3d 295, are disapproved to the extent they conflict with these conclusions.

Here, the Court of Appeal majority was mistaken to conclude that a certificate was necessary to assert an abuse of sentencing discretion within the maximum term established by the parties’ plea agreement. It thus erred by dismissing defendant’s appeal for lack of a certificate.

Conclusion

The Court of Appeal’s judgment, dismissing the appeal, is reversed, and the cause is remanded for further proceedings consistent with the views expressed in this opinion.

George, C. J., Kennard, J., Werdegar, J., Chin, J., and Moreno, J., concurred.

BAXTER, J., Concurring.

I agree, of course, with the reasoning and result of the majority opinion, which I authored. Under existing law and practice, and on the facts of this case, the majority’s holding is correct. I do believe, however, that the current “certificate of probable cause” system for discouraging baseless appeals from negotiated pleas (Pen. Code, § 1237.5; Cal. Rules of Court, rule 31(d) (rule 31(d)) is not working well. The result is a substantial burden on the time and resources of our already overextended court system. This should always be a cause for concern, but it is especially serious now, when the state faces unprecedented fiscal difficulties. I write separately to offer some suggestions for improvement.

At the outset, and most fundamentally, the parties to a plea agreement should, if possible, expressly negotiate and resolve the issue of appealability. A prime reason why we conclude here that defendant Buttram may take his appeal without a certificate, and that the Court of Appeal must address it on the merits, is that Buttram’s plea is silent on the appealability of the trial court’s sentencing choice.

Yet it is well settled that a plea bargain may include a waiver of the right to appeal. For example, in People v. Panizzon (1996) 13 Cal.4th 68 [51 Cal.Rptr.2d 851, 913 P.2d 1061] (Panizzon), the defendant’s written plea agreement included a specific sentence and also “ ‘waive[d] and [gave] up [his] right to appeal from the sentence [he] [would] receive . . . ” (Id. at p. 82.) We held that this waiver was valid and enforceable, and that the defendant had thereby forfeited his right to appeal the agreed sentence on grounds that it constituted cruel and unusual punishment. (Id. at pp. 79-84.)

As we indicated in Panizzon, “The negotiated plea agreement, which results in the waiver of important constitutional rights, ‘is an accepted and integral part of our criminal justice system.’ [Citations.] Such agreements benefit the system by promoting speed, economy and finality of judgments. [Citation.] [1] . . . Just as a defendant may affirmatively waive constitutional rights to a jury trial, to confront and cross-examine witnesses, to the privilege against self-incrimination, and to counsel as a consequence of a negotiated plea agreement, so also may a defendant waive the right to appeal as part of the agreement. [Citations.] [If] To be enforceable, a defendant’s waiver of the right to appeal must be knowing, intelligent, and voluntary. [Citations.] Waivers may be manifested either orally or in writing. [Citation.] The voluntariness of the waiver is a question of law which appellate courts review de novo. [Citation.]” (Panizzon, supra, 13 Cal.4th 68, 79-80, fn. omitted.)

To encourage specific resolution of this issue in plea agreements does not disfavor defendants. Relative bargaining strengths vary from case to case, and parties must always assess what rights and benefits they are willing to forfeit in return for others. In one case, the prosecution might make significant concessions in return for an appeal waiver. In another, it may be in no position to insist upon such conditions. In still another, the defendant may be able to win the express right to appeal. Of course, the parties may decide to leave the agreement silent on the subject. I suggest only that appealability should be a specific topic of discussion, and that the parties’ intent on that issue should be reflected in the agreement wherever the parties are able to resolve it expressly. •

If Buttram’s bargain had included an express waiver of appeal, a number of consequences would flow.

First, an attempt to appeal the sentence notwithstanding the waiver would necessarily be an attack on an express term, and thus on the validity, of the plea. (See Panizzon, supra, 13 Cal.4th 68, 76.) A certificate of probable cause would therefore be necessary to make the appeal “operative,” and in the absence of a certificate, the superior court clerk would not be put to the time and expense of preparing a record on appeal. (See People v. Jones (1995) 10 Cal.4th 1102, 1108 [43 Cal.Rptr.2d 464, 898 P.2d 910] (Jones).) If a record were nonetheless prepared and transmitted, the Court of Appeal could still dismiss the appeal for lack of a certificate, without having to address its merits.

An attempt to appeal the enforceability of the appellate waiver itself (for example, on grounds that it was not knowing, voluntary, and intelligent, or had been induced by counsel’s ineffective assistance) would not succeed in circumventing the certificate requirement. This is because, however important and meritorious such a challenge might be, it too would manifestly constitute an attack on the plea’s validity, thus requiring a certificate in any event.

Such “[a] strict application of section 1237.5 works no undue hardship on defendants with potentially meritorious appeals. The showing required to obtain a certificate is not stringent. Rather, the test applied by the trial court is simply ‘whether the appeal is clearly frivolous and vexatious or whether it involves an honest difference of opinion.’ (People v. Ribero (1971) 4 Cal.3d 55, 63, fn. 4 [92 Cal.Rptr. 692, 480 P.2d 308].) Moreover, a defendant who files a sworn statement of appealable grounds as required by section 1237.5, but fails to persuade the trial court to issue a probable cause certificate, has the remedy of filing a timely petition for a writ of mandate [seeking review of the refusal to issue the certificate]. (In re Brown (1973) 9 Cal.3d 679, 683 [108 Cal.Rptr. 801, 511 P.2d 1153]; People v. Castelan (1995) 32 Cal.App.4th 1185, 1188 [38 Cal.Rptr.2d 574]; People v. Nigro (1974) 39 Cal.App.3d 506, 511 [114 Cal.Rptr. 213].) Thus, if he complies with section 1237.5, a defendant has ample opportunity to perfect his appeal.” (People v. Cole (2001) 88 Cal.App.4th 850, 860, fn. 3 [106 Cal.Rptr.2d 174].) Moreover, if all else fails, the most fundamental kinds of attack remain available on habeas corpus.

Second, even if the defendant obtained a certificate, and the appeal was thereby made operative (Jones, supra, 10 Cal.4th 1102, 1108), the express waiver of appeal would permit the appellate court to decline to address the defendant’s claim on the merits, assuming that after de novo review, it found the waiver knowing, voluntary, and intelligent (see Panizzon, supra, 13 Cal.4th 68, 80). Thus, inclusion of express appeal waivers in plea agreements, when they reflect the parties’ actual intent, has the potential to minimize the time and cost, both for the parties themselves and for trial and appellate courts, of processing unwarranted postplea appeals. For this reason, it seems entirely appropriate to encourage the parties to address that issue in their plea negotiations.

I have particular concern about the need to save resources by foreclosing truly unwarranted postplea appeals at the earliest possible stage of processing. A principal purpose of the postplea certificate statute, section 1237.5, is “to promote judicial economy ‘by screening out wholly frivolous guilty [and nolo contendere] plea appeals before time and money [are] spent preparing the record and the briefs for consideration by the reviewing court.’ (People v. Hoffard (1995) 10 Cal.4th 1170, 1179 [43 Cal.Rptr.2d 827, 899 P.2d 896]; see People v. Ballard (1985) 174 Cal.App.3d 982, 987-988 [220 Cal.Rptr. 323].)” (Panizzon, supra, 13 Cal.4th 68, 75-76, italics added.)

But current practice under rule 31(d) sometimes frustrates that goal, and changes may be justified. The rule’s second paragraph allows a postplea appeal to proceed without a statement of reasonable grounds for appeal and a certificate of probable cause if the notice of appeal states that it is based upon so-called noncertificate grounds, i.e., those “(1) occurring after entry of the plea which do not challenge its validity or (2) involving a search and seizure, the validity of which was contested pursuant to section 1538.5 of the Penal Code.” (Italics added.)

Many superior courts have developed standard postplea notice-of-appeal forms that allow appealing postplea defendants simply to check boxes reflecting these two noncertificate categories, without, any explanation or elaboration. Court clerks presumably (and understandably) rely on the representations made on these forms when deciding whether they have a ministerial duty to prepare the record, pursuant to rule 31(d), even though the requirements of section 1237.5 have not been met. We ourselves may have exacerbated the problem by making the “validity of the plea” issue so complicated (see People v. Lloyd (1998) 17 Cal.4th 658, 667-668 [72 Cal.Rptr.2d 224, 951 P.2d 1191] (dis. opn. of Brown, J.)), and by imposing lenient standards for compliance with rule 31(d) (see Lloyd, supra, at pp. 664-665 (maj. opn.) [notice of appeal included handwritten notation “Rule 31(d)”; printed word “judgment” was crossed out and replaced with handwritten word “sentence”]). As a result, the system often does not realize that a certificate should have been obtained until well after the record and briefs have been filed in the Court of Appeal.

I have no magic solution to this quandary, but the Legislature and the Judicial Council should explore it. One approach might be to amend section 1237.5 and rule 31(d), (1) to require postplea notice-of-appeal forms to conform more strictly to the rule’s own language, (2) to state that noncomplying notices shall not be effective, and (3) to require that attorney representations on such forms be made to the best of the attorney’s knowledge and belief, but nonetheless under penalty of perjury. It would be difficult, for example, for an attorney whose client had waived an appeal as part of a plea bargain to state under penalty of perjury that the appeal did not attack “the validity of the plea,” thus obviating the certificate requirement.

It may also be advisable to require the superior court to resolve, at a judicial rather than a clerical level, whether a certificate is required in a particular case. The law mandates that the decision whether to issue a certificate be made by a judge of that court. On the other hand, under current procedures, if a postplea defendant believes he is pursuing an appeal for which a certificate is not required, he need only say so on a form filed with the superior court clerk. His representation will be accepted without question, his appeal will become operative, and the appellate record will be prepared and transmitted. The People, also a party to the plea, have no opportunity in the trial court to dispute the defendant’s claim of exemption from the certificate requirement. Indeed, that claim is never subjected to judicial scrutiny unless the issue arises in the Court of Appeal, after the appellate record and briefs have been prepared. Addressing the exemption issue in a superior court proceeding would involve some extra judicial time, but the drain on judicial resources might be less in the long run.

I commend these ideas for consideration in appropriate quarters. Other approaches may be equally or more valuable. But I am quite certain that problems have arisen in the system for screening postplea appeals, and that carefully crafted reforms in practice and procedure may well be in order.

Chin, J., concurred.

BROWN, J.

I respectfully dissent.

Decades ago, this court misguidedly entered “into the business of crafting exceptions” to the certificate of probable cause requirement found in Penal Code section 1237.5. (People v. Lloyd (1998) 17 Cal.4th 658, 667 [72 Cal.Rptr.2d 224, 951 P.2d 1191] (dis. opn. of Brown, J.).) In doing so, this court ignored the broad language of the statute and forgot the purpose of the requirement—“ ‘to promote judicial economy “by screening out wholly frivolous guilty [and nolo contendere] plea appeals before time and money is spent preparing the record and the briefs for consideration by the reviewing court.” ’ ” (Id. at p. 668, quoting People v. Panizzon (1996) 13 Cal.4th 68, 75-76 [51 Cal.Rptr.2d 851, 913 P.2d 1061].) Five years ago, I warned my colleagues that our continued expansion of these exceptions further eviscerates the purpose behind the requirement and creates “a prescription for unnecessary litigation.” (Lloyd, at p. 668.) But, like the prophecies of Cassandra, my warnings were ignored.

We now have another opportunity to “halt th[is] process.” (People v. Lloyd, supra, 17 Cal.4th 658, 668 (dis. opn. of Brown, J.).) But once again my colleagues decline to do so. Instead, they hold that “absent contrary provisions in the plea agreement itself, a certificate of probable cause is not required to challenge the exercise of individualized sentencing discretion within an agreed maximum sentence.” (Maj. opn., ante, at p. 790.) In reaching this holding, they conclude that “[s]uch an agreement, by its nature, contemplates that the court will choose from among a range of permissible sentences within the maximum, and that abuses of this discretionary sentencing authority will be reviewable on appeal, as they would otherwise be.” (Id. at pp. 790-791.)

I disagree. Although a defendant who agrees to a maximum sentence contemplates a separate proceeding where the trial court may exercise its normal sentencing discretion, he, by definition, agrees to any sentence equal to or below that maximum. In other words, the defendant has, by entering into the plea agreement, given up the right to challenge the trial court’s exercise of discretion at the sentencing proceeding so long as the sentence does not exceed the agreed-upon maximum. Thus, defendant’s challenge to the trial court’s exercise of sentencing discretion is an attack on the validity of the plea and falls outside our judicially created exceptions to the certificate of probable cause requirement.

People v. McNight (1985) 171 Cal.App.3d 620 [217 Cal.Rptr. 393]—on which we relied heavily in People v. Panizzon, supra, 13 Cal.4th 68— supports this conclusion. In McNight, the defendant pled guilty in exchange for the prosecutor’s agreement to dismiss certain charges and recommend a specific sentence. After receiving the recommended sentence, the defendant appealed, contending he “was prejudiced by the trial court’s acceptance of the prosecutor’s recommendation and by his counsel’s failure to argue mitigating circumstances.” (McNight, at p. 624.) The defendant contended he did not need a probable cause certificate because he sought “only appellate review of the sentencing procedure.” (Ibid.) The Court of Appeal disagreed because the defendant “received exactly the sentence promised in the agreement. His contention that consideration of mitigating circumstances should have resulted in imposition of a sentence less than the agreed-upon 21 years goes to the heart of the plea agreement itself.” (Ibid.)

The Court of Appeal reached this conclusion even though the plea agreement contemplated a separate sentencing proceeding where the trial court could exercise its normal sentencing discretion. According to the court, this sentencing proceeding was “not separate and distinct from” the defendant’s guilty plea. (People v. McNight, supra, 171 Cal.App.3d at p. 625.) Rather, “the sentencing hearing provided the setting for the performance of the plea agreement. The terms of the agreement were discussed, and the trial court acted in complete accordance with those terms.” (Ibid.) The same reasoning applies here. Because defendant’s plea agreement provided for a maximum sentence and defendant received that maximum sentence, his sentencing hearing was “not separate and distinct from his plea of guilty.” (Ibid.) Accordingly, I would hold that defendant needed a certificate of probable cause to challenge the trial court’s “exercise of individualized sentencing discretion within an agreed maximum.” (Maj. opn., ante, at p. 790.)

Of course, even if my colleagues had adopted my reasoning, it would do little to remedy the problem. Our prior jurisprudence has made the laudatory goal of Penal Code section 1237.5—to promote judicial economy—virtually impossible to attain. Like Sisyphus who must push his rock up a hill for all eternity, we appear doomed to forever construe these exceptions in a futile effort to articulate the scope of the certificate of probable cause requirement. Perhaps the Legislature will save us from this fate. Perhaps next time we will learn our lesson. 
      
      All further unlabeled statutory references are to the Penal Code; all rules references are to the California Rules of Court.
     
      
      At the June 1, 2000, plea hearing, the court confirmed that it had “given an indication based upon the factors under consideration of a maximum six-year state prison term.” (Italics added.) The written change-of-plea form, signed by defendant, includes a handwritten statement that “I am pleading guilty and understand the indicated sentence is 6 years, as a lid.” (Italics added.) These references to an “indicated” sentence were in apparent deference to the statutory prohibition of plea bargaining over the dismissal of prior “strikes” under the Three Strikes law (see §§ 667, subd. (g), 1170.12, subd. (e)), because dismissal of at least one of the two prior “strikes” admitted by defendant was necessary to render him eligible for a term of six years or less, instead of the mandatory minimum 25-year-to-life sentence for third strike offenders. (§§ 667, subd. (e)(1), (2)(A), 1170.12, subd. (c)(1), (2)(A); see People v. Superior Court (Romero) (1996) 13 Cal.4th 497 [53 Cal.Rptr.2d 789, 917 P.2d 628] (Romero) [sentencing court has statutory discretion, in furtherance of justice, to dismiss prior felony convictions for purposes of Three Strikes law].) However, the trial court assured defendant at the plea hearing that “by the terms of this plea[,] should the court for some reason believe that a higher sentence [than six years] is appropriatef,] you would be permitted to withdraw your plea and start all over again,” thus suggesting that six years was the agreed maximum term in return for the plea. Whatever terminology was used, the parties do not dispute that defendant pled guilty in return for assurances of a maximum six-year term, and no issue involving the anti-plea-bargaining statutes is before us. We therefore proceed on the assumption that six years was a negotiated maximum.
     
      
      In fact, though defendant ultimately did not choose to appeal the validity of the probation search which produced evidence leading to his guilty plea, he had blacked out, rather than initialing, a provision on the written change-of-plea form that (1) advised him of his right to appeal such issues, and (2) recited that “I hereby waive and give up this right.”
     
      
      The court ordered a mandatory restitution fine of $200 (§ 1202.4, subds. (a)(3)(A), (b)), and also imposed, but stayed, an equivalent parole revocation fine (§ 1202.45). A $50 laboratory analysis fee was assessed for each offense. (Health & Saf. Code, § 11372.5, subd. (a).) Defendant was awarded 336 days of presentence custody credit.
     
      
      The first paragraph of rule 31(d) provides in pertinent part: “If a judgment of conviction is entered upon a plea of guilty or nolo contendere, the defendant shall, within 60 days after the judgment is rendered, file as an intended notice of appeal the statement required by section 1237.5 . . . ; but the appeal shall not be operative unless the trial court executes and files the certificate of probable cause required by that section. Within 20 days after the defendant files the statement the trial court shall execute and file either a certificate of probable cause or an order denying a certificate and shall forthwith notify the parties of the granting or denial of the certificate.”
     
      
      The second paragraph of rule 31(d) provides in pertinent part: “If the appeal from a judgment of conviction entered upon a plea of guilty or nolo contendere is based solely upon grounds (1) occurring after entry of the plea which does not challenge its validity or (2) involving a search or seizure, the validity of which was contested pursuant to section 1538.5 . . . , the provisions of section 1237.5 . . . requiring a statement by the defendant and a certificate of probable cause by the trial court are inapplicable, but the appeal shall not be operative unless the notice of appeal states that it is based upon such grounds.”
     
      
      In Panizzon, the Court of Appeal had cited People v. Sumstine (1984) 36 Cal.3d 909 [206 Cal.Rptr. 707, 687 P.2d 904], in support of its conclusion that postplea sentencing claims require no probable cause certificate. Distinguishing Sumstine, our Panizzon opinion noted that “the particular sentencing claim [at issue in Sumstine] appears to have been reserved as part of the plea agreement. [Citation.]” (Panizzon, supra, 13 Cal.4th 68, 78, fn. 8, italics added.)
     
      
      
        McNight, like Panizzon, included a footnote distinguishing situations in which the plea agreement itself did not resolve all sentencing issues. As McNight indicated, if the plea agreement there at issue, instead of including “a specific recommended sentence,” had left the trial court free to “select[ ] any appropriate sentence without violating the plea agreement,” “the sentencing proceedings probably would not be part of the plea itself, and section 1237.5 requirements might not apply. [Citations.]” (McNight, supra, 171 Cal.App.3d 620, 625, fn. 4.)
     
      
      Rule 412 was renumbered rule 4.412 effective January 1, 2001. Hester, supra, 22 Cal.4th 290, which was decided in February 2000, used the prior numbering. We retain that numbering for purposes of our discussion of Hester.
      
     
      
      Rule 4.412, renumbered as such effective January 1, 2001, was formerly numbered rule 412. In Hester, supra, 22 Cal.4th 290, decided in February 2000, we discussed the rule as previously numbered. (See fn. 9.)
     
      
       Section 288.1 provides that a person convicted of lewd and lascivious conduct upon a child under 14 may not have his or her sentence suspended “until the court obtains a report from a reputable psychiatrist, from a reputable psychologist . . . , or from a recognized treatment program . . . as to the mental condition of that person.”
     
      
      We consider here only the Stewart court’s holding that one attacks the validity of the plea, and thus requires a probable cause certificate, by urging on appeal that a sentence within an agreed maximum was an abuse of discretion. We neither approve nor disapprove Stewart’s reasoning on the other issues there presented. We do note that, aside from any other flaws in its reasoning, the Stewart court appears to have committed a technical error by dismissing defendant Stewart’s appeal in its entirety. One of Stewart’s appellate objections was to the trial court’s adverse use of the probation officer’s report. The Court of Appeal did not find this claim to be an attack on a term of the plea agreement, which would require a certificate of probable cause to make the appeal “operative” (Rule 31(d)). Instead, the Court of Appeal concluded that the argument had simply been waived by failure to object on that ground during the sentencing hearing below. A claim waived by failure to object may be rejected on the merits for that reason, but is not a basis for dismissal of the appeal for failure to obtain a certificate.
     
      
      For its premise that agreement to a maximum sentence is a stipulation to the reasonableness of any sentence within the maximum, Stewart cited People v. Tucker (1986) 187 Cal.App.3d 295, 296 [231 Cal.Rptr. 671]. Tucker invoked this principle to reject, on its merits, a claim that the trial court had erred by failing to state reasons for imposing the agreed maximum, rather than a lesser term—an issue also presented both in Stewart itself, and in the instant case. As we have explained, however, a bargain for a maximum sentence does not foreclose trial and appellate litigation concerning the issue reserved by such a bargain— the exercise of judicial sentencing discretion within the limits of the bargain. Insofar as Tucker suggests that a maximum-sentence agreement forecloses such issues, and thus provides support for the notion that a certificate of probable cause is necessary to raise them on appeal, Tucker, like Stewart, should be disapproved.
     
      
      A11 further unlabeled statutory references are to the Penal Code.
     
      
      The federal courts generally agree that a plea bargain may include a waiver of the right to appeal. Some federal tribunals “have delineated specific instances in which waiver-of-appeal provisions may be found invalid” (U.S. v. Khattak (3d Cir. 2001) 273 F.3d 557, 562), but as of 2001, all 11 numbered federal circuits had “found waivers of appeal generally permissible and enforceable. [Citations.]” (Id. at pp. 560-561.) “As the Supreme Court has stated, ‘A criminal defendant may knowingly and voluntarily waive many of the most fundamental protections afforded by the Constitution.’ United States v. Mezzanatto, 513 U.S. 196, 201, 115 S.Ct. 797, 130 L.Ed.2d 697 (1995); see also Peretz v. United States, 501 U.S. 923, 936, 111 S.Ct. 2661, 115 L.Ed.2d 808 (1991) (‘The most basic rights of criminal defendants are . . . subject to waiver.’).” (Khattak, supra, at p. 561.)
     
      
      Apparently the Judicial Council has developed no mandatory form to be used statewide in such circumstances. (See West’s Cal. Rules of Court (State) (2003 ed.) Div. III (Judicial Council Legal Forms List) pp. 579, 585.)
     
      
      I leave open whether equally stringent requirements should apply to defendants who prepare and file their own appeal papers, without the assistance of attorneys.
     