There are two components: Agency for direct liability, and Negligence for indirect liability.
People have agency. Guns do not have agency. Software does not have agency.
Negligence is broader. A gun owner can be negligent if their gun is improperly protected from unauthorized use. A gun seller can be negligent if they sell a gun to some they should not. A software provider can be negligent if their software contributes in a way they should have foreseen and prevented.
That becomes the question: Should the AI provider have foreseen these events, and could they have reasonably taken action to prevent them.
-If they had no reason to foresee these potential events, then they are not liable at all.
-If they did foresee these potential events and took no action, then they are liable.
-If they did foresee these potential events and took action which was ineffective, then they may be partially liable. How liable will depend on a jury. They may be financially liable. They may be required to take specific actions to further attempt to prevent future recurrences.
The usual result is a settlement where they agree to take specific preventative actions in the future, and making a "donation" to a victim fund, while not admitting to liability.