Well, here’s what Bulbapedia says.
Safeguard prevents the user and its allies from being inflicted with
non-volatile status conditions and confusion for five turns.
Safeguard no longer prevents allies from being confused by a Figy,
Wiki, Mago, Aguav or Iapapa Berry (regardless of whether it is
consumed as a held item, via Fling, or via Bug Bite or Pluck).
Safeguard no longer prevents allies from being burned or poisoned by a
held Flame Orb or Toxic Orb. Safeguard now protects the user from
being inflicted with a status condition by making contact with a
Pokémon with the Ability Effect Spore, Static, Flame Body or Poison
Point. Safeguard can be bypassed by Infiltrator.
So, to my understanding, Safeguard prevents all confusion from being inflicted, mostly because there is nothing that says otherwise.
Source
Also, just to be sure I’ll test this out.
EDIT: Replay (with this team):
Klefki @ Light Clay
Ability: Prankster
EVs: 252 HP / 4 SpD / 252 Spe
Timid Nature
IVs: 0 Atk
- Safeguard
- Reflect
- Light Screen
- Dazzling Gleam
Krookodile @ Leftovers
Ability: Intimidate
EVs: 4 HP / 252 Atk / 252 Spe
Jolly Nature
- Crunch
- Earthquake
- Stone Edge
- Swagger
Alakazam @ Choice Scarf
Ability: Magic Guard
Level: 50
EVs: 252 SpA / 4 SpD / 252 Spe
Timid Nature
IVs: 0 Atk
- Dazzling Gleam
- Energy Ball
- Psychic
- Focus Blast
Azumarill @ Sitrus Berry
Ability: Huge Power
Level: 50
EVs: 252 Atk / 4 SpD / 252 Spe
Jolly Nature
- Aqua Jet
- Belly Drum
- Play Rough
- Ice Punch
So, it does in fact raise attack, but it won’t confuse you ally.
Hope this helps! :)