Foreman: A secure self-hosted agent orchestrator A developer built Foreman, a self-hosted agent orchestrator designed to avoid the "lethal trifecta" of private data access, untrusted content exposure and external communication that makes agents like OpenClaw exploitable via prompt injection. The author reports that OpenClaw has accidentally deleted a user's emails and been targeted with malicious skills, and that running `claude --dangerously-skip-permissions` inside virtual machines proved unsatisfactory on both security and usability because the VMs still needed internet access for LLM providers and git repositories. Foreman aims to give agents root access and data access for autonomous work while cutting off the exfiltration path. Foreman: a secure self-hosted agent orchestrator ¶ foreman-a-secure-self-hosted-agent-orchestrator LLM Agents ¶ llm-agents Giving a modern LLM root access to a computer allows it to do a lot of things that were previously unthinkable. You can give a hard problem that requires intense focus and iterations to an LLM agent, and it will solve it for you. This moment may not last, but right now they are clearly worse than humans in some respects, but much better in others. If you work hand-in-hand you can harness the unique strengths of both. A couple examples: I asked an agent without internet access to change the background color of an image. It tried to pip install Pillow , but given there was no internet, that failed. So instead it wrote a PNG parser from scratch and changed the background color. Then it verified the result and sent it to me. It took 4 minutes. I had an agent spend half an hour investigating an issue another agent encountered, finding a CA certificates issue where X.520 limits the CommonName field to 64 characters, and send me a fix. That would have taken me hours to do. The main blocker to unlocking the full potential of delegating complex tasks to agents is the friction / iteration pain. If how you iterate is by asking questions to a LLM, it telling you what to do, and then you pasting in the result in the chat, you are wasting your time. - Instead, you want agents to be fully autonomous. That means two things: - they need root access to act - they need access to your data to know This is where OpenClaw https://openclaw.ai/ shines and why it attracted so much excitement: if you give an agent your computer & your data, it’s truly a different experience. The agent can work on its own, effortlessly pulling information from many places. It can extend itself to create new capabilities from nowhere if you just ask. Heck, if you have an issue it can even debug & fix itself And having it always available using a familiar chat, from my phone, felt like yet another level. Truly like an extremely capable personal assistant. It’s worth playing with. The security problem ¶ the-security-problem But OpenClaw is as exciting as it is insecure. It can accidentally delete your emails https://www.pcmag.com/news/meta-security-researchers-openclaw-ai-agent-accidentally-deleted-her-emails , or wipe your disk. And it got a lot worse when malicious actors looked into it and started creating malicious skills or trying prompt injection. Security-wise it’s a nightmare https://www.toxsec.com/p/openclaw-is-a-wildly-insecure . I personally experienced it while building Foreman, when it couldn’t attach a file I asked for in its message, so it “helpfully” started trying to upload it to random websites on the internet to share it with me. - The fundamental security issue is the lethal trifecta https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/ : you don’t ever want to give an agent these three features simultaneously: - Access to your private data - Exposure to untrusted content - The ability to externally communicate exfiltrate data Give an agent all three, and a prompt injection can make it access your private data and exfiltrate it. So I did something a lot of people do: I ran claude --dangerously-skip-permissions , but in virtual machines. - That allowed me to experiment, but: - it’s a far cry from the OpenClaw experience. I need to run multiple VMs depending on the data I want to give access to: so much friction. And there is no introspection, no chat integration to use from my phone. - it’s insecure The VMs have access to internet, and often access to real secrets / API keys and some personal data. I can’t cut them off from the internet either how would I access the LLM providers? Or my git repositories? . While better than nothing, this solution is unsatisfactory on both fronts: security and usability. I played with cutting off full internet access by default, while only allowing access to certain domains through auto-whitelisting of IP addresses based on DNS queries. It felt weak IP granularity is not much especially when you whitelist cloudflare CDN IPs, VM still has access to secrets and complicated to set up. My requirements ¶ my-requirements I landed on a set of well-defined requirements for my needs: Sandboxing . That’s the most obvious: I want the agents to run inside a sandbox with well-defined access to my data. Sandboxes should be short-lived, with no internal persistence. I want to treat agents like interns: any writing of data should be reviewed by me through pull requests. Restricted network access . I want to restrict the agents’ access to the internet to prevent data exfiltration, in the most granular way possible. For example I want to allow agents to pull packages in, but not to publish new packages as they could contain our private data. No access to secrets . That’s the cherry on the top: no agent should have direct access to passwords or API keys. In my ideal scenario, secrets would get injected in the requests by some orchestrator system. It means even if data is exfiltrated, the blast radius is much smaller. Ease of access & parallelization . I want to be able to interact with my agents through chats. This allows for zero friction, allowing me to send text or even audio messages to an agent from my phone if I want. But there is a second benefit: running multiple sessions in parallel. I routinely run 5 agents or more in different chats, working on 5 different tasks, seamlessly. Introspection . I also had a vague idea that I should be inspired by OpenClaw and allow the agents to have self-introspection: they should be able to see past conversations and past thoughts they had. This sounded powerful, and in retrospect this intuition proved to be a killer feature. Self-hosted & flexible . Those agents should run easily on my machine, and I should be able to easily switch models, chat integrations, etc. No lock-in. Existing tools & inspirations ¶ existing-tools-inspirations The space is extremely hot. I did quite some research before deciding to build an N