Appeal from a judgment of the County Court of Albany County (Turner, Jr., J.), rendered August 31, 1987, which revoked defendant’s probation and imposed a sentence of imprisonment.
Defendant had pleaded guilty in County Court to criminal possession of a forged instrument in the second degree (attempting to cash a stolen check) and, on May 22, 1986, was sentenced to six months in jail and five years’ probation. As part of the bargain, he was to spend 12 to 18 months as an *484inpatient at a drug rehabilitation facility. On July 3, 1986, a violation of probation petition was filed alleging that defendant left the rehabilitation center on June 17, 1986 without permission and without contacting the Probation Department. Again, following plea-bargain negotiations, defendant pleaded guilty to violation of probation, acknowledged that no sentencing promises had been made and waived his right to appeal. On August 31, 1987, he received the maximum sentence allowed, i.e., 2 Vs to 7 years in prison, and now appeals contending that the sentence is harsh and excessive. The prosecution argues to the contrary and also urges enforcement of defendant’s waiver of his right to appeal.
The waiver of the right to appeal from a criminal conviction, entered as a condition of a negotiated plea agreement, has been the subject of several recent, conflicting decisions. In People v Ventura (139 AD2d 196, 203), the First Department invalidated the defendant’s waiver of his right to appeal on adverse suppression ruling, holding that the prosecution must demonstrate some "legitimate State interest” to justify the waiver. In People v Seaberg (139 AD2d 53), the Second Department upheld a defendant’s surrender of his right to appeal a jury verdict and adverse rulings at trial in exchange for a lenient sentence. In People v Bourne (139 AD2d 210, 212), the First Department, by a divided panel, held that a criminal defendant’s waiver of his appellate rights as part of a negotiated plea does not bar the Appellate Division from reviewing the sentence "as a matter of discretion in the interest of justice”. This court in People v Harvey (124 AD2d 943, lv denied 69 NY2d 746) and People v Lester (137 AD2d 871, lv denied 71 NY2d 898) has previously upheld waivers of the right to appeal (each from harsh and excessive sentences) where the sentence was lawful and the waiver knowing, voluntary and intelligent. We adhere to this position, while reiterating that waivers should not be exacted pro forma in every plea situation but only where dictated by the circumstances of the individual case confronted (see, supra, at 872).
In this case, defendant’s waiver was exacted during the plea allocution with no indication as to what the ultimate sentence would be. County Court demanded a comprehensive waiver of all defendant’s remedies, including his right to appeal, and defendant acceded, on the advice of counsel, only "to the extent permitted by law, if at all”. Moreover, County Court failed to identify any justifiable basis for exacting the waiver (cf., People v Williams, 36 NY2d 829, cert denied 423 US 873). In our view, the described circumstances simply do not evi*485dence a knowing, voluntary and intelligent waiver. Consequently, defendant’s purported waiver must be disregarded.
Turning to the merits, we are not persuaded by defendant’s characterization of the sentence as harsh and excessive, for the sentence was consistent with the plea agreement and within the statutory sentencing guidelines (see, People v Smith, 141 AD2d 988).
Judgment affirmed. Casey, J. P., Weiss, Mikoll, Yesawich, Jr., and Harvey, JJ., concur.