Metal cages have been installed by warm air vents at Cardiff University to stop homeless people sleeping next to them.
Students have criticised the move, but the university claims the cages have been installed for health and safety reasons.
Student Lewis Hopkins told The Independent he was "sickened" after spotting the cages outside a chemistry building.
He said: "The homeless people are never there in the day, it's only overnight. They never caused any trouble, never littered nor gathered in groups.
"They were just content with finding a warm place to sleep at night."
A Cardiff University spokesman said: "The area covered by the safety grilles are not hot air vents but boiler flue vents that can potentially produce products of combustion - diluted amounts of carbon monoxide being one of these - as part of the diluted boiler flue gases.
"These vents are considered safe in normal use due to the type of flue dilution system being used but there could potentially be an increased risk if people are sleeping right next to the grilles for very long periods."
The controversy comes after "anti-homeless" spikes were installed outside a housing development in London.