Have you ever climbed to the top of Tantallon Castle? Up the ancient stairway and then onto the battlements, and finally the narrow ledge that gives you incredible views over the sea? In a way, even though he was a prisoner, Alexander of Islay must have felt at home here.

He was the Lord of the Isles, the great clan chief of Clan Donald, who dominated and ruled the west coast of Scotland and a good deal of the Highlands. In fact, one of the reasons Alexander was imprisoned in the castle in 1429 was because of the threat he posed to the Crown. The Lords of the Isles were getting very powerful, ruling over a vast sway of Gaelic-speaking Scotland.

Alexander stayed for two years at Tantallon. He was imprisoned by James I, after Alexander had led 10,000 clansmen and devastated and burned Inverness. James set off to challenge him, and the armies met where Fort Willliam now sits. Many of Alexander’s allies had deserted him and the battle was a victory for the king.

So the great Highland chief had to do a deal. I am sure it was all arranged in advance, but the show of humility and contrition was important. Alexander arrived at Holyrood and fell to his knees in front of the king, begging for mercy, and handing over his sword. James was dismissive, lecturing the chief, maintaining a sense of suspense as to whether Alexander’s life would be saved.

His queen intervened, asking her husband to be merciful. It was a great show and all arranged in advance no doubt, to demonstrate royal power and authority.

And so Alexander was imprisoned in Tantallon. I can’t help thinking that Alexander himself asked for this location. He had the sea-blood of Vikings in his veins, and what better place for a descendant of Somerled than a cliff-top castle in which the smell and sound of the sea is a constant?

Which part of the castle did he stay? And was he allowed out? I have to be honest, I don’t know how those two years were lived. But it must have been a time when Tantallon felt like a Highland capital. While he was confined here, Alexander’s nephew Donald led the clan.

I thought of Alexander’s confinement when I visited Tantallon recently. But also reflected that this great fortress has been a prison for many people. Most, unlike the chief Alexander, are nameless and unrecorded by history.

I ventured down into the pit prison and stood under the narrow window, looking up to the sky. I was aware that I was standing on the same spot that many prisoners must have stood in the past, looking out at a narrow slit of daylight. It’s very unlikely Alexander was confined here, but perhaps he was for a short time, as a kind of timeout room if he didn’t follow the rules.

Today, the pit prison has modern lighting and has a helpful wooden stair to help you descend from the door onto the uneven floor of the pit.

But of course, such health and safety features were not in place for the prisoners who occupied this place centuries ago. They would have been thrown from the doorway onto the floor of the semi-darkened room. The narrow strip of daylight from the window would have been the only source of light.

Well, it’s not really a window, it’s a steeply sloping narrow shaft with an opening at the top. All you can see is a slither of the sky. Occasionally, if you stare for long enough, a sea bird will flash by. The opening is enough to see if it is a sunny or cloudy day. It also allows sound to enter the chamber, for as I stood there I could hear the sea and the clatter of seagulls.

And there was one other thing I noticed. While the opening at the top is very narrow, the shaft opens out as it descends into the prison. Was this to allow more light? Or was it to provide an illusion that escape might just be possible, if you could only just find a way to squeeze yourself through the narrowest part at the top?

Better than no light at all, of course, but I couldn’t help thinking that I would have very quickly gone mad down there, staring out to the sky, sensing the sounds and smells of freedom, feeling they were almost within reach. I think I would have tried to twist and contort my body, and attempt to squeeze out of the place. It would be totally impossible, of course, but it seemed to me that was the main purpose of this window shaft. It gives a glimpse and taste of the free world outside, so near, yet impossible to reach. Yet despite the obvious impossibility, I am sure some tried it.

Within a minute, I was out and back in the sunshine and fresh air. The towering walls of the magnificent castle surrounded me, the Bass Rock glazed in the sea, and the seagulls I had heard while in that dark hole were now swarming around above me. I had been down there only 10 minutes, but I still appreciated the return to freedom. A simple stroll taken for granted by one person can be an impossible journey for another.

Alexander’s status ensured that his imprisonment was much more comfortable, and it also finally assured him of release, despite his previous actions against the king. He was set free in 1431, and I am sure that his time there was not all bad. Not so the poor wretches held in that dark pit of the same castle, they did not share the privileges bestowed by birth.

Perhaps we should all visit that dark, grim chamber and stand in that space for a few moments, and feel the connection to those who once stood on the same exact spot but inhabited a very different reality. They lived in a world of barbaric bullying, where life was cheap if you were poor, and most people were very poor. Justice was the whim of powerful men, and most people must have lived in a near-constant state of anxiety and sense of vulnerability.

And of course, escape from status in those days was nearly just as impossible as escape from Tantallon’s pit prison, unless allowed by those with power and privileges of birth.

Thank goodness things are so different today, was my first thought as I ventured back into the light, but then a second thought came; for many people, are things really so different?

How many people today are in Tantallon’s pit prison, not literally but metaphorically? Looking out from where they are confined but knowing they will never squeeze through that narrow gap of opportunity, and so they give up even on the thought of escape? That is the metaphor that followed me after my visit to Tantallon Castle’s pit prison. It’s kind of an occupational hazard as a storyteller; you get stalked by metaphors.

I had gone to the castle to seek the footsteps of a powerful clan chief but as I drove home I could only think of the different treatment that status and privilege creates, and of the people still trapped in a place they would certainly not be in if only they had been luckier at the time of their birth, or if circumstances had been different. And who are the gatekeepers of their prison’s door?

We can draw our own lists, but the importance I think is to recognise that people are still confined and longing for someone or some policy to recognise that they just can’t squeeze out of that wee gap. Thoughts flooded my brain: poverty can be inherited as well as wealth; marginalisation is not the fault of those marginalised; there would be no stairs if we were all in wheelchairs. They stalked me on the drive home along the coast road. But then after I had driven through the delightful town of Aberlady and was passing a shimmering sea, another image came to me: of a Syrian mother holding onto a suitcase in the sea trying not to drown. Her story is too awful to recount here.

“For goodness sake,” said my daughter, as I shared my thoughts in the car, “can we not just visit a place without you getting all heavy? I mean it’s a castle, how did you get onto all that?” She was right, I suppose, but also so was I. The double standards, the unequal treatment, the one rule for them and one rule for the others, and the absence of humanitarian empathy was all too evident the moment I switched on the TV news. In many ways, times have not changed so much since Alexander of Islay was imprisoned in Tantallon; just the context and extremities of it.

Next time I visit Tantallon it will be Cromwell’s time I will be thinking of. My daughter can’t wait for that!