Recently colossal positive volume thermal expansion has been found in the framework compounds Ag3Co(CN)6 and Ag3Fe(CN)6. Phonon spectra have been measured using the inelastic neutron scattering technique as a function of temperature and pressure. The data has been analyzed using ab-initio calculations. We find that the bonding is very similar in both compounds. At ambient pressure modes in the intermediate frequency part of the vibrational spectra in the Co compound are shifted to slightly higher energies as compared to the Fe compound. The temperature dependence of the phonon spectra gives evidence for large explicit anharmonic contribution to the total anharmonicity for low-energy modes below 5 meV. We found that modes are mainly affected by the change in the size of unit cell, which in turn changes the bond lengths and vibrational frequencies. Thermal expansion has been calculated via the volume dependence of phonon spectra. Our analysis indicates that Ag phonon modes in the energy range from 2 to 5 meV are strongly anharmonic and major contributors to thermal expansion in both compounds. The application of pressure hardens the low-energy part of the phonon spectra involving Ag vibrations and confirms the highly anharmonic nature of these modes.