An approach is presented to design inertial-fusion capsules compensated for time-dependent radiation-drive asymmetries. This approach uses in depth variable doping of the capsule ablator, i.e., the addition of small amounts of material to tailor the opacity. Simulations show that an inertial-fusion capsule, using a beryllium ablator variably doped with gold, can be designed to compensate for a constant P(2) radiation asymmetry as high as 20% and still produce nominal yield (80% of a symmetrically driven capsule). In contrast, without variable doping the P(2) asymmetry must be less than 2% to obtain nominal yield. Similarly encouraging results are obtained for modes P(1), P(4), and P(6). Simulations also demonstrate that variable doping can compensate for nearly arbitrary time-dependent radiation-drive asymmetries by varying the polar dependence of the doping fraction with depth.