If you're asking 'how do we test the vaccine without _trying_ to give people HIV", one option is to give it to a lot of people, and record their outcomes over time.
But first you need to prove the vaccine isnt like, super toxic in humans. So you do animal analog tests, then a limited test on humans, aka "Phase 1 trials". A previous article summarizes:
> Moderna’s vaccines passed Phase I testing earlier this year, which involves testing for safety using only a handful of human volunteers. Phase II tests for a vaccine’s overall effectiveness, and with the move into Phase III, Moderna will be looking at its efficacy versus other prevention treatments currently on the market, such as pre-exposure prophylaxis, also known as PreP.
- https://www.them.us/story/moderna-begins-hiv-vaccine-trials-...
https://clinicaltrials.gov/ct2/show/NCT05001373?id=NCT050013...
Edited because my previous version was possibly wrong.
HIV can stay in the body for years before developing AIDS. So you can actually recruit people that have been tested positive recently and have not developed the disease.