The Brig in Atlantis and presumably other City-ships as well, are used to lock away dangerous people or prisoners. It is a large room with non-touching cells in the middle. Each cell is a large cage with horizontal bars and a powerful force field spanning across the sides. This field does not allow material to pass through and is only deactivated (on the opening side) when the cell is opened.
The cells have been used by the Atlantis expedition to hold Wraith prisoners and even Richard Woolsey and Major General Jack O'Neill during the Asuran occupation of Atlantis. The cells aboard the Asuran City-ship held Lt. Colonel John Sheppard's team along with Dr. Elizabeth Weir. (SGA: "Suspicion", "Progeny", "The Siege, Part 1", "The Return, Part 2")
Following the Replicator invasion, McKay secretly installed a voice command override on the brig in case he ever got trapped again like during the invasion. During the Second Battle of Atlantis, McKay was able to use the override to vocally give his code from inside the cell and escape. (SGA: "Inheritors")