A prisoner who slashed an inmate’s neck with a sharpened chunk of plastic has been handed a new sentence after the judge deemed him to be a danger.