Flood and debris flow are the main contributor of mountain hazards in China. Along these years, due to the space limitation, buildings, which are the main element at risk, are mostly located at debris flow alluvial fan. This have led to buildings extreme vulnerable when mountain hazards occur. Based on the characteristic of debris flow impact and structural behavior of masonry structure, failure mechanism of the masonry brick wall is identified. The bending stress failure criteria of brick wall is calculated based on the debris flow velocity and depth. Failure curve of brick walls are constructed to assess wall failure subject to different flow velocity and depth. Base on the result, two structure optimization plan are proposed. The brick wall failure model and optimization plan is verified by a masonry building at Qi Pan Valley after a devastating debris flow event on 2013. The advantages and limitations of two structure optimization plan were discuss.