← sources

I built a Windows-native security sandbox for local LLM agents. It treats tool calls like syscalls and default-denies high-risk actions. (Open Source, AGPL-3.0)

source: reddit (reddit:AI_Agents)published 2026-11-01 15:11ingested 2026-11-02 02:37

retained text

**Disclosure: I am the author of Cyber-Butler-Security (CBS).**

**The Problem**  
I've been running local LLM agents (like AstrBot + QQ adapters) for a while. The default setup is risky: agents often run with user-level permissions, meaning a simple hallucination or prompt injection from a third-party plugin can lead to file deletion or data exfiltration.

**What I Tried That Didn't Work**

* **Application-layer hooks:** Plugins can execute arbitrary code. Static analysis or keyword blocking in the app layer is a lost game.
* **Asking the AI to approve itself:** Using a model to judge its own actions is expensive (token-wise) and still bypassable.

**What I Built**  
CBS is a Windows-first, **OS-level** sandbox. It doesn't try to understand *what* the agent is thinking. Instead, it restricts *what the agent can physically touch*.

* **Dual-Account Isolation:** AstrBot runs under a separate, low-privilege Windows service account. Your desktop files are simply not visible to it via ACLs.
* **TOTP Broker for High-Risk Actions:** If the agent wants to delete or overwrite a file in a shared workspace, the SYSTEM-level Broker intercepts the call. It requires a TOTP code (like Google Authenticator) from your phone before proceeding.
* **Fail-Closed Design:** If the security layer fails, it denies the action rather than allowing it. The worst-case bug is a tool error, not a deleted C: drive.

**What Still Fails (Honest Gaps)**

The "High" security tier is still undergoing end-to-end verification on clean Windows VMs.

It is **not** a replacement for Docker/containers on Linux/macOS. It's a pragmatic solution for Windows users who don't want to set up WSL2.

It does **not** consume additional LLM tokens, because the security decisions are made by OS-level code, not by the model.

**EDIT: Update based on community feedback!**

After the great discussion here, I realized a critical issue: if the security broker executes the action and the agent also executes it, you get double execution. I've now refactored the architecture to be **approval-only**.

The new flow:

1. DSH plugin intercepts the tool call.
2. It asks the Broker: "Is this allowed?"
3. If **requires\_totp**, the Broker sends a TOTP challenge and **pauses**.
4. Once you approve on your phone, the Broker updates the status to **approved**.
5. The plugin polls the status, sees **approved**, and lets the agent execute the original tool.

I've also added a **30-second bypass** for when you're actively watching the agent work. No more spam. The High-tier VM verification is still in progress, but the full approval loop is now functional.

Thanks to everyone who pointed out the UX and architecture gaps. This is why open source works.

document fetched 2026-11-02 00:18 · canonical https://reddit.com/r/AI_Agents/comments/1xl5gw1/i_built_a_windowsnative_security_sandbox_for