Devon Hennessy (26), with an address at Edgewood Lawn, Blanchardstown and co-accused Leon Travers (24), from Whitestown Drive, Mulhuddart, Dublin 15, were arrested on Friday.
They were held overnight at Ronanstown Garda Station and appeared at Dublin District Court on Saturday.
Gardaí charged Mr Hennessy with attempting to convey an unnamed article into prison and drugs offences: possessing benzodiazepines in his car and having them for sale or supply at Cloverhill Road.
Judge Dermot Dempsey heard Mr Hennessy made no reply to the charges.
Mr Travers is also accused of the same drugs offences. He had no reply when charged, said Garda Jennifer Desmond.
There was no objection to bail subject to conditions.
Defence solicitor Tertius van Eeden told Judge Dempsey the terms had been agreed.
Judge Dempsey ordered Mr Hennessy to keep away from Cloverhill Prison and the surrounding areas.
Furthermore, he warned him he could not contact his co-accused directly, indirectly or through social media.
He ordered Mr Hennessy to sign on twice a week at his local Garda station.
Mr Travers was also directed to stay away from the prison and warned not to contact Mr Hennessy.
Gardaí are seeking directions from the Director of Public Prosecutions.
The two men did not address the court and have not indicated how they would plead.
Judge Dempsey granted legal aid and an order for disclosure of prosecution evidence to the defence.
He set bail at €300 in each case.
They were ordered to appear again on November 12.