JEFFREY Archer, Jonathan Aitken, Lord Watson, and even Tommy Sheridan have gone through a similar experience. I'm being photographed, searched, and my belongings are taken from me and placed in a sealed bag. Then the questions begin.

"Are you feeling suicidal? Do you have a psychiatric history or record of violence? Are you feeling anxious? Have you been in prison before? Do you require protection?"

A Reliance prison custody officer maintains eye contact as she interviews me in the cells area of Glasgow Sheriff Court. I'm anxious, certainly, because I've agreed to be a prisoner for the day, but not yet suicidal. But yes, I would like protection.

On my personal escort record (Per) she ticks the boxes next to weapons and psychiatric illness. Things are not really looking up. Alongside 118 other suspects, I'm appearing from police custody on a Monday morning to see behind the scenes of Europe's busiest court, and to get a first-hand impression of the service provided by Reliance, the private company which took over the prisoner escort contract almost three years ago.

Police still staff Scotland's courts but, with senior officers openly debating the need for greater civilianisation, removing them from the courts altogether looks increasingly likely. In future, the onus on Reliance may be even greater. Next week, a new bail regime is due to be introduced which could see the prisoner transfers increasing.

Unlike many in the cells, deep in the bowels of the building, I already know that I'm going to be remanded and, rather unusually for a woman, I'm being sent to Barlinnie.

After just a few minutes, I can see why many of them are keen to get back to prison. An all-male Victorian jail is almost appealing compared to the stench of the cells here which no amount of bleach is capable of masking. The aroma of urine, disinfectant, sweat, and meat pie is exacerbated by the din of men and women shouting, the metal clanging of gates, keys, and handcuffs.

"A lot of the guys have been in police cells all weekend and are fairly highly strung by the time we get them on the Monday morning," says Charlie Horton, the senior custody officer at Glasgow.

Scanning down the list of names and numbers to be held in about 48 cells, the logistical problems become apparent. In addition to the 118 appearing from police custody, there are some 65 from prison. Two of the men have suspected TB, many are HIV positive, others have Hep C or are disabled. Sworn enemies have to be held separately, as do sex offenders.

Walking down the narrow corridor past the cells, Mr Horton explains that the men often spit and throw cups of urine through the bars. Several of the staff say they've been spat at. The secret is to ensure it doesn't go into your mouth or eyes. I clamp my mouth shut and, for once, feel blessed by glasses.

Smoke wafts through the iron bars of one cell. Although every single prisoner has been searched by the police or prison and the Reliance staff, Mr Horton says some of them still manage to smuggle goods in. Cigarettes are like gold dust. Custody staff are not allowed to conduct internal examinations and the preferred method of eluding confiscation is "banking".

Everyone gets access to a lawyer and a lunch of Scotch pie, chips, and beans. The pie's not too bad, but eating chips with a spoon feels particularly unnatural and there's nowhere obvious to wash your hands. "The food's much better than it used to be," one of the male prisoners points out helpfully.

After lunch, the staff are told the court computer system has gone down, meaning serious delays. The custody court - or "cutter court", as it's known by prisoners and staff - is likely to go on until 9pm at least. None of the staff complain, since it's not an uncommon occurrence on a Monday.

Connecting the cells to the cutter is a complex warren of stairways. Each of the prisoners is handcuffed to a custody officer and taken up, one by one, to stand in the dock. At the behest of the sheriffs, they are uncuffed just before they appear. This protects their right to a fair trial, but can cause security problems.

Between April 2006 and March 2007, there were 13 escapes or releases in error, several of which involved uncuffed prisoners making a run for it through the open court. This is a marked improvement on previous figures.

The majority involved prisoners released in error because the appropriate paperwork was not passed on in time. All those granted bail are held for at least an hour to check with fiscal and police that there are no outstanding warrants, but sometimes the information comes in too late.

"We go the extra mile in trying to prevent releases in error, but a lot of it still relies on word of mouth," says Jim Greenoak, the head of operations who took over after Reliance's initial teething problems.

"In the past, if a police officer lost someone while putting them into a van, no-one would ever know. Nothing was ever recorded. We're moving 16,000 people monthly, 35% higher than the numbers we expected. Of every 1000 prisoners transferred, we've got the rate of error down to 0.08%.

"And we're going to introduce a bar code procedure in the sheriff court - like in Tesco's - so every time you make a court appearance, get a visit from your lawyer or go to the toilet, the officer can just run your Per across it."

In times past, prisoners were transferred by police and prison staff. In March 2004, the contract was privatised and handed to Reliance. In the first week, convicted murderer James McCormick, 17, was released from Hamilton Sheriff Court after a mix-up with papers involving another prisoner. After being on the run for 17 days, he handed himself in.

Jokes about the reliability of Reliance became commonplace and another 22 prisoners were either released in error or escaped in that first 12 months. Since then, security measures have been tightened considerably, but escapes do still take place. Assaults too. In 2004, convicted murderer James O'Rourke stabbed a Reliance officer at Edinburgh High Court. Knowing that only serves to heighten the tension and need for vigilance in the cells area.

"We've had cases of some of the girls slipping the cuffs," says David Rutherford, Reliance manager for the west of Scotland. "Some of them are double-jointed and that's not something you can tell from an initial assessment. Some of their wrists are so thin they try to get them off even when we pad them out. Others try to use hospital visits as an opportunity to get away."

Under the seven-year contract with the Scottish Government, which is estimated to be worth £126m, Reliance is fined some £20,000 for every one of these incidents.

Not only does the company transfer prisoners from prison to court and back, but also provides home leave escorts, transfers prisoners to weddings and funerals, and takes them to hospital appointments. In total last year, the company made some 188,000 transfers.

In addition, if someone is arrested in England or Wales with an outstanding Scottish warrant, Reliance has to get them to the right court north of the border by the next lawful day. Prisoners are flown and driven up every day. On Friday, one prisoner had to be taken from Southampton to Aberdeen. Reports suggest they have freed up the time of some 300 police officers and 200 prison staff.

Some of the transfers are more sensitive than others. Reliance recently transferred an eight-and-a-half month pregnant woman from Cornton Vale to Wick for a court appearance. The fact she had to travel to Wick at all raises some interesting questions.

In total, during my day as a prisoner, Reliance is moving 985 other people. One man has to be transferred from Canterbury to Dumfries, and another from Charing Cross to Inverness.

I have far less distance to travel. After the cutter court, it's decided that I should be taken to the infamous Bar-L, as if to serve a six-month prison sentence. My hands are cuffed together and my right wrist is cuffed to a custody officer who walks me to the big white van outside.

Mr Greenoak points out reassuringly that there is an emergency escape hatch in the roof in case of a crash. I'm told to be prepared for the rocking as the van gets closer to the prison. Neither piece of information proves comforting.

Once seated, one set of cuffs is removed, but only when the security chain is secured on the door does my custody officer remove the handcuffs connecting us.

As the door is double locked on my 2ft 6 by 2 ft10 transfer cell (it is, at least, 6 ft 5 high), I get a sense of the isolation prisoners must feel. It's suddenly very quiet. Whatever you've done, you're completely on your own now.

Other than the names of Paddy and some of my other predecessors who "wis here", there's nothing to decorate the cell unit. The window on to Glasgow is a Godsend for passing the time and a distraction from the claustrophobia.

We're almost at the prison gates before the others realise I'm on board. "There's a lassie. There's a lassie on the van," shouts one man. "What you doin' goin' tae Barlinnie? What you done? Ye should be on a van to Cornton Vale."

The man opposite seems less concerned. "You wannnae share my cell?" he asks. "I've got a pure cosy cell with a teddy bear called Muhammad."

"You should be careful," I suggest. "You could end up going to prison for that." They both laugh.

"I'm in for attempted murder. What've you done that's so bad to go to Barlinnie?" the first guy asks, his face pressed to the cell window diagonally opposite mine. "I'm a journalist," I tell him. "Oh dinnae worry, you can share my cell anyway," he says.

Inside Barlinnie, my paperwork is checked and the sealed bag containing my possessions is handed over to prison staff. I'm fingerprinted, photographed and again asked a series of questions about my mental state. I'm shuttled from one tiny cell to another and then taken to see two nurses who go into more details about my physical and mental health.

Growing prison overcrowding and the revolving door nature of reoffending means the staff here at Scotland's largest jail will have to process some 90 inmates this evening.

If I had really committed a crime serious enough to warrant being here (pretending for a moment that those incarcerated here have committed a serious crime, although the figures indicate many have simply failed to pay fines), then I would now face being strip-searched before being taken to the first night hall and having prison policy explained.

Thankfully, the pretence can end before that. I'm free to go.