Juliet Davidson was arrested when prison officers observed her acting suspiciously during a prison visit.
Leeds Crown Court heard Davidson committed the offence when she visited a man at HMP Doncaster on March 29, 2019.
Officers monitoring CCTV cameras became suspicious when they noticed her fiddling with her clothing and constantly looking around the room.
Shortly before the end of the visit she was seen embracing the prisoner and passing him something from the area of her waistband.
The prisoner was searched and found in possession of a package containing 10.9g of tobacco, 1.3g of cocaine, 30.8g of cannabis and a further 8.8g of cannabis.
Davidson was detained and told prison staff: "I admit everything. I have nothing to add. I am trying to do the right thing."
The 42-year-old said she believed the package contained tobacco, cannabis and pepper.
A further 15.9g of cannabis was found when officers searched her home.
Jessica Randell, prosecuting, said Davidson was interviewed by police and said she did not know the inmate but had been ordered to deliver it to him to pay off her own drug debt.
The defendant said she had covered the package with pepper so dogs at the prison would not detect it.
Davidson said she took the drugs into the prison after being threatened.
She said she had done 'dummy runs' by passing biscuits to the prisoner on previous visits before taking the drugs into the jail.
Davidson, of Brown Royd Avenue, Huddersfield, pleaded guilty to supplying a class A drug, supplying a class B drug and possessing a class B drug.
Imran Khan, mitigating, said Davidson had got into debt after relapsing into drug use as a result of an abusive relationship.
Mr Khan said his client worked as a cleaner for West Yorkshire Police and worked for the Holiday Inn.
Davidson, who appeared in court via a video link from HMP New Hall, was jailed for two years.
Judge Simon Phillips QC said: "Taking drugs, including class A drugs, in to prison spreads addiction and misery.
"It spreads disorder and unbalance in the prison estate.
"People taking drugs into custody should expect a custodial sentence and should expect immediate custody."