Agencies have considerable leeway in their negotiations with unions, which the judge’s ruling generally did not question. The judge simply ruled that management is required to bargain in good faith, and that the president cannot bias the process from the outset or take certain issues off the table. Legal experts say that within those broad parameters, the agencies may be free to tack in the president’s preferred direction, as long as they do so on their own.

Few agencies epitomize this approach better than the Social Security Administration. Union officials say that while management has generally taken a more confrontational posture since the George W. Bush administration, the atmosphere has been poisonous at times under President Trump.

For its part, management complains that labor is too rigid in opposing efforts to serve the growing ranks of benefit recipients better. As the agency’s workload has swelled, its staff has been reduced more than 10 percent, primarily because of congressional spending caps, according to an analysis by Kathleen Romig of the left-leaning Center on Budget and Policy Priorities.

In carrying out the executive orders, which took effect in July, managers scrapped several established union practices. Union officials could no longer use agency equipment like computers for work on behalf of colleagues; they could not use agency office space to meet with workers and store documents; and they could not use the agency’s email system to communicate with colleagues about workplace issues.

Because the executive orders also called for reining in job protections, like the timetable for correcting underperformance and the options for appeals, some managers made clear to workers that their jobs were in greater jeopardy, union officials say.