Underground voids of natural or anthropogenic origin potentially represent a serious hazard to the built-up areas. Urban development and construction of infrastructures often is carried out without taking into account the possibility of encountering subsurface cavities, and the corresponding danger these might pose. In addition, loss of memory of man-made cavities under the historic part of many towns adds further problems. Evaluation of the stability of rock masses in underground setting is not an easy matter, since it requires, in addition to the geological and engineering background, speleological skills and techniques in order to explore and survey the cavities, identify the type of failures occurring therein, and collect the data necessary for the implementation of specific numerical analyses. In this paper we present an approach involving cavers, geologists and engineers to assess the rock mass stability in natural and man-made caves, aimed at determining the control of rock failures in the formation of sinkholes. The methodology is described through the application to a natural karst cave and an anthropogenic cavity in Apulia, SE Italy. In both cases, following a detailed speleological survey which is specifically addressed to define the complete cave topography, the geo-mechanical characterization of the carbonate rock mass was carried out, and the data so obtained were used to evaluate the rock mass stability by means of numerical codes.