A semi-analytical framework for predicting the onset of sand production in a horizontal well is presented. The approach couples the flow in perforation tunnels with flow in the wellbore itself, to obtain a more accurate estimate of maximum sand free production rate in a well. The elastic equations of equilibrium are combined with the Mohr–Coulomb failure criterion to calculate the critical radius. A numerical, iterative solution method is used to compute the location of the elastic-plastic zone during well production. Instead of computing the pressure change in a cavity, which is difficult to characterize and implement in practice, the proposed model integrates the cavity stability criteria into the perforated wellbore inflow model to determine maximum sand-free wellbore flow rate. In addition to the typical perforation tunnel parameters such as cohesive strength, friction angle and perforation radius considered in past efforts, pressure loss effects in a wellbore (wall friction, acceleration, and fluid mixing) are incorporated into the proposed model. A numerical shooting method is then used to iteratively arrive at the maximum sand free rate for a perforated horizontal wellbore in a reservoir of known properties. Results show that without incorporation of the inflow model, the predicted maximum sand-free rates from prevailing approaches can be over-optimistic. The proposed method can be used to optimize perforation parameters to prevent sanding when designing well completions.