Stephen Cobb hung himself with a bedsheet from an upper bunk in a cell on 30 April, 2008.
Sheriff James Scott led a fatal accident inquiry in the death of the 23-year-old, who was from Jedburgh in the Borders.
The sheriff heard evidence to determine whether "reasonable precautions" may have prevented his suicide, or whether there were "defects" in the prison system which contributed to his death.
Sheriff Scott found that Scott "acted upon his suicidal ideation when the opportunity presented itself" for reasons which "will forever remain uncertain".
Cobb was serving 30 months for a brutal assault on Steven Frater.