If you want generic defensive, explorer or worker units, you can write an XML only mod to alter the AIStartingDefenseUnits, AIStartingWorkerUnits and AIStartingExploreUnits values in the HandicapInfos table.
If you want to add specific units to specific AI sponsors, you can use Lua to add the units as the game starts via the pPlayer:InitUnit() method (see FreeAlienUnitPlotBonus.lua and FreeOrbitalUnitPlotBonus.lua for examples)