Best bet for storing flour safely is cold and dry and as clean as possible. The usual infestation seems to be psocids. Tiny wee, just coloured, beasties. All female, and self reproducing, so if only one survives your scrubbing attempts, it's one too many
Small portions, no more than a bag load to a jar/container, and scrub thoroughly inside and out (and where it was stored) every time it's emptied.
It's also a good idea if you are at all dubious about the flour you've just bought, to put the pack into the freezer for 72 hours. That'll kill off any eggs or larvae even if there are no obvious signs of insect infestation.
Not generally harmful, though they (bits/ waste products) can cause allergice reaction in sensitive individuals.
I find brose, pease meal, is a pest to keep
I only ever keep it in a sealed jar now, and I generally just keep dried peas and make my own because the commercial stuff just seemed to crawl with in weeks.
cheers,
M