A robotic arm control system including a medical instrument to be inserted into a body-part, a force sensor to detect force applied by the instrument to the body-part, a robotic arm attached to the instrument, a first position sensor to track an instrument position of the instrument in the body-part, a second position sensor to track a body position of the body-part, and a controller to compute, responsively to the instrument position and the body position, a location of the instrument relative to the body-part, compare the detected force applied by the instrument to a permitted force level for application to an anatomical feature at the computed location and send a control command to, or cut power of, the robotic arm to loosen a rigidity of at least one robotic joint in response to the detected force applied by the instrument being greater than the permitted force level.