Kyle Neil Cooper, of Aitken Street in Accrington, appeared at Mold Crown Court on Thursday for sentence.
The 34-year-old had previously admitted conveying a prohibited item into HMP Berwyn in Wrexham on October 26, 2019.
Mark Connor, prosecuting, told the court on the day in question Cooper had been bringing a parcel of steroid tablets to an inmate.
Prison officers became suspicious when he was at the visitor centre entrance but wouldn’t disclose which prisoner he intended to visit.
Officers saw him pass on an item to inmate Saqib Khan, 35.
Khan was later searched and found to be in possession of the film-wrapped package, which contained just under 200 tablets.