It is mentioned in the Quran in Surah Al-Ankabut (The Spider)
And when they embark on a ship, they invoke Allah, making their Faith pure for Him only, but when He brings them safely to land, behold, they give a share of their worship to others.
You can view that they know Allah only on the ship.
So the reason behind Islam is: Unification (Tawhid)
and oneness
Muslims have to invoke Allah only everywhere, whatever the reason, if they know him and give a share to others it is kufr.
The second group you talked about are approving Deism and do not approve Divinity
The others are neither approving Deism nor Divinity.
In result both groups of Agnostics are committing kufr.