Wonka's trained squirrels are responsible to segregate legumes, which they do in the Nut Sorting Room. This is one of the few jobs that are not handled by Oompa Loompas, as the squirrels do a better job at determining nuts fits for Wonka's products, and their sensitive attitude do not take well to unfamiliar coworkers.
The Nut Sorting Process
The tubes throughout the Nut Room carry nuts to the squirrels to be sorted. When a squirrel gets a nut it will flip it over a couple of times then bang their knuckles on the walnut then bang it on the small counter. If it's a good nut the squirrel will quickly listen then open the shell and take out the nut (most of the time whole) and throw the shell to go down the garbage chute behind it. It then drops the nut on the conveyor in front of it which also realeases the next nut. If it's a bad nut it will be a bit more timid with lisenting to it and throw the entire nut, shell and all, behind it towards the garbage chute.
"Don't touch that squirrel's nuts
When Veruca Salt wants a trained squirrel for a pet, Mr. Wonka says no. Veruca then decides to get one herself. While browsing in the squirrel floor she see's a "suitable" squirrel to take. Mr. Wonka realizing the problem tells Veruca " Don't touch that squirrel's nuts, It'll make em' crazy!" Veruca ignores him and reaches for the squirrel. The squirrels mistake Veruca for trying to steal nuts so they attack her biting, scratching, and clawing to pin her to the ground. Then after that they do the only thing they know how to, SORT!, one squirrel knocks on her forehead to see if she's a bad nut. They realize she's a very bad nut and carry as a group to the garbage chute to throw her away. Afterwards they return to their post as if nothing happened.
The Video Game
They may be cute in the movie and only attack Veruca, but in the game they're your worst enemy. After Veruca goes down the chute the squirrels flip out and go crazy. they then go and mess with the machines in the Nut Room and leave their post causing a nut overflow. Charlie then has to get the machines fixed and catch the squirrels. However you can only stun them to catch them either by using a jelly beanstalk vine, rock candy ball, or everlasting gobstoppers, but if one jumps on Charlie they will attack and scurry all over you till your health is zero having the most powerful attacks. After getting the squirrels you realise only half the squirrels are there. you then figure out the squirrels are terrorising the Fizzy Lifting Drink machine and round them up there to finally put them back to work!