The young man behind the wall of wire mesh was smiling - a little surprisingly, as he was in Yemen's State Security Court on trial for his life.
Hisham Mohammed Assem, 19, is accused of killing a French businessman here in Sanaa on 6 October and wounding one of his British colleagues.
The prosecution alleges that he confessed to killing a foreigner after being incited by Anwar al-Awlaki, a leader of al-Qaeda in the Arabian Peninsula (AQAP) and so notorious that even though he is an American citizen, President Barack Obama has ordered his assassination.
Mr Awlaki and a relative were also on trial, in absentia. They are believed to be in hiding somewhere in the remote regions of Yemen.
I followed Hisham Mohammed Assem out of the court after the hearing and managed to talk to him after he was locked up in another wire cage.
He denied the charges, called al-Qaeda "destroyers" and said his confession had been extracted under torture.
He claimed he had a personal issue with the Frenchman, with whom he worked as a security guard. Mr Assem said he had intended to frighten him, but not to kill him.
Sitting with his wrists handcuffed, he told me he was smiling because his trial was a sham.
"It's a farce, not a court. The verdict is ready - it's a play. The hero is the prosecutor. And the director is the judge. They want to appease the West."
He bit his sleeve and hitched it up to show a mark he said was made while he was being tortured.
I have no idea whether the prosecutors are right about Mr Assem, or whether he is telling the truth.
But it seems clear that the trial is serving a wider political purpose for the Yemeni authorities. It was announced only after the two bombs that had been sent from Yemen as air freight were found.
The regime of President Ali Abdallah Saleh, embarrassed by what happened, is doing all it can to show that it is making moves against AQAP, which claims to have dispatched the two latest bombs.
Yemen has been concentrating minds in Western governments since Umar Farouk Abdulmutallab, another young man said to have been groomed by Anwar al-Awlaki, was caught apparently trying to blow up an airliner over Detroit last Christmas Day.
All this year, military and development aid to Yemen has been increased.
American pilotless drone aircraft have been firing missiles at ground targets, sometimes killing al-Qaeda operatives, sometimes killing innocent civilians.
The court case is something that President Saleh can offer in response to pressure from his allies to move against the organisation, which is showing signs of ambition and self-confidence.
President Saleh has kept power since he seized it in 1978 because he recognises that governing Yemen is a juggling act, needing the consent of as many of Yemen's powerful tribes as possible.
The new factor in 2010 has been that rich foreign countries, very concerned about al-Qaeda attacks coming out of Yemen, have been throwing their own balls into the game. They add big new complications to what was already complicated.
The West wants President Saleh to make al-Qaeda his number one security priority.
Counter-terrorism teams from Britain and the United States have been in Sanaa looking for information and delivering advice.
But President Saleh has other security preoccupations. He is also fighting an insurgency in the north, and a separatist movement in the south.
In the past, the president's behaviour has shown that he believes the internal opposition to be more of a threat to his regime than al-Qaeda.
Western diplomats believe they are slowly winning the argument that al-Qaeda is a threat to him as well.
It is also possible that he is sending out the signals they want to hear, in the hope of getting more deliveries of money and weapons.
Al-Qaeda is the reason why Yemen gets so much Western attention. But its problems go much deeper than that.
Many people in Yemen have hard lives, without much hope of anything better.
Yemen is the poorest Arab country. Yemen's small deposits of oil and gas are running out. A big chunk of officialdom is corrupt. The country has one of the highest rates of illiteracy in the world.
It is short of jobs and water, the population is growing fast and more and more people cannot afford enough food.
Resources are swallowed up by the production of khat, a mildly narcotic leaf. Chewing it is a national pastime but growing it uses up water and land that used to produce food.
The tourist trade used to be a good earner - Yemen is a stunningly beautiful country - but most foreigners have been scared off.
A diplomatic process called the Friends of Yemen, in which Britain and Saudi Arabia have been prominent, has been promising development aid in return for reform.
They want, at the very least, to stop Yemen's problems getting any worse. The idea is that development will continue in parallel with shorter-term action against AQAP.
At the Abu Bakr school just outside Sanaa, teachers and students do their best with limited resources.
Classes at the school have more than 100 pupils, but thanks to foreign aid administered by dedicated Yemenis in the Social Fund for Development, there is a computer room, a library and an exhibition of the children's arts and crafts.
The US, Britain and the others believe that development has to be part of the solution.
They recognise that a heavy-handed fight against Al-Qaeda in the Arabian Peninsula - whose numbers are thought to be in the hundreds, not thousands - will make matters here much worse.
"Eighty percent of the fight against terror is non-kinetic," said one Western diplomat in Sanaa who did not want to be named. "You can't just kill your way out of the problem."
But if the next attacks launched from Yemen succeed, remembering that principle might become more difficult.
Development takes time, and Western leaders who want to show that they are protecting their own people will always be impatient.