Angela Baillie, 32, from Newton Mearns, admitted passing heroin and valium to a prisoner in Glasgow's Barlinnie jail.
The High Court in Edinburgh was shown evidence from a psychiatrist confirming Baillie was unfit to leave the premises where she was being treated.
Defence QC Paul McBride said the solicitor has bi-polar disorder. She will be sentenced on 20 April.
Mr McBride indicated he will make a plea for leniency on grounds of diminished responsibility.
He said doctors believe that at the time of the offence, Baillie was suffering "a major depressive episode".
In February, she appeared at the High Court in Paisley and admitted being concerned in the supply of heroin and diazepam.
This is cache, read story here