Drugs could be smuggled into Dartmoor Prison by inmates who had been on day release working in the community, an inquest has heard.
Robert Taylor, 27, from the West Midlands, died in his cell after a heroin overdose in October 2006.
Prison officer Keith Fergus said there was a "strong possibility" of inmates bringing drugs into the jail.
The inquest heard that Taylor may have got a large quantity of heroin the day before his death.
The hearing was also told that Taylor, who had been on suicide watch, had told prison authorities that he was depressed following the death of his mother.
His uncle, Paul Harris, said his nephew had a troubled childhood with a history of minor crime.
The inquest at Devon County Hall in Exeter continues.