Measurements are presented of W gamma gamma and Z gamma gamma production in proton-proton collisions. Fiducial cross sections are reported based on a data sample corresponding to an integrated luminosity of 19.4 fb(-1) collected with the CMS detector at a center-of-mass energy of 8 TeV. Signal is identified through the W -> lv and Z -> ll decay modes, where l is a muon or an electron. The production of W gamma gamma and Z gamma gamma, measured with significances of 2.6 and 5.9 standard deviations, respectively, is consistent with standard model predictions. In addition, limits on anomalous quartic gauge couplings in W gamma gamma production are determined in the context of a dimension-8 effective field theory.