Gravitational-wave observations of extreme mass ratio inspirals (EMRIs) offer the opportunity to probe the environments of active galactic nuclei (AGN) through the torques that accretion disks induce on the binary. Within a Bayesian framework, we study how well such environmental effects can be measured using gravitational wave observations from the Laser Interferometer Space Antenna (LISA). We focus on the torque induced by planetary-type migration on quasicircular inspirals, and use different prescriptions for geometrically thin and radiatively efficient disks. We find that LISA could detect migration for a wide range of disk viscosities and accretion rates, for both $\alpha$ and $\beta$ disk prescriptions. For a typical EMRI with masses $50M_\odot+10^6M_\odot$, we find that LISA could distinguish between migration in $\alpha$ and $\beta$ disks and measure the torque amplitude with $\sim 20\%$ relative precision. Provided an accurate torque model, we also show how to turn gravitational-wave measurements of the torque into constraints on the disk properties. Furthermore, we show that, if an electromagnetic counterpart is identified, the multimessenger observations of the AGN EMRI system will yield direct measurements of the disk viscosity. Finally, we investigate the impact of neglecting environmental effects in the analysis of the gravitational-wave signal, finding 3$\sigma$ biases in the primary mass and spin, and showing that ignoring such effects can lead to false detection of a deviation from general relativity. This work demonstrates the scientific potential of gravitational observations as probes of accretion-disk physics, accessible so far through electromagnetic observations only.