OPINION OF THE COURT
Donald J. Mark, J.This is an application pursuant to CPLR 7001, for a writ of habeas corpus to test the legality of the petitioner’s detention.
The petitioner was charged with loitering for the purpose of engaging in prostitution in violation of section 240.37 of the Penal Law. The petitioner was released upon $25 bail and as an additional condition of her release the local criminal court imposed a curfew between 8:00 p.m. and 8:00 a.m. Eight days after her release she was arrested for allegedly violating the said curfew. The petitioner challenges the summary revocation of bail upon the ground that the curfew condition was illegal.
The ingenuity of the Judge of the local criminal court cannot be denied. He obviously was cognizant that loitering for the purpose of prostitution causes citizens who venture into public places to become the unwilling victims of repeated harassment, interference and assault upon their individual privacy (Legislative Findings; McKinney’s Cons Laws of NY, Book 39, Penal Law, § 240.37, Pocket Part [1977-1978]). Nevertheless, no matter how laudatory was the Judge’s motive, the deprivation of liberty resulting from a revocation of bail is a serious matter and must be buttressed by a real showing of *666the reasons therefor (People ex rel. Shapiro v Keeper of City Prison, 290 NY 393).
Although not determinative of this novel issue, it should be noted at the outset that both the arrest of the petitioner and her summary revocation of bail were not in compliance with CPL 530.60. The proper procedure is to require the defendant to appear before the court, by a bench warrant if necessary, in order for the court to review its release of the defendant on recognizance or bail (People v Gruttola, 72 Misc 2d 295).
This State takes the position that the scope of the right to pretrial release is a matter of legislative discretion (People v Wirtschafter, 305 NY 515). For example, the Court of Appeals was unwilling to adopt a nonfinancially oriented system of bail similar to that contained in section 3146 of title 18 of the United States Code. (People ex rel. Gonzales v Warden, 21 NY2d 18.)
Admittedly CPL 530.10 makes no reference to the release of a defendant upon conditions. That section may be compared with the above Federal statute which authorizes the release of a defendant upon certain conditions to assure his presence (United States v Smith, 444 F2d 61, cert den 405 US 977; Iowa Code Ann, Code Crim Pro, § 811.2, subd 2 [which provides for the release of a defendant upon such conditions as will reasonably assure his appearance]; State v Fenton, 170 NW2d 678).
Thus, it is apparent that the authority to place restrictive conditions upon the pretrial release of a defendant, if it can be found at all, must emanate from a source other than our statute.
There are three situations which affect the pretrial release of a defendant: (1) the necessity to ensure the defendant’s response to the processes of the court, (2) the necessity to protect potential witnesses from the defendant and (3) the necessity to protect the community from a dangerous defendant.
New York obviously embraces the first situation. The purpose of requiring the defendant to post bail after his arrest is to ensure his appearance in court (CPL 510.30, subd 2, par [a]; People ex rel. Lobell v McDonnell, 296 NY 109; People ex rel. Shapiro v Keeper of City Prison, 290 NY 393, supra; People ex rel. Weisenfeld (Citone) v Warden, 48 AD2d 789, rev on other grounds 37 NY2d 760; Bellamy v Judges and Jus*667tices, 41 AD2d 196, affd 32 NY2d 886; People ex rel. Schweizer v Welch, 40 AD2d 621; People v Dizdar, 91 Misc 2d 23).
Although there is no statutory authority in New York for the second situation, caselaw recognizes denial or revocation of bail in those situations where the defendant would present a danger to potential witnesses if permitted to remain at liberty (People ex rel. Klein v Krueger, 25 NY2d 497; People ex rel. Feldman v Warden, 48 AD2d 789, rev on other grounds 37 NY2d 760; People v Gruttola, 72 Misc 2d 295, supra).
In this State there is likewise no statutory authority for the third situation. Despite this lack two pre-CPL cases held that danger to the community was a ground for denial of bail (People v Melville, 62 Misc 2d 366; People v Wasmund, 16 Misc 2d 111). These holdings were apparently sanctioned by Carbo v United States (369 US 868). However, the concept of preventative detention was specifically deleted from the bail provisions of the CPL (Denzer, Practice Commentaries, McKinney’s Cons Laws of NY, Book 11A, CPL 510.30). In a post-CPL case, People ex rel. Schweizer v Welch (40 AD2d 621, supra) the Appellate Division, Fourth Department, reversed a lower court denial of bail predicated upon the sole ground of danger to the community.
The lack of statutory authority to impose conditions on the defendant’s pretrial release does not mean that a court is powerless in this area. The course of the common law in England and the development of the common law and statutory law in the United States demonstrate that the courts have the inherent power to place restrictive conditions upon the release of a defendant (United States v Smith, 444 F2d 61, cert den 405 US 977, supra). However, it would seem axiomatic that such power can only be exercised for a legally permissible purpose.
A legally permissible purpose is to assure the defendant’s presence or to protect potential witnesses; a legally impermissible purpose is preventative detention. Accordingly the imposition of the curfew on the petitioner being for the ostensible purpose of the latter was for a legally impermissible purpose and was an invalid condition.
There is another reason why the release of the petitioner in this case upon condition that she observe a curfew is illegal.
Since the charge against the defendant is a violation (Penal Law, § 240.37, subd 2), the local criminal court has no discretion in determining whether or not the petitioner should *668be released, since she has an absolute right to bail or recognizance (CPL 530.20, subd 1). The result of course is different in a felony case (CPL 530.20, subd 2; 530.40, subd 2). If the court found it necessary to review its order of bail or recognizance, since the petitioner was entitled as of right to bail or recognizance in the first instance, she could not be denied bail upon the court’s second review (CPL 530.60).
Simply stated, this means that upon the petitioner’s arraignment it was mandatory that she be released upon bail or recognizance. In the event the court received information that the petitioner intended to flee the jurisdiction, it could order her arrest, conduct a hearing and reconsider the criteria set forth in CPL 510.30. If the court determined that the allegation was true, it possessed the authority to require higher but reasonable bail, but it had to again order bail. Under no circumstances could the court deny the petitioner’s release on bail on the second occasion.
It cannot be seriously contended that the petitioner could be penalized more severely for disregarding her curfew, revocation of bail, than she could for planning to leave the court’s jurisdiction, ordering of higher bail.
The condition sought to be placed upon the petitioner by the local criminal court can only be imposed upon her if she is subsequently convicted. A sentence of probation is not authorized because the charge is a violation (Penal Law, § 65.00; People v Vargas, 82 Misc 2d 49). A sentence of conditional discharge for 12 months would be an authorized disposition (Penal Law, § 65.05) and a curfew as a condition of discharge would be permissible (Penal Law, § 65.10, subd 1; see People v Fortunato, 50 AD2d 38).
The problem which the local criminal court feels justifiably obligated to control pretrial is unfortunately beyond its jurisdiction and should be addressed by the Legislature (see 13 Vt Stats Ann, § 7554; State v Roessell, 132 Vt 634).
Therefore, the curfew imposed upon the defendant as a condition of her pretrial release on bail is illegal as was her subsequent revocation of bail. Accordingly the application for a writ of habeas corpus is sustained and the petitioner is ordered released from detention.