The confession dial was a small, circular disk used as part of a Gallifreyan ritual act of purification. It allowed a dying Time Lord to face their demons and make their peace before their mind was uploaded to the Matrix. (TV: Hell Bent) It was often referred to as the last will and testament of a Time Lord. According to ancient tradition, it was to be delivered to their closest friend on the eve of their final day. (TV: The Magician's Apprentice)
However, it could be re-purposed to expose someone to their greatest fears to drive them to confess; if the person did confess they would be released, otherwise they would be killed. The Twelfth Doctor's confession dial was used in this manner by the Time Lords. However, the Doctor was able to escape after being trapped for four and a half billion years. (TV: Hell Bent)
The Doctor's confession dial
After being summoned by Davros, the Twelfth Doctor left a confession dial with Ohila for her to deliver to Missy. (WC: Prologue) Missy brought it to Earth and met with Clara Oswald, and explained that the confession dial was to be given to a Time Lord's best friend prior to their death. Clara attempted to pick the dial up, believing that it was intended for her, but it responded by shocking her. Missy explained the confession was for herself, and would only open after the Doctor died. She took it with her to Essex in 1138 and to Skaro. (TV: The Magician's Apprentice)
Davros came into possession of the dial after he and the Daleks took the Doctor, Clara and Missy prisoner. When the Dalek city was destroyed by decaying Dalek mutants revived by regeneration energy, the Doctor took back the confession dial. (TV: The Witch's Familiar)
The Twelfth Doctor gave the confession dial to Mayor Me just before Clara Oswald's death in the trap street she governed. (TV: Face the Raven) He himself was subsequently teleported inside it, where he was pursued through a castle by a veiled creature from his nightmares which sought to force him to confess his knowledge of "the Hybrid". After entering into a recurring loop of dying and reloading himself from the teleport's hard drive, he finally broke free and passed through a portal to outside the device, and found himself on Gallifrey, (TV: Heaven Sent) finally discovering that his prison had been his own confession dial.
After escaping, the Doctor made his way to the barn of his childhood where he stayed until Rassilon came to face the Doctor himself. When Rassilon arrived, he tried to shake the Doctor's hand, but the Doctor instead dropped the confession dial at his feet and ordered Rassilon to "get off my planet." Rassilon explained that the Doctor had information they needed on the Hybrid and if he'd told them what they'd wanted to know, he could've walked out of the confession dial. The Doctor was unimpressed and just reiterated his order, exiling Rassilon and later the High Council. He later expressed his disgust to Ohila that the Time Lords had used his confession dial to create their own personal torture chamber for him. The Time Lords later extracted Clara from the last second before her death at the Doctor's request. However, she was distraught to see their time apart affected him adversely. The Doctor tried to dodge questions from Clara about his time away from her, but finally revealed he was tortured over the span of four and a half billion years. Clara told the Time Lords that they were monsters that were hated by everyone, especially her. (TV: Hell Bent)