A young mother who tried to smuggle heroin into prison for her ex-partner was detected by a sniffer dog.
It was concealed in a straw under her clothing, Luton Crown Court was told.
She had also left six wraps of the drug in her handbag in a locker at Bedford Prison where visitors have to put their possessions.
Selina Hewitt, 25, of River View, Shefford, was jailed for 18 months yesterday after pleading guilty to possessing heroin with intent to supply and simple possession of the same drug.
Judge Michael Kay QC told her: “Courts take a very serious view of such actions because of the very dangerous nature of drugs within a prison environment.
“Sentences have to be a deterrent and yours would have been longer were it not for your two very young children.
“It is particularly sad that you did not have regard to the needs of your children when you took it upon yourself to take drugs into prison."
Prosecutor Natalie Carter said Hewitt, whose children are one and two, went to visit Dean Mays on June 18.
He was her former partner and serving a sentence at Bedford prison. There had been suspicions about him receiving drugs and a dog which can detect drugs was on patrol.
The dog stopped by Hewitt and she produced the straw and admitted what she had done.
Her handbag was searched and six wraps of heroin were found there.
Andel Singh, defending, said: “She was put in an invidious position under duress to supply these drugs. She is an extremely vulnerable young woman who is a recovering addict herself. She clearly had second thoughts which is why she left the majority of the drug in her handbag.”