So junk will be used if you don't have the raw material. What about weapons and armor? Will these stay safe or will it scrap them once it runs out of junk? What about items that don't turn into junk at all (like bubble gum)?
I've run out of junk for certain items and it didn't pull from any of the "more important" items. When you start building things, you'll see which materials are used to make your items.
As discussed in this answer, which goes over the component creation process in detail, Fallout 4 only automatically "liberates" the components from junk items.
In writing the component creation answer I confirmed this with science. I created situations where it would have needed to liberate components from items of the following types, but it didn't liberate them:
- Moddable armor
- Non-moddable armor