Well, the obvious military POD is the War against the Restauration Army led by Gamarra and sent by Chile.
Wiki says that the Peru-Bolivian army was one of the best in South America at the time, although then again, so was Paraguay's in 1865, so we make take that particular data cum grano.
The Battle of Portada de Guias, in which Lima fell, and the Battle of Yungay stand out as the most obvious examples of when to make the Confederacy succeed.
Now, if Gamarra and Castilla are killed or imprisoned before reaching Chile, or if the political situation in Chile becomes chaotic enough to allow some years of stability for the Confederacy to consolidate itself, then of course Argentina won't attack, no matter how much Rosas wants the Alto Peru back.
For example, the Quillota Mutiny of 1837 in Chile could escalate into a mini civil war given the right circumstances, or even led to some years of political instability and distrust amongst the ranks of the army and the conservative party and the destroyed liberals.
And of course, since this Confederacy is dominated by Santa Cruz and Bolivia, we need for the Lower Peru to feel more included and less dominated by the Bolivians.