Context. The survey of the COSMOS field by the VLT Survey Telescope is an appealing testing ground for variability studies of active galactic nuclei (AGN). With 54 r-band visits over 3.3 yr and a single-visit depth of 24.6 r-band mag, the dataset is also particularly interesting in the context of performance forecasting for the Vera C. Rubin Observatory Legacy Survey of Space and Time (LSST). Aims. This work is the fifth in a series dedicated to the development of an automated, robust, and efficient methodology to identify optically variable AGN, aimed at deploying it on future LSST data. Methods. We test the performance of a random forest (RF) algorithm in selecting optically variable AGN candidates, investigating how the use of different AGN labeled sets (LSs) and features sets affects this performance. We define a heterogeneous AGN LS and choose a set of variability features and optical and near-infrared colors based on what can be extracted from LSST data. Results. We find that an AGN LS that includes only Type I sources allows for the selection of a highly pure (91%) sample of AGN candidates, obtaining a completeness with respect to spectroscopically confirmed AGN of 69% (vs. 59% in our previous work). The addition of colors to variability features mildly improves the performance of the RF classifier, while colors alone prove less effective than variability in selecting AGN as they return contaminated samples of candidates and fail to identify most host-dominated AGN. We observe that a bright (r 21 mag) AGN LS is able to retrieve candidate samples not affected by the magnitude cut, which is of great importance as faint AGN LSs for LSST-related studies will be hard to find and likely imbalanced. We estimate a sky density of 6.2 × 10 6 AGN for the LSST main survey down to our current magnitude limit. Observations were provided by the ESO programs 088.D-4013, 092.D-0370, and 094.D-0417 (PI G. Pignata). well as the mechanisms by which gas feeds them; and, given the reach to high redshifts, allow for the investigation of the formation and coevolution of SMBHs, their host galaxies, and their dark matter halos over most of cosmic time. The main LSST survey (Wide-Fast-Deep survey, WFD) will focus on an ≈18,000 sq. deg. area, which is expected to be surveyed ≈1, 000 times in 10 yr, using about 90% of the observing time. About 2-4% of the remaining time will be devoted to ultra-deep surveys of well-known areas, collectively referred to as deep drilling fields (DDFs; e.g., Brandt et al. 2018; Scolnic et al. 2018), where extensive multiwavelength information is available from previous surveys. The first 10 yr observing program includes a proposal for high-cadence (up to ∼14, 000 visits) multiwavelength observations of a ≈9.6 sq. deg. area per DDF, down to ugri ∼28.5, z ∼28, and y ∼27.5 mag coadded depths. Given all of that, the DDFs will be excellent laboratories for AGN science. The current selection of DDFs includes the Cosmic Evolution Survey (COSMOS; Scoville et al. 2007b) Article number, page 1 of 25