No — this is khalwah, which is forbidden. The Prophet ﷺ said, "No man should be secluded with a woman except in the presence of a mahram" (Sahih al-Bukhari 5233), and "It is not permissible for a man to be alone with a woman, and no woman should travel except with a mahram" (Sahih al-Bukhari 3006). The ruling turns on the seclusion itself, not on how trustworthy the two people believe themselves to be — which is why the Prophet ﷺ warned even about the husband's own relatives: "the in-law is death" (Sahih al-Bukhari 5232). Working in a shared office, studying in a classroom, or riding with others present is not khalwah; what is prohibited is the two of them being closed off where a third person could not ordinarily enter, whether that is a locked room, a private clinic, or a long car journey alone.
Q&A · Women in Islam
Can a woman be alone with a non-mahram man, such as a driver, colleague, or private tutor?
Evidence — the daleel
Sahih al-Bukhari 5233 ṢaḥīḥSahih al-Bukhari 3006 ṢaḥīḥSahih al-Bukhari 5232 Ṣaḥīḥ
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.