If you get stopped with pot, and you have a doc's recommendation, an unfriendly cop can ABSOLUTELY take you in first and figure out whether the recommendation is valid later. That's why you get the card -- a cop can't persecute you because he MUST run the card on the spot rather than back at the station. But you have to have the doc's recommendation ALSO, by definition. And that is what you use to justify your growing, etc.
The safest thing to do is not have anything to do with cannabis at ALL; pretty sure you won't have any trouble. The next level of protection is having a card for stops and a doc's recommendation for your grow, and having your grow within the OLD, now-ruled-unconstitutional limits (state limits or local limits if you have them -- they're different sometimes). The feds can still chase you, but there's no actual evidence that I can find that ANYONE has been prosecuted just for having six plants flowering. The NEXT level of risk: doc's recommendation only and growing up to what you want. As long as you stay under 99 plants, you avoid the federal mandatory minimum 5 year sentence which starts at 100 plants. Recently, they raided an op up north that even had been sheriff inspected and the owner paid an actual FEE to license the grow -- first in the state.
It's not as simple as "stay 100% legal and stay quiet"; what's 'legal' varies and isn't completely legal under federal law anyway. And the doc's note helps you defend yourself IN COURT, which means you could do some time in jail. Let's not sugar-coat it. Yeah, get your doc's recommendation. Yeah, get the card. Yeah, keep it quiet and don't even talk to your friends about it. Do it all. Know the risk and pick the level that's right for you. For me, that's 6 flowering plants, cuz I have an absolute allergy to ass rape.