Optical rest-frame spectroscopic diagnostics are usually employed to distinguish between star formation and active galactic nucleus (AGN) powered emission. However, this method is biased against dusty sources, hampering a complete census of the AGN population across cosmic epochs. To mitigate this effect, it is crucial to observe at longer wavelengths in the rest-frame near-infrared (near-IR), which is less affected by dust attenuation and can thus provide a better description of the intrinsic properties of galaxies. AGN diagnostics in this regime have not been fully exploited so far, due to the scarcity of near-IR observations of both AGN and star-forming galaxies, especially at redshifts higher than 0.5. Using Cloudy photoionization models, we identified new AGN – star formation diagnostics based on the ratio of bright near-IR emission lines, namely [SIII] 9530 Å, [CI] 9850 Å, [PII] 1.188 μm, [FeII] 1.257 μm, and [FeII] 1.64 μm to Paschen lines (either Paγ or Paβ), providing simple, analytical classification criteria. We applied these diagnostics to a sample of 64 star-forming galaxies and AGN at 0 ≤ z ≤ 1, and 65 sources at 1 ≤ z ≤ 3 recently observed with JWST-NIRSpec in CEERS. We find that the classification inferred from the near-IR is broadly consistent with the optical one based on the BPT and the [SII]/Hα ratio. However, in the near-IR, we find ∼60% more AGN than in the optical (13 instead of eight), with five sources classified as “hidden” AGN, showing a larger AGN contribution at longer wavelengths, possibly due to the presence of optically thick dust. The diagnostics we present provide a promising tool to find and characterize AGN from z = 0 to z ≃ 3 with low- and medium-resolution near-IR spectrographs in future surveys.