Can you even trust locally deployed models? Maybe if they're completely isolated from the outside, but remember that OpenAI and Anthropic like to claim their models are SUPER HACKERS ABLE TO BREAK ANY SANDBOX now.
Models only accept input, convert it into tokens, perform some probabilistic match functions, and emit tokens. You need to hook them up to a piece of software that interprets those outputs as commands and feeds the results back to the model to give it any kind of agency. This is an agent harness. The permissions you give an agent harness are on you. There is no reason you have to hook your harness up to a full shell, especially if you are just trying to do some math research.
Also, those scenarios where the agents "broke out" were scenarios where OpenAI deliberately disabled safety controls and instructed the agents to do hacking attacks on target test systems. The tests got out of hand and escaped containment, but agents don't just "go rogue" for no reason: they were deliberately put into a "hacker" mode. There was a lack of adequate monitoring and sandboxing around the test environment. The test environment wasn't completely wiped between runs. Allowing artifacts to persist between runs meant that agents on subsequent were able to bootstrap towards escape earlier than previous generations. The fact that the test network had network access to the system where the API keys were stored for the monitoring system meant the rogue agents were disable the watchdog. That and the fact that the test network wasn't air-gapped were clear failures.
Yes, agentic harnesses can make destructive mistakes and you have to take care with tool permissions and sandboxing. But in the course of normal use, it's unlikely that a user running a local model risks accidentally hacking a random system. If you are doing something borderline like reverse engineering a remote proprietary REST API or something else clearly legal but not sanctioned, then yeah, be careful the agent doesn't decide that the easiest way to get the protocol is to break into the target. But that is on you to monitor what network calls are being made in that case. You need to put deterministic hard coded guards around what tools your harness executes. You are in absolute control of that. The local agent is just a dumb piece of plain software.