Legion is the future artificial intelligence that replaces Skynet in Terminator: Dark Fate. The film presents Legion as a military artificial intelligence that becomes self-aware and launches a war against humanity.
Dark Fate establishes a new continuity in which the events involving Skynet and the original Judgment Day have been altered. Because Skynet no longer occupies the same role in this timeline, Legion becomes the source of the new machine threat and sends the Rev-9 back to kill Dani Ramos.
Legion is often confused with Genisys, the AI system in Terminator: Genisys, or Skynet from the earlier continuity. The distinction matters because Dark Fate is a direct continuation of the first two films but disregards the continuity of several later sequels.