Enclave: A Runtime for Autonomous Agent Deployment
We've just open-sourced the runtime we use for this, called Enclave. It's an Apache-2.0 project designed to handle the sandbox, credential scoping, and cost governance that most frameworks ignore.
If you want to get a local instance running, it's a straightforward process:
git clone https://github.com/wartzar-bee/enclave.git enclave && cd enclave
./bin/enclave init # wizard: name, brain, model, port, paste your credential
./bin/enclave run # build + start, opens a browser chat at 127.0.0.1:8888Technical Breakdown
Enclave isn't just another wrapper; it's a hardened container environment. The "brain-agnostic" architecture allows you to switch between Claude, OpenAI-compatible APIs, or local models via a single environment variable (BRAIN=claude | api | local | optimize) without losing the agent's persistent memory.
From a security standpoint, this is a real-world deployment tool, not a demo. It uses --cap-drop=ALL and --security-opt=no-new-privileges to ensure the kernel enforces the boundary. The network egress is set to report-only by default for easier debugging, but you can lock it down by setting GUARD_EGRESS_ENFORCE=1.
Solving the Cost Problem
The biggest pushback we get when rolling out agents at scale is the cost. To solve this, Enclave implements two specific cost-saving mechanisms:
- Model-tier routing: By setting
ROUTER=on, routine heartbeats and mechanical tasks are routed to cheaper models, while high-stakes judgment is reserved for frontier models. If the cheap model struggles, it automatically escalates the task upward. - Manager-Worker Delegation: When using Claude, the system forces a "manager" model to delegate bulk coding to a cheaper worker, with the manager acting as the final verification gate.
This approach transforms the agent from a token-burning machine into a manageable piece of infrastructure. For those looking for a practical tutorial on agent deployment, this runtime handles the "boring" operational side so you can focus on the prompt engineering.