
682 N.W.2d 688 (2004)
Eddie Dee LOYD, petitioner, Respondent,
v.
Joan FABIAN, et al., Appellants.
No. A03-1779.
Court of Appeals of Minnesota.
July 13, 2004.
Bradford W. Colbert, Legal Assistance to Minnesota Prisoners, William Mitchell College of Law, St. Paul, MN, for respondent.
*689 Mike Hatch, Attorney General, Kari Jo Ferguson, Assistant Attorney General, St. Paul, MN, for appellants.
Considered and decided by KLAPHAKE, Presiding Judge; SCHUMACHER, Judge; and STONEBURNER, Judge.

OPINION
ROBERT H. SCHUMACHER, Judge.
Commissioner of Corrections Joan Fabian and warden Connie Roehrich appeal from a district court order denying respondent Eddie Dee Loyd's petition for writ of habeas corpus but ordering that his period of extended incarceration be limited to 30 days pursuant to a contract signed by Loyd prior to his entering a drug-treatment program. Fabian and Roehrich argue that the document signed by Loyd is not an enforceable contract. We reverse.

FACTS
In February 1999, Loyd pleaded guilty to felony drive-by shooting in violation of Minn.Stat. § 609.66, subd. 1(e) (1998). He was sentenced to 126 months in prison. While incarcerated, Loyd completed an alcohol and drug assessment, which recommended that he be placed in a drug-treatment program. Loyd was informed that the recommended treatment was mandatory, and if he failed to participate he would receive an extended incarceration period. Minn.Stat. §§ 244.03, .05, subd. 1b(b) (2000), provide that the Commissioner of Corrections may discipline inmates with extended incarceration for violating disciplinary rules or refusing to participate in rehabilitative programming.
In August 2001, prior to entering a drug-treatment program, Loyd signed a document with the title "Minnesota Correctional FacilityLino Lakes, TRIAD CENTER, PROGRAM CONTRACT." Above Loyd's signature, the document contained the following statement: "I have received and understand the orientation manual. I agree to abide by all Institutional policies and rules. I agree to abide by all TRIAD Center rules now in effect or which, from time to time, may be amended." A TRIAD staff member also signed the document.
Offender Disciplinary Regulation 510 provides a penalty of extended incarceration for inmates who fail to complete mandated treatment. At the time Loyd signed the "program contract" and entered the TRIAD program, an inmate's first violation of Regulation 510 resulted in 30 days of extended incarceration if the inmate pleaded guilty. Seven days after Loyd entered TRIAD, all inmates received a memorandum explaining a new penalty structure for Regulation 510. Under the new policy, which became effective September 17, 2001, an inmate's first violation would generally result in 90 days of extended incarceration.
In November 2001, the TRIAD program placed Loyd on probation for lack of progress, lack of effort, and unwillingness to work with the treatment process. Approximately two weeks later, Loyd was "terminated" from the program for lack of progress, poor motivation, and being argumentative with peers and staff. Thereafter, he received notice of violating Regulation 510 based on his termination from the TRIAD program. Loyd waived his right to a hearing, admitted violating Regulation 510, and received a punishment of 90 days of extended incarceration.
Loyd filed a petition for writ of habeas corpus. In his petition, Loyd argued the 90 days of extended incarceration should be rescinded because the treatment program violated his constitutional rights because the program required him to read *690 and write and he was illiterate. In the alternative, Loyd argued that 60 of the 90 days of extended incarceration should be returned because at the time he entered the program the applicable punishment was 30 days of extended incarceration.
The district court denied Loyd's request for an evidentiary hearing and denied his petition for writ of habeas corpus, determining Loyd's constitutional claim was not valid. The court, however, ordered Loyd's release date changed to reflect 30 days of extended incarceration instead of the 90 days imposed by the department of corrections. The court concluded that the parties should be held to the contract signed in August 2001, which the court found restricted the department to imposing the 30-day penalty that was in place at the time the parties entered the contract.

ISSUE
On a petition for writ of habeas corpus, did the district court err in ordering an inmate's release date be changed pursuant to a program contract between the inmate and the department of corrections?

ANALYSIS
A writ of habeas corpus is a statutory civil remedy available "to obtain relief from [unlawful] imprisonment or restraint." Minn.Stat. § 589.01 (2000). The scope of inquiry in habeas corpus proceedings is limited to constitutional issues, jurisdictional challenges, claims that confinement constitutes cruel and unusual punishment, and claims that confinement violates applicable statutes. See, e.g., Kelsey v. State, 283 N.W.2d 892, 894-95 (Minn.1979) (stating habeas corpus may be used to test whether denial of parole violates applicable statutes or constitutional provisions and to test allegations that confinement conditions constitute cruel and unusual punishment); State of Minn., ex rel. Griep v. Skon, 568 N.W.2d 453, 454-55 (Minn.App.1997) (reviewing district court denial of habeas petition where petitioner claimed hearing officer lacked jurisdiction and disciplinary proceeding allegedly violated due process). Habeas is also an appropriate remedy if the relief to which a petitioner may be entitled is immediate release. Kelsey v. State ex rel. McManus, 309 Minn. 560, 561, 244 N.W.2d 53, 54 (1976). "The burden is on the petitioner to show the illegality of his detention." Case v. Pung, 413 N.W.2d 261, 262 (Minn.App.1987), review denied (Minn. Nov. 24, 1987).
On appeal, neither party contests whether the district court acted outside the permissible scope of a habeas corpus proceeding in considering Loyd's argument that the department of corrections should be held to the terms of the program contract in punishing Loyd's failure to comply with a mandated drug-treatment program. We therefore independently determine this issue. See Minn. R. Civ.App. P. 103.04 ("The appellate courts may reverse, affirm or modify the judgment or order appealed from or take other action as the interest of justice may require.").
Loyd filed a petition for writ of habeas corpus, arguing his constitutional rights were violated because the treatment program required him to read and write, and he is illiterate. The district court found Loyd's constitutional claim was not valid. In addition to his claim of a constitutional violation, Loyd requested relief on a contract theory. The contract theory did not allege illegality based on a statutory or constitutional violation, raise a jurisdictional challenge, claim that Loyd's confinement constitutes cruel and unusual punishment, or argue that Loyd was entitled to immediate release. As such, habeas corpus was not available to challenge the extended incarceration period on the contract theory. *691 The district court erred in granting relief on an issue outside the permissible scope of a habeas corpus proceeding.
Even if the district court had the authority to determine the contract issue, we note that a valid contract did not exist between the parties. "The factor that distinguishes an unenforceable promise from an enforceable contract is consideration, or the voluntary assumption of an obligation by one party upon condition of an act or forbearance by the other." Murray v. MINNCOR, 596 N.W.2d 702, 704 (Minn. App.1999) (quotation omitted), review denied (Minn. Sept. 28, 1999). Under Minnesota statues, the commissioner of corrections must provide appropriate mental health programs and has the authority to discipline inmates who violate disciplinary rules or refuse to participate in rehabilitative programming by imposing a "disciplinary confinement period." Minn.Stat. §§ 244.03, .05, subd. 1b(b).
By signing the "program contract", Loyd agreed with the statements that he had received an orientation manual and would abide by institutional and TRIAD rules and policies. Although a staff signature is present on the form, this signature at most acknowledges what the commissioner is already obligated and authorized to doprovide rehabilitative programs and enforce disciplinary rules. See Murray, 596 N.W.2d at 704 (holding agreement signed by prison inmate was not contract enforceable against department of corrections where agreement did not bind department in any way, but rather fulfilled requirements of the Ashurst-Sumners Act). The document Loyd signed does not bind the department of corrections in any way and therefore is not an enforceable contract.

DECISION
In a writ of habeas corpus petition, the district court erred in ordering Loyd's release date be changed when the issue on which relief was granted was outside of the permissible scope of inquiry.
Reversed.
