In medieval times, this was given quite a lot of thought as castles were designed in most cases to survive a siege.
Food is an issue during a siege to be sure, but water more so; this ties into the law of 3s; you can survive 3 minutes without oxygen, 3 days without water and 3 weeks without food. These are of course approximations, but you get the general idea. Water was always going to be the biggest problem in a siege as humans (and stock) need to drink so much of it and don't live well without it.
Also, it wasn't uncommon for the wells outside a castle to be poisoned in times of conflict; there was often minimal security on the outside of the castle wall by comparison to inside so wells were often targeted as a weak point in a castle's supply chain.
How do you fix this? You dig a castle well. Most castles had one of these, and many of them had to be dug very deep thanks to the fact that the castle was often built on top of a defensible hill. The point being, that your castle most likely has a well and so long as you give your king access to it you're all set.
But (I hear you say), isn't that a risk? Can't the king escape that way? Well, no. He could commit suicide by jumping down the well head first if he had a good reason to do so but wells are not vertical tunnels to a cave system; they generally just go down deep enough that the groundwater levels are now above the lowest part of the well, which then means that the bottom of the well fills up with water from the groundwater supply.
Ideally, you'd have servants fetch the water to the room in which he is incarcerated, but depending on how malevolent your gryphon is, making the king walk down the tower stairs, draw his own water and carry it back to his room each day might be a fitting insult to rub salt into the wounds of the king as well. Either way, the point is that your king is unlikely to have to leave the castle in order to get to a water supply, which is good news for your gryphon in terms of security, but bad news for the king if he's out of shape from sitting on a throne 10 hours a day for the past few years.