Stephen Miller, the hard-right White House speechwriter and domestic-policy adviser, became a conservative celebrity for penning President Donald Trump’s apocalyptic “American Carnage” inaugural address and for serving as the public face of the administration’s travel ban.

But Miller is trying to take on a second role—a power move known only to a handful people in the White House and across the administration. The nationalist firebrand has elbowed his way into national-security and foreign affairs, trying to push the U.S. government to adopt hard-line stances on refugees and other international issues.

The series of moves has so horrified administration officials that they’ve created a paper trail to try to keep Miller from implementing his nationalist goals for international issues—spelling out the consequences of disobeying court orders, for example, that prevent Trump from further curtailing the number of refugees coming into this country.

Among those documents, officials told The Daily Beast on the condition of anonymity, is a guidance paper from the Justice Department about the legal liabilities the administration would incur for flouting a judge’s order on refugees.

Since the National Security Council’s composition is up to each president, Miller’s involvement isn’t “per se” inappropriate, said David Rothkopf, an NSC historian. But, Rothkopf said, Miller “has no national-security experience and is largely seen as a political operative, and neither of these characteristics tends to be a positive on the NSC.”

Miller’s incursions into the realm ordinarily reserved for the NSC are not limited to refugees. Sources said he and his allies have exceeded his domestic-policy purview to question why the U.S. ought to support certain international institutions, including the U.N. Population Fund, which advocates for voluntary family planning. Miller was also part of the nationalist faction that prevailed upon Trump to withdraw from the Paris climate-change accord on Thursday, The Daily Beast’s Lachlan Markay and Asawin Suebsaeng reported.

Accordingly, officials see Miller’s intrusions through the White House’s Domestic Policy Council, which reports to him, as an attempt to deliver red meat to Trump’s anti-immigration and nationalist voters. Some, however, are unsure how much Miller is directing the effort personally and how much DPC officials are interpreting their mandate. In the Trump administration and its predecessors alike, the DPC is a significantly more political entity than the NSC, where senior leaders attempt to avoid the perception of carrying out a domestic political agenda.

Formally, Miller has no position on the NSC. But the Domestic Policy Council is typically invited to participate in NSC meetings in which its agencies, such as the Department of Health and Human Services, have equity. During the Obama administration, the DPC was often invited to participate in NSC meetings on migration and refugee issues.

But under Trump, Miller has reversed that order, bringing the NSC and its constituent agencies into ostensibly DPC meetings. Foreign-policy officials have been shocked to hear discussions of their issues in the DPC-convened meetings dominated by domestic political considerations rather than their international implications. The blurring of lines, a knowledgeable administration official said, has sowed confusion.

“There are no clear lines of authority or divisions of labor,” the official said. “There’s just not a lot of transparency here—where the work product goes, who’s tasked with what.”

The 31-year-old Miller is an incendiary conservative who, along with chief strategist Steve Bannon, is a leader of the administration’s nationalist wing. A number of profiles have reported that his preoccupation with immigration, disgust with multiculturalism, and enthusiasm for offending liberals were evident even in his California high school, where he objected to Spanish-language announcements. At Duke University, the white-nationalist Richard Spencer described himself as a “mentor” to Miller, a claim that Miller vociferously denied to The Daily Beast’s Tim Mak.

Miller’s media savvy at Duke, where he strenuously defended lacrosse players accused of rape in a racially ugly incident (the charges were ultimately dropped), gave him a national profile. After college, he parlayed that into jobs for GOP Reps. Michele Bachmann and John Shadegg before getting the role that would make his career. As a Senate aide to now-Attorney General Jeff Sessions, Miller was credited—or blamed—for blocking an Obama-era immigration deal. He took that focus to the White House, playing a leading role in drafting the controversial restrictions on entry to the U.S. of travelers from majority-Muslim nations and refugees.

Those restrictions, spelled out in executive orders, faced massive legal pushback. In March, Trump attempted to revise the so-called Muslim ban to pass judicial muster. The revamped executive order retained a critical provision on refugees: Section 6 of the March order limited their entry to 50,000 in fiscal year 2017, less than half of the 110,000 refugees Obama forecasted admitting into the country this year.

Almost as soon as Trump issued the new order, federal judges blocked the administration from enforcing key aspects, including the Section 6 refugee cap. Hawaii District Judge Derrick Watson even cited Miller’s own words (“Fundamentally, you’re still going to have the same policy outcome…”) in his ruling that the new executive order was as legally deficient as the old one.

Inside the government, however, officials had concerns about whether Miller would abide by the injunction. With the U.S. almost certain to surpass the order’s intended refugee limits, those tasked with implementing refugee policy this spring began fearing that the nationalist wing of the administration would attempt to blame bureaucrats for undermining Trump’s policies. So they did what experienced officials excel at doing: They created a paper trail to keep the entire administration on the same page.

Lawyers across the government discussed and created documentation spelling out the government’s obligations now that the judges had blocked the refugee cap. A critical aspect of that effort was a Justice Department guidance making clear that the administration would put itself in legal jeopardy by defying the injunction.

“While we stand ready to implement the executive order to its maximum effect should the court order be lifted, in the meantime, we don’t want to run afoul of the legal rulings,” said the U.S. official.

Miller and his allies “know the lawyers are really skittish, so they’re trying to avoid the lawyers, who say ‘No, you can’t do that,’” another official said.

Along with a spending bill for the rest of the fiscal year that did not curb refugee admissions, the maneuver worked. Last week, the State Department acknowledged that it is lifting weekly refugee quotas. The U.S. has already admitted nearly 50,000 refugees in fiscal year 2017, with four months to go.

But Miller’s influence over refugees and other international issues goes beyond concerns over U.S. refugee admissions. Last week, Foreign Policy reported that Miller obstructed Italy’s attempt to make the global migration crisis central to the recent G-7 summit.

The DPC has also trod on NSC toes by questioning American support for a variety of international institutions, particularly those that inflame right-wing sensibilities. Among them are the U.N. Population Fund and other organizations that aid abortion access and global health, indicating what one official described as an “outsized understanding” of how Miller sees the DPC’s role. Miller’s allies typically ask, pointedly, if supporting such groups is an efficient use of U.S. government cash. In April, the administration withheld more than $32 million from the U.N. fund.

Though the administration is divided into competing fiefdoms, Miller is unequivocal in the meetings that blur the lines between NSC and DPC authority. He frequently says he speaks for Trump. Unnerved career civil servants have been known to push back on his hardline positions, but given Miller’s claimed closeness to the president, they do so delicately.

“As any casual observer can conclude, it’s not totally clear what the president thinks from time to time,” said a U.S. official, “but it’s hard when you’ve got an adviser purportedly speaking on his behalf.”

Neither the White House nor Miller responded to requests for comment.

It is not the first time that Miller’s allies have reached for a national-security role. Trump in January placed Bannon on the NSC, only to reverse course under pressure, including dissatisfaction from National Security Adviser H.R. McMaster. Rothkopf, the NSC historian, said Miller’s incursions into NSC territory indicated the persistent potency of the administration’s nationalist faction.

Miller “is seen as a vestige of the Bannon regime that was supposed to have been defunct or marginalized. Clearly that didn’t work out as promoted,” Rothkopf said.

“They remain influential, and Miller’s role is a further sign that McMaster’s control of the NSC process is not complete, which is very worrisome.”

Update: The original version of this story erroneously asserted that the UN Population Fund considers abortion access a human right. It has been corrected.