A man who was detected with cannabis outside Magilligan Prison appeared at Coleraine Magistrates Court on Friday where he was fined £150.
John Stephen McKee (39), of Carlisle Road, Belfast, was caught on April 7 this year.
At court he pleaded guilty to possessing a Class B drug.
The drugs were in the glove box of a vehicle.
A defence solicitor said there had been no attempt to take the cannabis into the jail.