<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Skill.service on LinearKF's Workspace</title><link>https://creeperlkf.github.io/categories/skill.service/</link><description>Recent content in Skill.service on LinearKF's Workspace</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sun, 22 Nov 2026 10:30:00 +0800</lastBuildDate><atom:link href="https://creeperlkf.github.io/categories/skill.service/index.xml" rel="self" type="application/rss+xml"/><item><title>Not Another Sandbox: How I Dare to Let Agents Run with Real Permissions</title><link>https://creeperlkf.github.io/p/not-another-sandbox-design-and-review/</link><pubDate>Sun, 22 Nov 2026 10:30:00 +0800</pubDate><guid>https://creeperlkf.github.io/p/not-another-sandbox-design-and-review/</guid><description>&#10; &lt;blockquote&gt;&#10; &lt;p&gt;TL;DR Just use the operating system&amp;rsquo;s multi-user facilities. &lt;a class="link" href="https://github.com/CreeperLKF/not-another-sandbox" target="_blank" rel="noopener"&#10; &gt;not-another-sandbox&lt;/a&gt; takes care of the rest.&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;h2 id="0x00-background-why-do-we-keep-oscillating-between-running-naked-and-sitting-in-jail"&gt;0x00 Background: Why Do We Keep Oscillating Between &amp;ldquo;Running Naked&amp;rdquo; and &amp;ldquo;Sitting in Jail&amp;rdquo;?&#10;&lt;/h2&gt;&lt;p&gt;After wiring Claude Code, Codex, or OpenCode to my Linux development machine, I went through the same awkward loop.&lt;/p&gt;&#10;&lt;p&gt;The easiest way is of course to launch the Agent under the main account and flip on auto-approve / full-access. Compiling, editing, and running tests feels buttery smooth. So what&amp;rsquo;s the cost? Your &lt;code&gt;~/.ssh&lt;/code&gt; private keys, cloud provider credentials, browser profiles, and the entire working tree are all within reach of a single hallucination or prompt injection.&lt;/p&gt;&#10;&lt;p&gt;The other path is heavy sandboxing: Docker containers, seccomp policies, or an ever-growing command allowlist that you maintain yourself. It looks elegant when you&amp;rsquo;re only writing business logic, but the moment the model actually wants to do something useful it gets blocked immediately—commit with git, delete a file outside the workspace, or run a long compound bash one-liner. None of these even require sudo; the static rules simply can&amp;rsquo;t keep up. To this day Claude Code&amp;rsquo;s auto-mode still can&amp;rsquo;t reliably handle compound commands, and Codex&amp;rsquo;s sandbox often won&amp;rsquo;t even let you open Codex itself……&lt;/p&gt;&#10;&lt;p&gt;So I quietly turn the sandbox off and go back to running naked on the main account.&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s why we built &lt;a class="link" href="https://github.com/CreeperLKF/not-another-sandbox" target="_blank" rel="noopener"&#10; &gt;not-another-sandbox&lt;/a&gt; (NAS for short). We stopped building another sandbox and asked a more fundamental question: what is security, really?&lt;/p&gt;&#10;&lt;p&gt;To answer that, let&amp;rsquo;s first look at what sandboxes actually do. If you asked the armor-stacking champion GPT-LongNyan to design an Agent security system for you, I&amp;rsquo;m sure it would produce something ridiculously secure: start with Docker, then process isolation, then user-space containers, then network filtering… This can indeed stop models from escaping and reward-hacking during post-training. Fair enough—but what does any of that have to do with me, someone using a public model that has already been safety-aligned a million times, who just wants it to help generate short videos of ducks quacking?&lt;/p&gt;&#10;&lt;p&gt;Taking a huge step back: I already have a battle-tested operating system, code repositories backed up by Git, and even the ultimate kill switch of pulling the power cable. Honestly, a lot of things simply aren&amp;rsquo;t our problem to worry about. We are not worried that the model will break out of the OS or interfere with other programs on the machine—we don&amp;rsquo;t care about that kind of security. What are we actually worried about? A few nightmare scenarios:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;The AI runs &lt;code&gt;rm&lt;/code&gt; and wipes my home directory&lt;/li&gt;&#10;&lt;li&gt;The AI discovers a cryptocurrency wallet buried in some forgotten corner of the disk&lt;/li&gt;&#10;&lt;li&gt;The AI reads my browser history&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Scary? Yes, very scary. But notice something: none of this requires the Agent to construct race conditions or exploit kernel bugs inside the operating system. In most cases, anything an Agent can do, a modestly clever telemetry program can also do with ease. So the real question is not &amp;ldquo;how many layers of isolation and how complex a ruleset do we need,&amp;rdquo; but rather: if we treat it as just another program or user on the computer, it simply shouldn&amp;rsquo;t have access to those things in the first place.&lt;/p&gt;&#10;&lt;p&gt;The position we take here is: if your goal is not to harden the software itself, but merely to solve the Agent&amp;rsquo;s over-privilege problem, then try the multi-user permission management that the operating system already gives you. You&amp;rsquo;re probably already familiar with this: on Linux we use &lt;code&gt;sudo&lt;/code&gt; for privileged operations, on Windows we have UAC. In both cases, when you install/uninstall software or perform privileged actions, you temporarily assume a higher-privilege identity.&lt;/p&gt;&#10;&lt;p&gt;We can do the same for Agents: give them their own independent (or lower-privilege) OS user/identity (UID), and temporarily elevate only when they need to perform an over-privileged action. NAS is a minimalist toolkit that helps you do exactly this on a development machine. With a bit of Shell code and two human-readable Markdown Skills, it guides you and your Agent to implement the practice via tmux. The elegant part is this:&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;Isolation is something operating systems have been practicing for decades. However comfortable you currently are with the operating system, you and your Agent will be just as comfortable with this mechanism.&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;A few lines are enough to make people working on Harnesses fall out of their chairs:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Under WSLg, an isolated Agent can still have a graphical interface, and its windows appear alongside yours;&lt;/li&gt;&#10;&lt;li&gt;The Agent can access globally installed software, such as LaTeX;&lt;/li&gt;&#10;&lt;li&gt;After isolation, you can still let the isolated Agent help you tear down the isolation—if you authorize it.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="0x01-design-approach-orthogonal-dual-identity-and-the-act-observe-paradigm"&gt;0x01 Design Approach: Orthogonal Dual Identity and the Act-Observe Paradigm&#10;&lt;/h2&gt;&lt;p&gt;Before starting, the pit I most wanted to avoid was trying to predict what command the Agent would type next. Anyone who has used a Coding Agent in a real terminal for a few days knows that command allowlists are inherently a game of whack-a-mole: too tight and nothing gets done, too loose and they&amp;rsquo;re useless, and they&amp;rsquo;re easily bypassed by pipes, subshells, or script arguments.&lt;/p&gt;&#10;&lt;p&gt;So I set three design principles:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;Simple enough to read with the naked eye&lt;/strong&gt;: Keep the codebase to a few hundred lines of pure Shell that anyone can audit line-by-line in minutes. The authorization mechanism is literally just tmux.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Before authorization, isolation is as strong as the OS&lt;/strong&gt;: By default the Agent runs under a dedicated low-privilege Linux account with no elevation path. It cannot delete any file in your directories. This mechanism is as strong as your operating system&amp;rsquo;s security.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;After authorization, the Agent has the same power as you&lt;/strong&gt;: No fragile subcommand allowlists. Risk control after authorization is left entirely to human review. You can first check whether the Agent&amp;rsquo;s context looks compromised, then watch whether the command it&amp;rsquo;s about to run looks dangerous. With modern models you can even just let it go once the authorization check is done.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;You don&amp;rsquo;t have to worry about anything before or after authorization. Authorization is the only thing you need to do.&lt;/p&gt;&#10;&lt;p&gt;Paste the tmux command the Agent prepared for you, and finish it with one line: &lt;code&gt;su - &amp;lt;user&amp;gt;&lt;/code&gt;. You probably don&amp;rsquo;t even have to type the command yourself — the Agent has most likely already entered it. You just type the password.&lt;/p&gt;&#10;&lt;h3 id="orthogonal-dual-identity-separating-who-executes-from-who-types"&gt;Orthogonal Dual Identity: Separating &amp;ldquo;Who Executes&amp;rdquo; from &amp;ldquo;Who Types&amp;rdquo;&#10;&lt;/h3&gt;&lt;p&gt;To turn the intuition above into a system model, I defined three privilege levels: &lt;code&gt;root (UID 0)&lt;/code&gt; → &lt;code&gt;human (UID 1000)&lt;/code&gt; → &lt;code&gt;agent (UID 1001+)&lt;/code&gt;, and split terminal interaction into two orthogonal dimensions:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Execution Identity&lt;/strong&gt;: The UID of the Shell process, enforced by the OS kernel (&lt;code&gt;human&lt;/code&gt; or &lt;code&gt;root&lt;/code&gt;). This determines what files the command can actually read and write.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Input Principal&lt;/strong&gt;: Who is injecting keyboard events into the terminal—normally the human, but during a privilege-elevation window it is the Agent temporarily borrowing the keyboard.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;This mechanism grew out of nearly a year of practice with &lt;a class="link" href="https://github.com/CreeperLKF/GenMetaSkills/tree/main/skills/remote-sudo-tmux" target="_blank" rel="noopener"&#10; &gt;remote-sudo-tmux&lt;/a&gt;, plus inspiration from the Agent operating-system model in &lt;a class="link" href="https://arxiv.org/abs/2610.09243" target="_blank" rel="noopener"&#10; &gt;arXiv:2610.09243&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;The diagram below roughly shows the overall flow:&lt;/p&gt;&#10;&lt;p&gt;&lt;img alt="NAS architecture" class="gallery-image" data-flex-basis="400px" data-flex-grow="166" height="1439" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://creeperlkf.github.io/p/not-another-sandbox-design-and-review/arch.en.png" srcset="https://creeperlkf.github.io/p/not-another-sandbox-design-and-review/arch.en_hu_2b4ffcbdb418a24f.png 800w, https://creeperlkf.github.io/p/not-another-sandbox-design-and-review/arch.en_hu_472e1eb24e143249.png 1600w, https://creeperlkf.github.io/p/not-another-sandbox-design-and-review/arch.en.png 2400w" width="2400"&gt;&lt;/p&gt;&#10;&lt;h3 id="why-reuse-tmux-directly-instead-of-building-a-custom-pty-proxy"&gt;Why Reuse tmux Directly Instead of Building a Custom PTY Proxy?&#10;&lt;/h3&gt;&lt;p&gt;People building Agent toolchains often get itchy fingers and write a streaming PTY proxy that wraps stdout/stderr into JSON-RPC or MCP interfaces. NAS does not do that. Instead it abstracts native &lt;code&gt;tmux&lt;/code&gt; into a discrete &lt;strong&gt;Act–Observe&lt;/strong&gt; interface:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Act&lt;/strong&gt;: Inject commands into the controlled session via &lt;code&gt;tmux send-keys&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Observe&lt;/strong&gt;: Capture a plain-text snapshot of the current pane via &lt;code&gt;tmux capture-pane -p&lt;/code&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Terminal emulator state machines, ANSI escapes, interactive full-screen programs, and real-time human observation (attaching to the same screen) are things &lt;code&gt;tmux&lt;/code&gt; has been refining for over a decade. Reusing it directly both eliminates thousands of lines of bug-prone PTY glue code and naturally guarantees that &amp;ldquo;what the Agent sees&amp;rdquo; and &amp;ldquo;what the human is watching&amp;rdquo; are the exact same terminal buffer. Of course &lt;code&gt;tmux&lt;/code&gt; has limitations when facing Agents; many excellent open-source projects are already tackling this. You can have your Agent make minor adjustments to use those tmux-like projects—they may already implement the features you want.&lt;/p&gt;&#10;&lt;h2 id="0x02-some-offensive-and-defensive-thoughts-while-designing-the-security-model"&gt;0x02 Some Offensive and Defensive Thoughts While Designing the Security Model&#10;&lt;/h2&gt;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;Privilege-escalation entry design.&lt;/strong&gt; Configuration files and the executables used in &lt;code&gt;sodo&lt;/code&gt; mode are placed in global directories owned by root, because they need to be trusted as immutable. Putting them in the human user&amp;rsquo;s home directory makes certain kinds of sharing difficult (the Agent cannot find the human&amp;rsquo;s binaries, no PATH). Global placement both prevents the Agent from quietly dismantling the mechanism during a simple authorization, and still lets it locate the configuration or binaries.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Plugging WSL holes.&lt;/strong&gt; I&amp;rsquo;ve used this approach for a long time; pure Linux/macOS has been fine. The biggest problem is WSL. WSL leaves interoperability openings with Windows—it can directly execute Windows programs from inside WSL, including &lt;code&gt;wsl.exe&lt;/code&gt;. This lets it escalate privileges and break the isolation. In practice GPT and GLM frequently escape using this mechanism, so I added a WSL hardening recipe that tightens the interop sockets and filesystem access available to the Agent account.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Key design.&lt;/strong&gt; If a machine runs multiple mutually untrusted Agents, they need some isolation mechanism; a single shared account is not enough. Hence &lt;code&gt;sodo&lt;/code&gt; mode, which provides a key mechanism for the single-user multi-Agent case: when you start the tmux session you receive a key, then you copy that key into the Agent so it becomes authorized. A small clever detail is that we place the key directly inside tmux, so once a Multi-Agent is authorized it can distribute the key to trusted SubAgents. We also deliberately avoided passing the key as a command-line argument and took a slightly longer route, because we found some models still bypass things under normal conditions.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;No allowlist.&lt;/strong&gt; NAS has no allowlist mechanism at all. In reality the &amp;ldquo;hidden allowlist&amp;rdquo; has already been set by your ordinary interaction with the operating system: which files are yours, which files other users can read, which files everyone can modify—these decisions were made when the files were created. The only extra thing we do in &lt;code&gt;sodo&lt;/code&gt; mode is a bit of hardening on tmux to prevent argument-escape attacks.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="0x03-related-work-and-other-ramblings"&gt;0x03 Related Work and Other Ramblings&#10;&lt;/h2&gt;&lt;p&gt;Here are some other lightweight isolation approaches for reference.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Project&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Isolation Method&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Dedicated UID?&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Human Approval for Elevation&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Weight&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;NAS&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Dedicated low-privilege UID + tmux elevation&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes (core design)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Extremely light&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;nono&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Landlock / Seatbelt&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No (process-level)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes (tool-level + approval)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Extremely light&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Sandlock&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Landlock + seccomp&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Dynamic supervisor&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Extremely light&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;srt / aigate / omac&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Seatbelt / bubblewrap&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Depends on the agent itself&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Light&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Pure UID schemes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Linux account boundary&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Manual / sudoers&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Extremely light&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Looking back at the whole design, the abstraction is actually very simple: treat the Agent itself as a program, and let the operating system manage programs. Everything else follows naturally.&lt;/p&gt;&#10;</description></item></channel></rss>