The 20-year-old centre-back was named the Welsh club's Young Player of the Year last season during which time he made his first-team debut against Northampton before going on to make 14 appearances for the Bluebirds.
The deal will see Nugent stay at Griffin Park until at least January 2014 and he becomes Uwe Rosler's 10th signing.
The Bees boss told the club's official website: "Ben fulfils our requirements. He is a physical player who has presence on the pitch.
"He relishes defending and is also not afraid to receive the ball and pass it.
"Our squad is now complete and the group now is what we will have to go in to the season."