So on Friday, as the president told members of the National Rifle Association that he would push to seal the border and push for merit-based immigration legislation “not based on picking someone out of a bin,” Nielsen announced she would cancel special immigration status for roughly 86,000 Hondurans living in the U.S.—but on the same day, her department accepted dozens of Central American asylum-seekers who traveled as part of a much-publicized caravan to the San Diego border area, despite Nielsen’s own earlier warnings that those in the caravan would be turned away.

Nielsen, a cybersecurity expert who worked in the Bush administration, has stood alongside Trump in dialing up warnings about immigration as part of a strategy to deter additional people from coming to the U.S.

Yet she’s had to walk a tightrope, current and former aides said, picking her moments with Trump in private while preserving a working relationship with leaders here and abroad who view the administration’s immigration policies as anathema to their values.