  Context. Cosmic rays (CRs) play an important role in the chemistry and
dynamics of the interstellar medium. In dense environments, they represent the
main ionising agent, driving the rich chemistry of molecular ions and
determining the ionisation fraction, which regulates the degree of coupling
between the gas and magnetic fields. Estimates of the CR ionisation rate
($\zeta_2$) span several orders of magnitude, depending on the targeted sources
and on the used method.
  Aims. Recent theoretical models have characterised the CR attenuation with
increasing density. We aim to test these models for the attenuation of CRs in
the low-mass pre-stellar core L1544.
  Methods. We use a state-of-the-art gas-grain chemical model, which accepts
the CR ionisation rate profile as input, to predict the abundance profiles of
four ions: $\rm N_2H^+$, $\rm N_2D^+$, $\rm HC^{18}O^+$, and $\rm DCO^+$.
Non-LTE radiative transfer is performed to produce synthetic spectra based on
the derived abundances. These are compared with observations obtained with the
Institut de Radioastronomie Millim\'etrique (IRAM) 30m telescope.
  Results. Our results indicate that a model with $\zeta_2 > 10^{-16} \rm \,
s^{-1}$ is excluded by the observations. Also the model with the standard
$\zeta_2 = 1.3 \times 10^{-17} \rm \, s^{-1}$ produces a worse agreement with
respect to the attenuation model based on Voyager observations, which has an
average $\zeta_2 = 3 \times 10^{-17} \rm \, s^{-1}$ at the column densities
typical of L1544. The single-dish data, however, are not sensitive to the
attenuation of the CR profile, which changes only by a factor of two in the
range of column densities spanned by the core model. Interferometric
observations at higher spatial resolution, combined with observations of
transitions with lower critical density are needed to observe a decrease of
$\zeta_2$ with density.
