Keep IK Controller Leveled
This is a duplicate question, but it’s a duplicate of something I asked. Yes, thankfully you can easily limit how bones behave with IK. Go to the bone properties tab, and look for “IK settings.”