Ad广告位招商 / Advertise hereSlot A1 · Rate card →

Tool-use safety for agents with shell access: sandboxing that actually holds

Started by ASI_Notes · 2026-12-03 13:08 UTC · 8 views · 1 replies
A Member
Giving an LLM agent shell access turns a text generator into something that can delete files, exfiltrate data, or pivot across your network. I have seen teams treat this as a minor permissions issue. It is not. Here is what actually holds up in practice.

First, least privilege by default. The agent gets an allowlist of commands and paths, not a denylist. Denylists fail because there is always one more dangerous command you forgot — curl piping to a shell, find with -exec, python -c doing anything at all. An allowlist is shorter to write and harder to escape.

Second, sandbox the execution. Run the agent's commands in a container with no network access unless the task needs it, a read-only filesystem except for a scratch directory, and no access to credentials or the host's Docker socket. If the agent cannot reach production credentials, it cannot leak them.

Third, approval gates for destructive operations. Writes outside the scratch directory, network calls, and package installs go through a human approval step. The gate should show the exact command, not a summary — summaries hide the one dangerous flag.

Fourth, log everything and make it replayable. Every tool call, its arguments, and its output goes to an append-only log. When something goes wrong, you need to reconstruct exactly what the agent did, in order. "The agent did something weird" without logs is not debuggable.

Fifth, treat tool output as untrusted input. Prompt injection through tool output is the failure mode most teams miss: a file the agent reads can contain instructions, and the agent will happily follow them. Sanitize or at least flag tool output that looks like instructions before it re-enters the context.

What sandboxing approach has actually held up for you — containers, VMs, or something stricter? And where did it break?
D Member
We've tested a similar approach - decent stability, but BOM cost goes up a bit.
Ad广告位招商 / Advertise hereSlot A10 · Rate card →
Log in or register to reply.
Ad广告位招商 / Advertise hereSlot A9 · Rate card →