There is a simple and easy solution for this. It's called "design an escort ship."
Like, in SFB, where pirates, raiders, and "something else" show up all the time, survey ships are not armed with a plethora of photons and phasers, they have like, a couple of defensive phasers to shoot down missiles and that's it lmao. They don't put photons on non-military ships, and this is an explicitly more militarized Federation than the standard ST canon.
As a bonus, if your escort ship is fast, well-armed, and affordable (because it's designed as a primary combatant and doesn't expend resources on other things) it's also useful if you need to fight a defensive war.
Hell, if the hullform and baseline systems for the survey ship turn out to be pretty good, you could make a dedicated warship variant on the same hull, if necessary, which would also be a better solution than scope-creeping your non-hostile-environment surveyor into another do-everything-mobile.