How can I seal a gap between floor joist boxes and foundation?
This is a perfect scenario for spray foam, which both seals against airflow and adds insulation value. Pick up a couple cans and seal all such joints, then overlay fiberglass batts that match or exceed your wall insulation thickness.
Be aware that the standard foam swells to many times its initial size. Use small beads and try to force it into the void rather than just covering the surface. Also be aware that urethane does not come off clothing, skin, and almost anything else. Wear gloves and old clothes, and cover any surfaces or objects you need to protect, including outside the gap. Leave any bulge alone to cure, then tear or cut it off. Wiping it usually makes a mess.
You might also use a silicone or paintable latex caulk on the outside face of that gap, though. I do wonder when there's no exterior covering at that point. Does the wall sheathing not extend onto the sill plate?