## 2 Simulation Setup  
The setup for the proposed attosecond LWFA-based ICS source is shown in Figure 1a. An intense femtosecond pulse drives laser-plasma wakefield, with a near-threshold ionization injection proposed to generate a density-modulated electron bunch. Downstream of the LWFA stage, a 20 \(\upmu\)m thick aluminum (Al) foil is positioned along the propagation axis of the driving laser pulse. The Al foil is ionized by the rising edge of the laser pulse, forming a plasma mirror that effectively reflects the pulse. This approach ensures the inherent temporal and spatial overlap between the backward-propagating pulse and relativistic electrons, which is crucial for ICS. Upon collision with the micro-bunched electron beam, the reflected laser pulse emits a train of high-energy gamma-ray pulses.  
Two-dimensional(2D) PIC simulations use the EPOCH open-source plasma physics simulation code [29]. A \(y\)-direction polarized laser with a Gaussian profile \(a=a_{0}\exp(-{(t-t_{0})}^{2}/\tau^{2})\exp(-{y^{2}}/{w^{2}})\) propagates along the \(+x\) direction, where \(a_{0}=eE_{0}/m_{e}\omega_{0}c=1.5\) is the normalized amplitude of the laser field, \(2\tau\sqrt{\ln 2}=30\,\mathrm{fs}\) is the full width at half maximum (FWHM) pulse duration of the laser, and \(w=w_{0}\sqrt{1+{(x_{0}/x_{R})}^{2}}\). The laser is focused at \(x_{0}=200\)\(\upmu\)m with a beam waist of \(w_{0}=20\)\(\upmu\)m and \(x_{R}=\pi w_{0}^{2}/\lambda_{0}\) is the Rayleigh length with \(\lambda_{0}=800\) nm. A two-staged LWFA structure is proposed with a gas mixture for injection and a pure gas plasma for acceleration [30]. The doped gas mixture is set as N\({}^{5+}\) ions with a concentration of \(n_{\mathrm{N}^{5+}}=0.1n_{0}\). N\({}^{5+}\) ions locate from \(x=0\) to \(x=300\)\(\upmu\)m, with a 200 \(\upmu\)m long up-ramp, and a flat of 50 \(\upmu\)m with a 50 \(\upmu\)m long down-ramp. Pre-ionized plasma has an electron density of \(n_{0}=n_{\mathrm{He}}+5n_{\mathrm{N}^{5+}}=5\times 10^{18}\) cm\({}^{-3}\) as the density profile shown in Figure 1b. The simulation window has a dimension of 40 \(\upmu\)m \(\times\) 80 \(\upmu\)m with 2000 \(\times\) 1200 cells in the \(x\) and \(y\) directions, respectively. This corresponds to the cell sizes of 0.025\(k_{0}^{-1}\) in the \(x\) direction and 0.08\(k_{0}^{-1}\) in the \(y\) direction, respectively. Each cell contains 4 macroparticles. When the laser passes through the plasma, the pre-ionized electrons (i.e., pre-ionized from  
Figure 1: The schematic diagram of attosecond inverse Compton scattering source from laser wakefield acceleration. (**a**) cartoons for ICS process. Attosecond micro-bunched electron beams produced by LWFA scatter the laser pulse reflected from a fully ionized Al foil plasma. (**b**) The plasma density profiles used in the simulation setup.  
the Helium atoms and the \(L\)-shell of nitrogen) form the plasma wake, and electrons from the \(K\)-shell of nitrogen are tunneling ionized and trapped by the wake.  
Downstream of the LWFA stage, a 100 \(\upmu\)m long plasma downward density ramp (DDR) is introduced at \(x=1.90\) mm to guide the electron beam into the vacuum. Following this, a plasma with electron density \(n_{p}=10^{5}n_{0}\simeq 292n_{c}\) is set as a fully ionized Al foil, where \(n_{c}=1.71\times 10^{21}\)cm\({}^{-3}\) is the critical density for the laser wavelength \(\lambda_{0}=800\) nm. The Al plasma is positioned at \(x=2.06\) mm with a thickness of 20 \(\upmu\)m. The numbers of particles per cell for photons and Al species are set to 100. In the open-source EPOCH 2D PIC code, the nonlinear Compton scattering emission and bremsstrahlung studies used the Monte Carlo algorithm already implemented in the code [31; 32]. While the driving laser pulse was effectively reflected by the plasma mirror, ICS gamma-ray photons could pass through the foil with the Bremsstrahlung radiation. In our case, the laser field is significantly weaker than the Schwinger field, so photon emission occurs in the non-QED regime [33].