  We present the first realistic lattice QCD calculation of the $\gamma W$-box
diagrams relevant for beta decays. The nonperturbative low-momentum integral of
the $\gamma W$ loop is calculated using a lattice QCD simulation, complemented
by the perturbative QCD result at high momenta. Using the pion semileptonic
decay as an example, we demonstrate the feasibility of the method. By using
domain wall fermions at the physical pion mass with multiple lattice spacings
and volumes, we obtain the axial $\gamma W$-box correction to the semileptonic
pion decay, $\Box_{\gamma
W}^{VA}\big|_{\pi}=2.830(11)_{\mathrm{stat}}(26)_{\mathrm{sys}}\times10^{-3}$,
with the total uncertainty controlled at the level of $\sim1$\%. This study
sheds light on the first-principles computation of the $\gamma W$-box
correction to the neutron decay, which plays a decisive role in the
determination of $|V_{ud}|$.
