Imagine for a moment, if you will, that prison is not just a place to punish people but to change them. Imagine that when a man (for it is usually men) is taken in handcuffs from his community and placed behind bars, that he will be there for only a fraction of his life. One day, weeks, months or years later the cell door will be opened and that same man will be released and sent home.

Of the 18,000 inmates released from Scottish prisons each year some 98% will go directly from a high-security jail to the outside world. Most will just have enough money for the bus or taxi fare.

A tiny proportion, some 300, will have a more-gradual, controlled reintroduction through the open estate. They consider themselves the lucky few, but to entertain this privilege they must have proved to staff that they have stopped taking drugs and that they pose a low-enough risk to the public. The majority of those sent to the open estate at Castle Huntly or Noranside are serving long sentences, including murderers serving life, because they tend to be the most institutionalised and those in greatest need of a phased return to life on the outside.

Robert Foye was serving a nine-and-a-half-year sentence for attempted murder when he escaped last summer and went on to rape a 16-year-old girl.

"The question," says Gary, who has been a prisoner at Castle Huntly, near Dundee, for almost two years, "is whether you think it's more dangerous to get people gradually used to the outside world and prepare them with skills and education or whether you just want to kick them out the door? If you send people straight out from closed conditions, what a shock they'll get. They'll just revert straight back to their old ways of crime or drugs.

"You have to understand that this is a jail, not a holiday camp. We are told what to do and when to do it.

"Leaving a long jail sentence straight from closed conditions is a dangerous thing. When Foye absconded there was a lockdown and we all sat with our heads in our hands. There's always a bad apple in every cart but he's messed it up for everyone else."

Going up the driveway to Castle Huntly, Scotland's main open prison and the place from which Foye absconded, feels like approaching a country house hotel. The label "open prison" is such a misnomer it is difficult to know what to expect.

The most surprising element of Castle Huntly lies in what is absent here. From the castle there is a panoramic view, the reality of which is initially frightening. This is a prison without walls, without a fence, without barbed wire.

Prisoners stroll freely around the grounds below in differently coloured fleeces. In the bright spring sunshine it is difficult to tell them from staff working in the gardens, setting down paving slabs and supervising the prison's recycling project.

Much of the grounds would be impossible to differentiate from any other countryside. Closer to the castle's keep, there are modern accommodation blocks, a football pitch, indoor gym and dining area.

Security at the prison is based on a combination of CCTV, staff expertise and trust. Numbers are checked by staff at 7am, 11.30am, 4pm and 9pm when the doors to the accommodation wings are locked. In between times, inmates are trusted to get on with their work, to study or attend the gym.

"It's about getting people prepared for release and getting them to stand on their own two feet," one member of staff explains. "The system is based on trust. There are prisoners who've been inside for so long they've forgotten how to cross a main road and can't buy milk from a shop because there's such a confusing number of different coloured bottle tops now."

On average there are 80 absconds from prisons each year, almost all of them from the open estate. This is compared to at least 50,000 opportunities. Of those who do escape, only a tiny proportion go on to reoffend but for the family of the girl who was raped this can be no compensation whatsoever. And Foye is not the only prisoner to have escaped and committed a violent crime while on the run.

Joseph Moran, 45, killed Annie Shankland, 86, in her home in 1987 and, two years later, was sentenced to a minimum of 15 years by the High Court in Glasgow. In December 2004, he absconded from Castle Huntly, carried out a serious indecent assault and was jailed for three years.

Seen in context, it's worth bearing in mind that of the 17,700 people leaving the closed prison estate each year, some 52% go on to reoffend within two years.

Even Victim Support Scotland says that it supports the principle of the open estate and the phased reintroduction of certain offenders back to the community.

"Guys are not absconding because of this place," says Alex Campbell, who is finishing his sentence in Castle Huntly. "They're absconding because of problems with their families or because they've failed a drugs test and they're worried about being sent back to the closed prison."

Campbell, 26, of Alloa, has been in Castle Huntly for seven weeks.

"We are getting a chance here - a chance to get more integrated with society and to get back in touch with our families," he says. "It's about having a better chance when we get out. You have to go through a lot of hoops to get here in the first place. You get a couple of people acting like idiots and absconding and then the press writes bad stuff about all of us."

As the Scottish Prison Service published its internal review yesterday, 140 prisoners - half of the current population at Castle Huntly - were out on their daily work placement.

Every weekday, the inmates assessed as being suitable go out to work in Dundee, Cupar and Perth. Most get bused out to their jobs with opticians, joiners, charities, car mechanics and timber yards. Some drive themselves in company vehicles.

In recent years, some 30 of them have been taken on full-time, once they have finished their sentences.

"There is a lack of skilled labour in the market so companies are happy to take people once we explain that we are responsible for them," says Alan Weir, who has run the placement programmes for the past 11 years. "Some companies are not so keen but usually once we've spoken to them we can allay their fears.

"Some of the employers also allow the guys to bring the company vans back here for the night. We have got half a dozen vans that come back here every night. In 11 years, of all the opportunities that they've had, we've only had three prisoners disappear while they were on placement."

For at least the first month the new inmates work or study inside the grounds rather than being allowed out, to give staff the opportunity to monitor their progress. Like being in the open prison, work placements and home leave are seen as opportunities to be cherished. Those who fail drugs or alcohol tests or refuse to work lose such privileges.

Random drug tests are a regular event. This month to date there have already been 176 tests on inmates. Fewer than 20% have tested positive. The majority of these pertain to men in their first few weeks at the open prison.

Those who have two or three negative tests are sent straight back to the closed prison estate where research suggests, in comparison, that 50% test positive for illegal drugs.

Foye had tested positive once but had since given two negative tests, the requisite under open prison protocols for being allowed off the grounds.

"The preconception is that people just get to walk out the door once they get here, but that's not the case at all," says Stewart Tweedie, the lifer liaison officer at Castle Huntly.

"What we do find is that they have unrealistic expectations of what life will be like after 15 or 20 years in prison. It is about supporting them through the home adjustments which have taken place. Often they come back from their first home leave feeling quite frightened."

The question as to why Foye was sent back to the open estate after he had already absconded once remains to be answered. But the most enduring concern on driving away from the grounds is not why we have an open estate, but why such a tiny proportion of Scotland's burgeoning prison population is prepared and monitored for release this way.