The 21-year-old Wales international has joined the League Two club in order to gain more first-team experience and he becomes the first new arrival at Pompey since Richie Barker took charge last month.
Alfei made his first-team debut for Swansea in an FA Cup third round tie against Colchester back in January 2011 and he went on to make two more appearances that month.
He also featured in a Carling Cup tie against Shrewsbury in August 2011 but has not made a first-team appearance for the Swans since then.
Alfei has, however, had two loan spells with Conference side Wrexham in the last two seasons and signed a new contract last term which ties him to Swansea until the summer of 2016.
He told Portsmouth's official website: "It's exactly what I've been looking for - a massive club to come to and play some football.
"There are big crowds here and it's the perfect move at this stage of my career.
"I've been in the reserves at Swansea, but I really need to be playing first-team football and I want help this club out.
"I think of myself as an attacking right-back, so hopefully I can get some assists and maybe a goal or two.
"As a defender I have to concentrate on helping the side not to concede, but I like to get forward as well."