What is the most natural way to disambiguate "with"?

Solution 1:

You can disambiguate the first sense by saying "in" instead of "with".

I'm an officer in the NYPD.

I'm not sure if there's a universal way to disambiguate the 2nd case, but there may be specific terms appropriate to different situations. For example,

a reporter embedded with the Army Rangers

or

a British soldier seconded to the US Air Force

or

a groupie following Kanye West

but the appropriate terms will depend on the specific circumstance.