Our Dragon's Dogma 2 The Caged Magistrate Guide will go over how to complete this main story quest, along with another task that you must complete along the way.
The Caged Magistrate Quest Guide
After reaching Vernworth and meeting Captain Brant, he'll start to give you quests at the bar. For one of these, "The Caged Magistrate", Brant asks you to free Magistrate Waldhar from prison and gives you a key that works on every cell door in the jail.
Once you reach the jail, try to open the lock (first one on the right, guy should be on the bed) while the guards aren’t looking. Their AI is a bit bugged, so they might attack you anyway. Let them arrest you if that happens (they’ll never kill you) then leave your cell and the prison using the key to automatically get all of your items back.
When you talk to Magistrate Waldhar, he says that he won't leave unless you find somewhere with lots of books. This is tied to another quest in the town slums called "The Heel of History".
The Heel of History Guide
Talk to Kendrick in the slums (he'll be asking for donations outside of The Gracious Hand) and donate money and/or food (doing both triggered the next dialogue for us). He’ll tell you of a bot that has suddenly gone missing.
After accepting The Heel of History, talk to the girl at the back of the The Gracious Hand. She’ll mention that the missing boy has gone to the vaults. Head back to Kendrick, and follow him afterwards to remove the rubble nearby. After that, head inside and explore until you find the boy, Malcolm.
Malcolm will lead you further into the ruins, resulting in you finding a hidden library and completing the quest.
From there, head back to the jail and tell Waldhar about the vault. You can safely escape the prison with him via the back exit, using the key you got from Brant. Reach outside and Waldhar will make his way to the vault.
Heading back to Brant will complete the quest. Note that you must give back the key before the quest is considered complete. You can make a forgery of it by heading to the Scrap Trader in the Rest Town to the west of Vernworth (the northwest oxcart can take you there quickly).
That's all for our Dragon's Dogma 2 The Caged Magistrate Guide! Make sure to check out more of our guides below.