8:38. Say to those who have disbelieved, if they cease (from disbelief) their past will be forgiven. But if they return (thereto), then the examples of those (punished) before them have already preceded (as a warning).
fight them until there is no more Fitnah (disbelief and
polytheism: i.e. worshipping others besides Allâh) and the religion
(worship) will all be for Allâh Alone [in the whole of the world ].
But if they cease (worshipping others besides Allâh), then certainly,
Allâh is All-Seer of what they do.
There is no
mention of infidel attack or fighting in those verses, 38 tells
us who and 39 tells us what.
codification of 9.29 & 8.39 is found in Reliance O9.8 & 9.9 respectively. O9.8
Chapter 30 of Risala says it is preferable to invite to Islam before attacking unless the infidels attack first.
Hedaya 2.141 says that Destruction of the sword is incurred by infidels although they be not the first aggressors. page 143 echos the requirement of prior dawah found in Reliance & Risala.
The making of war is contingent on first issuing dawah. It is clearly on Islamic initiative, offensive, not defensive. See also: Muslim 19.4294.