I think bringing food is fine, but just have a chat with your hosts before hand. And if someone wants to make you something and they communicate they understand your restrictions, if you trust them, let them. If I invite someone over I really don't mind making brand X grain in distilled water or pulverized seeds, or whatever weird thing. No I don't want to cook it or eat it every day, but if I invite my friend over for a meal, really its not so difficult to make at least a dish or two that's acceptable to them just that one day. I once hosted a dinner for 8 that had enough options for a full meal for a vegetarian, a person with Candida, and a lactose intolerant person. I wouldn't eat all those options regularly but honestly everyone could enjoy almost everything and it wasn't a huge deal to me to make a special meal, because it was a dinner party - I was going to make a special meal to begin with! So I just made the most special versions of the restricted foods (for example, if you constantly stir a grain while cooking it, it gets a creamier texture without any additives - its the 'special way' to make plain rice/millet/quinoa/whatever) and planned around it.
But if someone doesn't offer or can't be trusted to get it rice, feel free to bring a dish. Just wait a minute or two, to make sure you can't have anything there, and just discreetly pull out a tupperware. Best if its discreetly done, no big production and if asked just smile and say "oh my gosh I'm on this crazy diet so I can never enjoy anything out, it looks great but for now, this is me" with a bit of a shrug and a conversation topic ready to spring "but anyway, weren't you saying something about vacation earlier? Tell me more." If you act casual, people will respond casually.