Unity build in AI, path selection

I am doing some research about AI for my game. I am very new to AI programming, would greatly appreciate any feedback

When using Unity build in Nav Mesh and pathfinding solution, will I be able to filter/select custom path?
I do not always want the shortest path to destination.

For example, if enemy AI is moving to a new location, it must select a path that is safest, concealed from line of fire. Shortest path will not work in this case.

I could roll out my custom AI solution but before I reinvent the wheel, I would like to know if there is anyway I can do “selected path” evaluation with Unity’s build in AI pathfinding solution.

P.S I know there is a ton of AI solution in asset store, but this is a partial learning project, so I will not be buying any plug in solutions

Yes, u can use custom path: Unity - Scripting API: AI.NavMeshAgent.SetPath .
Also u can get NavMesh path and use it for calculation ur own path: Unity - Scripting API: AI.NavMeshAgent.path . For u the best solution is Unity - Scripting API: AI.NavMeshAgent.CalculatePath