Limit distance on two axis only?

So I know the limit location constraint can be used to limit an object to a rectangular area, and the limit distance constraint can be used to limit an object to a spherical area, but how can I constrain the location to a cylindrical area?

I’m sure there is a way to do this with drivers, but I’m not sure about the exact steps to accomplish this.

Context details: I’m building a rig in which I want a control bone that a user can animate to be constrained within a circle on the x and y axis with respect to another bone but be free to move larger distances along the z axis. I’d like to define the radius of this circle/cylinder using a custom property (that can be set to different values but won’t be animated).

Anyone know a good way to do this?

Alright. So I managed to constrain to a circle as I wanted using drivers and some trig, but it is still glitchy and gets “stuck” when I try to move the bone around the edge. I would like to be able to move the bone inside and around the edge of the circle without hiccups. Worst case scenario this solution works, but there’s got to be a better way to do this.

Here’s the blend so you can see what I am talking about. The small z-facing bone is the one that is constrained in a circle along the global xy plane.