Volcanic ash and pyroclasts can weld when deposited hot by pyroclastic density currents, in near-vent fall deposits, or in fractures in volcano interiors. Welding progressively decreases the permeability of the particle packs, influencing a range of magmatic and volcanic processes, including magma outgassing, which is an important control on eruption dynamics. Consequently, there is a need for a quantitative model for permeability evolution during welding of ash and pyroclasts under the range of conditions encountered in nature. Here we present in situ experiments in which hydrous, crystal-free, glassy pyroclasts are imaged via x-ray tomography during welding at high temperature. For each 3D dataset acquired, we determine the porosity, Darcian gas permeability, specific surface area, and pore connectivity. We find that all of these quantities decrease as a critical percolation threshold is approached. We develop a constitutive mathematical model for the evolution of permeability in welding volcanic systems based on percolation theory, and validate the model against our experimental data. Importantly, our model accounts for polydispersivity of the grainsize in the particle pack, the pressures acting on the pack, and changes in particle viscosity arising from degassing of dissolved H2O during welding. Our model is theoretically grounded and has no fitting parameters, hence it should be valid across all magma compositions. The model can be used to predict whether a cooling pyroclast pack will have sufficient time to weld and to degas, the scenarios under which a final deposit will retain a permeable network, the timescales over which sealing occurs, and whether a welded deposit will have disequilibrium or equilibrium H2O content. A user-friendly implementation of the model is provided.