Caprock integrity is a primary criterion for evaluating depleted oil and gas reservoirs for long‐term safety of carbon dioxide geosequestration. The occurrence of capillary leakage is inevitable in caprock. This phenomenon occurs whenever the buoyancy pressure due to accumulated CO2 plumes dominates the capillary pressure of caprock, and thereby the plumes intrude into the pore throats. In this study, experimental investigation of the effective parameters, including overburden pressure, ambient temperature, and CO2 impurities in the form of non‐condensable and non‐reactive CH4 and N2 gases on the capability of shale and anhydrite cores to preserve CO2 gas is conducted. In this regard, capillary breakthrough pressure and CO2 gas effective permeability analysis were performed applying two distinct techniques, step by step and residual capillary pressure. Experiments were conducted at the temperatures of 35, 70, and 90 °C and overburden pressures in the range of 3500–5800 psi. Two main seal rocks, including shale and anhydrite core samples, from middle Asmari and Gachsaran formations of the Zagros Basin located in the southwest of Iran were used. Regarding the high capillary breakthrough pressure and low gas effective permeability after outbreak of the leakage, all three parameters have noticeable effects on capillary sealing efficiency of the caprocks. The results indicate that impurities such as CH4 and N2 have a significant effect on capillary breakthrough pressure of caprock and gas effective permeability. © 2015 Society of Chemical Industry and John Wiley & Sons, Ltd