
861 A.2d 657 (2004)
2004 ME 118
STATE of Maine
v.
Daniel MURPHY.
Supreme Judicial Court of Maine.
September 13, 2004.
Submitted on Briefs: May 28, 2004.
Decided: September 13, 2004.
*658 Stephanie Anderson, District Attorney, Julia Sheridan, Asst. Dist. Atty., Portland, for State.
Robert A. Levine, Portland, for defendant.
Panel: SAUFLEY, C.J., and CLIFFORD, RUDMAN, DANA, ALEXANDER, CALKINS, and LEVY, JJ.
CLIFFORD, J.
[¶ 1] Daniel Murphy appeals from his sentence entered in the Superior Court (Cumberland County, Delahanty, J.). Murphy contends that the court erred when it concluded that because he violated his bail conditions, his plea agreement, pursuant to which the State promised to recommend a specific sentence, became an *659 open plea. We agree with Murphy and vacate his sentence.

I. BACKGROUND
[¶ 2] On February 7, 2003, Murphy pleaded guilty to one count of burglary (Class B), 17-A M.R.S.A. § 401(1) (1983),[1] and two counts of reckless conduct with a dangerous weapon (Class C), 17-A M.R.S.A. § 211(1) (1983). At the Rule 11 hearing, the State described the terms of the plea agreement as follows:
Judge, as [Murphy's attorney] has indicated, there [are] some contingencies.... There has been an ongoing process of review between Maine Pretrial Services and the Serenity House.
It's quite clear Mr. Murphy has a substance abuse problem. They have indicated a willingness to take him and a bed might well open up within the next couple of weeks. What we would like to do at that point is submit a Pretrial Services contract to the Court with the condition that he attend and successfully complete the Serenity House program.
His bail would be reduced to personal recognizance in conjunction with this Pretrial Contract. He has to immediately go from jail to Serenity House. If he completes Serenity House successfully  and this would obviously take a period of time, it would probably take somewhere in the area of half a year  if he does that successfully, he can come back to the Court and the agreement will call for four years to the Department of Corrections, with all but nine months as a cap and a four year period of probation. Drug and alcohol conditions, no dangerous weapons, no contact with victims and restitution.
If, on the other hand, he does not successfully complete and he were to leave the program or gets kicked out for violating the rules, then it's strictly an open plea.
[¶ 3] Murphy entered the Serenity House on February 12, 2003, and was voluntarily discharged on May 27, 2003. On September 15, 2003, Murphy was arrested on charges of operating under the influence, operating after suspension, and leaving the scene of an accident. Six weeks later, he was sentenced on the charges to which he pleaded guilty in February. At the sentencing hearing, the State raised the issue of whether Murphy complied with the terms of the plea agreement. The State argued that Murphy was still under the supervision of the Serenity House, had not completed the program, and therefore, his plea should be considered an open plea. The State admitted that "[t]he issue is whether I am limited to [recommending] nine [months]; if I'm not I'm recommending 18 months, Judge."
[¶ 4] Murphy contended that he did successfully complete the Serenity House program, and that although he violated his bail conditions, the plea agreement was only conditioned on his successful completion of the Serenity House program and not his compliance with his bail conditions. The court concluded the following:
First off, I think the question the Court has to address is has there been a violation of the conditions regarding the bail contract and the basic reasons why the case was continued for sentence in the first place, and that is to provide the defendant with the opportunity to participate, hopefully successfully and completely, at Serenity House. We do have the Maine Pretrial Services contract. He did go through a program at Serenity *660 House, albeit not as long as the state would in fact request, the  and left voluntarily but didn't appear  he wasn't asked to leave, and he wasn't  he didn't violate any of the rules so that he was kicked out.
Should he have stayed in the program longer? Perhaps. In hindsight maybe he wishes he had. But, nevertheless, the Court still does find there is a violation, and I find that because he was admitted to bail at the time and, even beyond the conditions of the Pretrial Services contract, the usual and regular conditions of bail is that, number two, I will not commit any criminal act. He has not been found guilty of any criminal act, but he had been arrested. So it's some indication of inappropriate conduct, but more importantly there was an additional condition that he would not possess or use any alcoholic beverages or drugs, and he has agreed and admitted that he had consumed alcohol on the particular date that led to the revocation of his bail. So I don't feel that the State is bound by the regulations....
....
I think it's implicit in any agreement that you have to abide by the conditions of bail. That should be the very basic, and I think it's even more important than completing Serenity House.
The court did not give Murphy an opportunity to withdraw his plea. Murphy was sentenced to four years incarceration, with all but seventeen months suspended. Murphy subsequently filed an application for leave to appeal his sentence, which we granted. See 15 M.R.S.A. § 2151 (2003); M.R.App. P. 20.

II. DISCUSSION
[¶ 5] Murphy first contends that the State breached the plea agreement and the court should have required the State to abide by the terms of the agreement. We disagree. Contrary to Murphy's contention, the State did not breach the terms of the agreement. The prosecutor promised to recommend a specific sentence should Murphy successfully complete the Serenity House program; the prosecutor did not promise that he would refrain from challenging whether Murphy successfully completed the program. See State v. Blanchard, 409 A.2d 229, 235 (Me.1979), overruled on other grounds by State v. Berube, 1997 ME 165, 698 A.2d 509.
[¶ 6] The State contends that the court "appropriately declined to sentence Appellant Murphy pursuant to the cap agreement." It is clear from the sentencing transcript, however, that the Superior Court was not rejecting the agreement, as it could have done pursuant to M.R.Crim. P. 11A(d). Even if the court was rejecting the plea agreement, the court would have been obligated to give Murphy an opportunity to withdraw his plea, which the court did not do. See M.R.Crim. P. 11A(e); Shorette v. State, 402 A.2d 450, 460 (Me.1979).[2]
[¶ 7] The transcript shows that the Superior Court did not reject the plea agreement, *661 but rather construed the plea agreement to implicitly include a requirement that Murphy abide by the terms of his bail conditions in order for the State to be required to recommend a cap of nine months of actual time served. Because Murphy violated his bail conditions, the court considered Murphy's plea to be an open plea, and sentenced him accordingly.
[¶ 8] We agree with Murphy's contention that the court erred when it interpreted the plea agreement to implicitly include a requirement that Murphy abide by his bail conditions. Plea agreements are contracts and contract principles apply when interpreting them. E.g., United States v. Pollack, 91 F.3d 331, 334-35 (2d Cir.1996); United States v. Gilchrist, 130 F.3d 1131, 1134 (3d Cir.1997); United States v. McQueen, 108 F.3d 64, 66 (4th Cir.1997). We review a trial court's interpretation of a plea agreement de novo. E.g., United States v. Jones, 58 F.3d 688, 691 (D.C.Cir.1995).
[¶ 9] When interpreting a contract, courts "effect the parties' intentions ... construed with regard for the subject matter, motive, and purpose of the agreement, as well as the object to be accomplished." Handy Boat Serv., Inc. v. Prof'l Servs., Inc., 1998 ME 134, ¶ 7, 711 A.2d 1306, 1308. The entire agreement or contract is examined, and language is given its plain meaning. Am. Prot. Ins. Co. v. Acadia Ins. Co., 2003 ME 6, ¶¶ 12-13, 814 A.2d 989, 993-94. "In interpreting a plea agreement, the court focuses on the meaning a reasonable person would have attached to the agreement at the time the agreement was entered into." State v. Antonio-Antimo, 29 P.3d 298, 303 (Colo.2000). Ordinarily, the government "must bear responsibility for any lack of clarity." United States v. Anderson, 970 F.2d 602, 607 (9th Cir.1992). Additionally, plea agreements often receive greater scrutiny than do commercial contracts because the defendant's "fundamental and constitutional rights are implicated." McQueen, 108 F.3d at 66.
[¶ 10] "The application of contract law to plea agreements is premised on `the notion that the negotiated guilty plea represents a bargained-for quid pro quo.'" United States v. Escamilla, 975 F.2d 568, 571 (9th Cir.1992) (quoting United States v. Partida-Parra, 859 F.2d 629, 633 (9th Cir.1988)). As we have previously stated:
Plea bargaining securing to the State the entry of a plea of guilty or nolo contendere on the part of the accused is a serious and sobering occasion for criminal defendants inasmuch as it effects a waiver of the fundamental rights to a jury trial and all related constitutional privileges in connection therewith.
Shorette, 402 A.2d at 459. Accordingly, outside of the implied obligation of good faith and fair dealing, Jones, 58 F.3d at 692, obligations in plea agreements must be bargained for in order to protect the defendant's rights.
[¶ 11] The plea agreement between Murphy and the prosecutor made no mention of bail conditions and whether adherence to bail conditions was a condition of the plea agreement.[3] Because adherence to *662 bail conditions was not a bargained-for condition of the plea agreement, the Superior Court erred when it interpreted Murphy's plea agreement as implicitly including a requirement that Murphy abide by his bail conditions. Moreover, the court found that the only condition that was bargained for, Murphy's successful completion of the Serenity House program, had been satisfied. Therefore, on remand, the court has two options. The court can either accept the plea agreement and sentence Murphy pursuant to the terms of the agreement, or, pursuant to M.R.Crim. P. 11A(d), the court can reject the agreement. If the court does not accept the plea agreement, however, it must give Murphy an opportunity to withdraw his plea. M.R.Crim. P. 11A(e); Shorette, 402 A.2d at 460.
The entry is:
Sentenced vacated. Remanded to the Superior Court for proceedings consistent with this opinion.
NOTES
[1]  Title 17-A M.R.S.A. § 401(1) has since been amended by P.L. 2001, ch. 383, §§ 53-55 (effective Jan. 31, 2003), codified at 17-A M.R.S.A. § 401(1) (Supp. 2003).
[2]  Murphy's plea agreement differs in a very important way from the plea agreements that participants in the Adult Drug Treatment Court enter into. Adult Drug Treatment Court plea agreements condition the defendant's participation on a waiver of the right to withdraw the guilty plea. State v. Caldwell, 2003 ME 85, ¶ 9, 828 A.2d 765, 767-68. So long as this waiver is done in a knowing and intentional manner, and is done voluntarily, the waiver is constitutional. Id. ¶ 11, 828 A.2d at 768. Here, Murphy's plea agreement was not conditioned on a waiver of his right to withdraw his plea, and if the court rejects Murphy's plea agreement, it must give him an opportunity to withdraw his plea. M.R.Crim. P. 11A(e); Shorette v. State, 402 A.2d 450, 460 (Me.1979).
[3]  We find no fault with the type of plea agreement in this case, where the ultimate disposition of a criminal charge is deferred, as it can provide a defendant with a meaningful opportunity to make restitution and/or obtain and maintain sobriety, and otherwise demonstrate that a harsh sentence is neither necessary nor appropriate. In order to ensure that the defendant's rights are protected, that victims understand the requirements, and that such pleas are fair, however, the conditions leading to an ultimately reduced sentence should be spelled out with particularity.
