
29 So.3d 1172 (2010)
John WALKER, Petitioner,
v.
Al LAMBERTI, as Sheriff of Broward County, Florida, and the State of Florida,[1] Respondents.
No. 4D10-400.
District Court of Appeal of Florida, Fourth District.
March 8, 2010.
*1173 Thomas A. Morse, Fort Lauderdale, for petitioner.
No response required for respondents.
PER CURIAM.
John Walker petitions for a writ of habeas corpus seeking discharge from a 30-day jail-based drug treatment program which the judge ordered Walker to complete as a sanction for failing a drug test administered as part of the Broward County drug court felony pretrial intervention program (PTI). We deny the petition because the legislature has expressly authorized the type of sanction imposed in this case and because Walker executed a deferred prosecution agreement (DPA) that specifically advised him that pretrial detention in a treatment program could be imposed if he violated the terms of the program.
In July 2009, Walker was arrested and charged with possession of cocaine. He entered into a DPA and the PTI program. See § 948.08(6)(a), Fla. Stat. (2009); see also § 397.334, Fla. Stat. (2009).
PTI programs are entered into as a contract between the court and the participant, similar to a plea agreement. State v. Dempsey, 916 So.2d 856, 859 (Fla. 2d DCA 2005). In the PTI program, the defendant agrees to abide by the terms and conditions of the DPA. Upon successful completion of the program, the court dismisses the charges. See § 948.08(6)(c), Fla. Stat. (2009). A felony PTI program must be at least one year in duration. § 948.08(6)(a), Fla. Stat. (2009).
Walker signed and initialed a DPA, which advised him the PTI program would last at least 12 months and up to 18 months with the possibility that the judge could extend the program for an additional 6 months to allow Walker time to successfully complete the program. The agreement advised Walker of the requirements of the program, including random drug testing, and that he could be placed in a jail-based drug treatment program administered by the Broward Sheriff's Office (BSO) if he violated its terms.
At a status hearing, after having been in the program for several months, Walker advised the judge that he wanted to "opt *1174 out" of the program. The judge refused to allow Walker to "opt out" unless he took a drug test. Walker took the drug test and failed. The judge then ordered Walker taken into custody pending placement in BSO's drug treatment program.
Walker petitions this court for a writ of habeas corpus. He argues that participation in the PTI program is strictly voluntary, and he can opt out of the program at any time and require the charges to revert to normal channels of prosecution. See Mullin v. Jenne, 890 So.2d 543 (Fla. 4th DCA 2005); Diaz v. State, 884 So.2d 299 (Fla. 2d DCA 2004).
In Mullin, this court found that language in the administrative order creating the Broward County PTI program made participation strictly voluntary. The administrative order creating the PTI program provided: "Participation is strictly on a voluntary basis." Mullin, 890 So.2d at 546 (quoting Administrative Order III-99-3-E, Seventeenth Judicial Circuit) (emphasis in original). In footnote 3 of Mullin, we noted: "Had the administrative order indicated only `entry' into the program was `voluntary,' a different result may have occurred." Id. at 546 n. 3.
Subsequent to our decision, the administrative order was amended. The current order tracks the language of section 397.334(3)(a) and now provides: "Entry into the felony drug court is voluntary. . ." Administrative Order 2010-14-CRIM(1)(b), Seventeenth Judicial Circuit (emphasis added). It no longer provides that "participation" is voluntary.
In Mullin, we expressly held that incarceration in jail was a permissible sanction for violating the terms of a pretrial intervention drug court program: "The fact that the defendant remains in pre-trial status should not prevent the trial court from using the jail-based sanctions that the defendant would otherwise be subjected to if on probation." Id. at 546. We disagreed with the Second District Court of Appeal's decision in Diaz, which held that, under the existing statute, incarceration was not a permissible sanction. Mullin, 890 So.2d at 546.
When Diaz was decided, the statute did not expressly permit jail-based sanctions for violations of the PTI program. 884 So.2d at 299. In 2006, after Diaz and Mullin, the legislature responded, amending the statute to expressly provide that incarceration or placement in jail-based drug programs may be imposed as a sanction. Ch. 2006-97, § 8, Laws of Fla.; § 948.08(6)(b), Fla. Stat. (2006). The amended statute provides:
While enrolled in a pretrial intervention program authorized by this subsection, the participant is subject to a coordinated strategy developed by a drug court team under s. 397.334(4). The coordinated strategy may include a protocol of sanctions that may be imposed upon the participant for noncompliance with program rules. The protocol of sanctions may include, but is not limited to, placement in a substance abuse treatment program offered by a licensed service provider as defined in s. 397.311 or in a jail-based treatment program or serving a period of incarceration within the time limits established for contempt of court. The coordinated strategy must be provided in writing to the participant before the participant agrees to enter into a pretrial treatment-based drug court program or other pretrial intervention program.
§ 948.08(6)(b), Fla. Stat. (2009) (emphasis added)[2]; see also § 397.334(5), Fla. Stat. (2009).
*1175 Because the potential sanctions are serious, and the agreement waives important rights  such as the right to speedy trial and pretrial release, the requirements and potential sanctions for violations of PTI should be set forth clearly, provided to, and agreed to by the defendant in writing. Indeed, the statute requires as much. See § 948.08(6)(b), Fla. Stat. (2009).
We reject Walker's contention that participation in the PTI program is strictly voluntary and that he is permitted to "opt out" of the program at any time. Walker agreed to be subject to the terms and conditions of the drug court program for a minimum of 12 months and up to 18 months or until terminated from the program by the court. Nothing in the DPA indicates that continued participation was voluntary or that Walker could "opt out" at any time. The DPA advised Walker that "entry" into the program is voluntary. Walker was not misled into believing that participation was also voluntary, or that he could "opt out" at any time.
In fact, paragraph 9 of the DPA provides:
9. By entering into this agreement, I agree to be bound by its terms and conditions until its termination by one or more of the following circumstances:
a. Successful completion of the PTI program within no more than eighteen (18) months from the date I commence court approved treatment.
b. Failure to successfully complete the program within eighteen (18) months from the date I commence court approved treatment.
c. Failure to comply with the terms and conditions of the agreement.
d. The commission of a new felony offense. . . or second domestic violence misdemeanor or any other violent misdemeanor. The commission of the new offense shall be proved by the state by a preponderance of the evidence. Hearsay evidence may be admitted and the burden of proof may be met through introduction of hearsay evidence exclusively.
f. [sic] A determination by the Court that I am unsuitable for treatment.
The DPA, signed by Walker, put him on notice that once enrolled in the program, he was bound for its entire term and could be subjected to sanctions such as pretrial detention in a jail-based drug treatment program. Paragraph 8(e) of the DPA specifically provides:
I understand that my pretrial release was conditioned on my participation in Drug Court and my compliance with my treatment plan. I further understand that non-compliance with my treatment program may result in being taken into custody to complete a BSO In-Custody Treatment Program to continue my recovery process. Other sanctions the court may impose include more intensive treatment, electronic monitoring (house arrest), weekends in-custody, long or short term residential treatment in the community. I further understand that the Court will review my custody and treatment status on a regular basis.
Paragraph 7 specifically provides that "[b]efore entering this agreement, I was instructed on my obligations under PTI as delineated in paragraph 8, attended an orientation of the BSO Drug Court Treatment Program, and have been advised of my treatment obligations by my attorney."
*1176 Like a plea, the decision to enter into a binding PTI agreement such as this, which can result in pretrial detention or involuntary treatment, must be knowingly and voluntarily made. As long as the defendant enters into the PTI program with "eyes wide open" and aware of the requirements and potential sanctions, then the court has the authority to impose those sanctions under the terms of the agreement. Once terminated, however, the PTI participant maintains the right to contest the charges at trial or enter a change of plea upon termination of the program.
The petition is DENIED.
STEVENSON, HAZOURI and DAMOORGIAN, JJ., concur.
NOTES
[1]  Amended to reflect proper parties to this petition.
[2]  The statute authorizes incarceration in jail "within the time limit limits established for contempt of court." A judge-made finding of direct contempt of court can be punished by up to six months in jail. Aaron v. State, 284 So.2d 673 (Fla. 1973).
