We are from God: John tests whether a person truly belongs to Christ by seeing if that person listens to the teachings of the apostles and agrees with them.
The Spirit of truth is the Holy Spirit (John 14:17, 26; 15:26; 16:13–15). The Holy Spirit teaches the truth about Christ (1 John 2:20, 27).
False prophets have a spirit of deception. This is the spirit of antichrist, which leads people away from Christ (see study note on 2:22). For this reason, staying united with the historic body of Christ and remaining faithful to the shared teaching that began with the apostles shows loyalty to Christ’s work in the world.