This study develops an ideal model of penitentiary law for Indonesia's correctional system through a comparative analysis with other legal frameworks. The study examines systems in South Africa, Thailand, the Netherlands, Germany, France, Japan, and Brazil using doctrinal normative legal research and comparative legal analysis. Primary sources include legal documents, statutes, relevant legislation, and scholarly literature. The findings reveal key components of an ideal penitentiary system: a rehabilitative legal framework that aligns punishment with rehabilitation; provisions for individualised assessment and treatment; a disciplined, transparent system for grievance handling; legislative support for educational and vocational programs; and policies for community reintegration. Notable contributions from other countries include Japan's rehabilitation system, the Netherlands’ alternative sentencing approach, Germany’s vocational training programs, France’s parole systems, South Africa’s restorative justice initiatives, and Thailand’s family connection efforts. Brazil's flexible sentencing and rehabilitation strategies to address overcrowding further inform the model. This research proposes a comprehensive penitentiary law framework emphasising legal pluralism, situational flexibility, robust regulatory mandates, and a balance between security and humane treatment. The model is designed not only for Indonesia but also offers a valuable reference for other nations, grounded in empirical research on corrections and recidivism, and adhering to international human rights standards for prisoner treatment.