Limit amount of sharpening and Noise reduction in out of focus areas

When there is no specific object to detect, ie scene with stones pebbles etc in the foreground, or branches in a tree. Adding enough sharpening on the in-focus areas causes halos in the out of focus.
For example, a slider that says beyond this blur reduces noise/sharpening applied blur-based object selection. My workflow deals with this by having a sharpen/ noise reduction layer and none sharpen/ reduction layer in Photoshop and masking.