Why boil them? Boiling drives of aromatics.
They can be added straight; the alcohol in the beer should be sufficient to prevent anything nasty working in there.
If concerned about potential contamination, you could put the spices in a little vodka for a few days to sanitize (only need enough to cover them), and add both the spices and vodka. Or alternatively pasteurize them in hot water (145 F for 20 minutes, or 160 F for 5 seconds).
I generally use vodka or rum. The high alcohol content helps extract some flavors, such as orange oil or vanilla.