ALBANY — In a rare defeat for prosecutors under “Megan’s Law,” the State Court of Appeals held yesterday that some sex offenders have a limited right to appeal orders that will subject them to registration and community notification rules after their release from prison.

It ruled last year that offenders have no right to appeal “risk level” assessments, which determine how much information about their crimes and their whereabouts may be given to the public. But in a unanimous opinion by Judge Joseph W. Bellacosa, the Court ruled yesterday that their certification as a sex offender is subject to criminal appeal because it is entered at the time of sentencing.