A robotic arm control system including a medical instrument to beinserted into a body-part, a force sensor to detect force applied by theinstrument tothe body-part, a robotic arm attached to the instrument, a first positionsensor totrack an instrument position of the instrument in the body-part, a secondpositionsensor 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 oftheinstrument relative to the body-part, compare the detected force applied bytheinstrument to a permitted force level for application to an anatomical.feature at thecomputed location and send a control command to, or cut power of, the roboticarmto loosen a rigidity of at least one robotic joint in response to the detectedforceapplied by the instrument being greater than the permitted force level.