J bolt protruding through wall
The “J” bolt is required. The size and spacing is determined on where you are located (seismic zone, wind loading requirements, etc.).

This problem is caused by carelessness. That is to say, the anchor bolt was placed too close to the edge of the foundation wall, (and the wall seems to step back which was not accounted for in the placement of the bolt.)

Depending on the load on the bolt, you’ll need a minimum of 2” of concrete cover over the bolt. 

Anchor bolts are sized based on unusual and extreme loads...not normal loading. That bolt may be just fine until you have an earthquake or a wind storm. I’d have an architect or structural engineer (not a civil engineer) review it.