If Congress wanted to do something like that there are a variety of ways that it could do it.
It could change the authority of the FBI in the federal bureaucracy to exclude Alaska. This would deprive it of the affirmative authority it needs to do its job there, for example, eliminating its authority to arrest people and present them to a federal court in that state.
It could pass a rider to an appropriations bill declaring that no federal funds be spent to conduct FBI activities in Alaska. It wouldn't be a crime to conduct FBI activities in Alaska per se, but because FBI agents are paid for their time, doing that would require an expenditure of funds not authorized by Congress.
Generally, the first line of defense would be for the Treasury Department or Office of Personnel Management to decline to issue payroll checks to the FBI agents involved since the appropriations for that expenditure were not authorized.
If that failed and the FBI somehow managed to pull the wool over the Treasury and OPM's eyes (which honestly would be easy as they don't have internal controls designed to catch something like that), then those involved might be guilty of a misappropriation of federal funds (basically an embezzlement crime) for doing so.
Of course, another step that could be taken is for the Inspector General of the Justice Department (or a senior executive in the AG's office such as the AG or a deputy AG, or assistant AG) to investigate and to suspend the people involved from their employment and fire them if necessary, or simply order them not to act (on threat of being fired for insubordination if they disobey) if the acts have not yet been committed.
Congress is allowed to use criminal sanctions, but generally speaking, the federal government has demonstrated that the crude instrument of criminal punishments is not necessary to keep their employees in line, and going around throwing your employees in prison for not following complicated high level legislative or executive directions is not good for employee moral, particularly when most of your employees are unionized and have civil service protections, so doing it the hard way is very, very hard.