Docs/Server/Security and hardening
Security and hardening
How HolaClaw Server decides who may talk to the agent, what the agent may do on its own, when a person must approve, where secrets live, and how to deploy it so an allowed tool call reaches as little as possible.
- Server
- Security
- Operations
HolaClaw Server never assumes it is sandboxed. It runs on a VM, a local machine or a remote server, and checks every request and every tool call itself. This page explains each layer and what you can tighten.
Four layers apply, each before the next one is reached:
| Layer | Decides | Configured in |
|---|---|---|
| Control API | which client may do what, by token and scope | tokens, the socket's file permissions |
| Router | who may talk to the agent at all, as which identity and role | channels.toml, identities and invites |
| Policy | every tool call: allow, ask a person, or deny | [policy] in agent.toml, grants |
| Process | what an allowed call can still reach | the deployment: container or systemd unit |
Commands are written as holaclaw …. Run them the way your deployment does.
Identities and access
Everyone who talks to the agent is an identity with a role: owner (one, created by holaclaw init), admin or user. Who may reach the agent on each channel, and how you let people in with invite codes, is in Invite people and the channels.toml reference.
What matters for security:
- A turn runs under one role, that of the person it answers. A turn that answers messages from several people runs under the strictest of their roles, so a user's message cannot ride on an admin's.
- A stranger let in by open access is a guest. Guests are judged by the agent's
[policy.guest]block, get no grants, cannot save memory and cannot use the browser. - Open access is refused by
holaclaw check(ACC001) when the guest policy allowsexec,writeorexternal. - A disabled identity can do nothing. Its messages are dropped, its tasks do not run and its tokens are refused, until an admin enables it again.
- Every user of an agent shares its workspace and its browser logins. The workspace belongs to the agent, not to a person.
The control API and tokens
Every client, the holaclaw command included, talks to the daemon over its HTTP API. Endpoints and scopes are in the API reference.
- The unix socket is the default transport. Whoever can open it acts as the owner, with admin scope. On a system install its directory is mode
0700and owned by the service user. - TCP (
server.listen) is optional. A loopback address is served as is. Any other address is refused at start unless TLS is configured orallow_insecure_transportis set (NET001). Every TCP request needs a bearer token, except pairing. - Tokens start with
hb_. The database keeps only their hash: the secret is shown once, when it is created. - Scopes.
clientcovers a person's own conversations.adminadds approvals, identities, tokens, tasks, memory, connectors, credentials, skills and backups. A token isclientunless asked otherwise, and ausercan only holdclienttokens. Every request acts at the lower of the token's scope and the identity's role. - Owner tokens. Only the owner creates, changes, rotates or revokes the owner's tokens. Admins can manage each other's tokens, and every change records who made it.
- Pairing codes are single-use, short-lived (15 minutes by default) and stored as hashes. Five wrong codes within 10 minutes from one address block that address for the rest of the window. A pairing link carries the code, so treat it as a short-lived secret.
Manage tokens with holaclaw token:
holaclaw token list
holaclaw token create --identity <id> --name <name>
holaclaw token rotate <token id>
holaclaw token revoke <token id>Revoked tokens are kept, with who revoked them, and every message's trace records the token that sent it.
Expose the API with care
Keep server.listen on loopback, or behind a TLS proxy. Use allow_insecure_transport only behind such a proxy or inside a container.
Tools and policies
Every tool has a risk class, and the agent's policy gives each class a decision: allow, ask (a person must approve) or deny. deny always wins.
| Class | Tools |
|---|---|
read |
memory.search, files.read, files.list, attach, react, skill.load |
write |
memory.save, memory.forget, files.write, skill.save, skill.forget, task.create |
external |
fetch, image.generate, browser.do, and connector tools without a read-only hint |
exec |
exec |
The defaults allow read, write and external, and deny exec. The policy keys, and the [policy.guest] and [policy.task] blocks, are in the agent.toml reference.
What contains each tool:
- Files stay inside the agent's workspace:
.., absolute paths and symlinks out of it are refused. fetchrefuses private, loopback, link-local and reserved addresses, on every redirect too. It sends no cookies and uses no proxy from the environment.- Replies, attachments, reactions and task results go where the message came from. No tool takes a person or a conversation as an argument.
browser.dois given to every agent once the browser is on. Keep an agent off it with[browser] enabled = falsein itsagent.toml, and limit the sites withbrowser.allow.
Every tool call, in order
- The class decision for the person's role and the kind of run.
[policy.tools]overrides, by tool name or connector id. They can tighten or loosen, but never lift a classdeny, and for a guest they can only tighten.- A connector tool the server marks destructive:
allowbecomesask. - With
taint_escalates, a taintedexecorexternalcall:allowbecomesask. - On an
ask:exec_allow, then the grants. - The guard, when one is set.
allowruns the tool,denyrefuses it,askasks a person.
A refused call reaches the model as denied by policy: <tool> (<reason>), with a fixed reason. holaclaw trace shows every step as a policy.decision event.
exec
exec runs /bin/sh -c <command> in the agent's workspace. It inherits nothing from the daemon: the environment is rebuilt with a fixed PATH, HOME is the workspace, and stdin is empty. It times out after 30 seconds by default and 300 at most, and output is capped at 16 KiB.
Caution
exec has no sandbox of its own. A command can read whatever the daemon's user can, secrets included. Run HolaClaw Server in the container, keep exec at ask, and allow-list only the commands you need.
exec_allow entries are command prefixes, matched on whole words: "git status" covers git status -s, not git statusx. A command with any shell metacharacter (;, &, |, $, a backtick, >, <, parentheses, *, ?, braces, ~ or a newline) is never covered. The allow-list is skipped in a tainted turn.
Approvals and grants
An ask pauses only the conversation it belongs to.
- Who answers. An owner or admin. When an owner or admin started the turn on a channel, the prompt appears in the chat: buttons on Telegram, Slack and Google Chat, a reaction elsewhere. Everyone else's approvals are answered with
holaclaw approvalsandholaclaw approve <id>orholaclaw deny <id>, or the HolaClaw apps with an admin token. The first answer wins. - The prompt names the tool and, for
exec, the command. A guard verdict, when there is one, comes first. - Timeout. An approval waits 5 minutes. No answer is a deny, and a restart expires every pending approval.
An approval can be kept as a grant:
| Answer | Covers |
|---|---|
| once | this call only |
--session |
this tool for the rest of the conversation |
--always |
this tool in any conversation of the agent, for the person who approved it only |
| task grant | this tool in one task, set when an admin creates the task |
For exec, a grant covers the command as a prefix, like exec_allow. Grants never apply to guests and never lift a deny.
The guard model
The optional guard model role scores each tool call, from 0 to 1, for how safe it is to run without asking, and labels it benign, destructive, exfiltration, escape or injection. It is never asked about a read call or a deny.
[models]
guard = "jev" # a decision model, or any chat model
[policy]
guard_mode = "recommend" # or "auto"
guard_threshold = 0.7recommend(the default) only adds questions. Below the threshold,allowbecomesask, and the verdict appears in the approval prompt.autoanswers the clear cases so nobody is asked. At or above the threshold the call runs, below it the call is denied, except abenigncall that fell short, which is asked. An error or a timeout is a deny.autonever lifts adeny, never allows a taintedexecorexternalcall, never allows a destructive connector tool without a grant, and never overrules a person's grant.- A decision model answers in well under a second. A chat model answers one word and is slower, and a reasoning model adds seconds to every tool call.
Note
The guard sees the tool, its description and up to 1500 bytes of its arguments: paths, URLs and commands. A guard on a cloud provider sends those off the machine.
Untrusted content
Content from outside is untrusted, always:
fetchandbrowser.doresults;- connector results,
trustedconnectors included; - documents attached to a message;
- a summary of any of these.
The model gets untrusted text inside <untrusted> … </untrusted> markers that the content cannot close. Files the agent reads from its own workspace are not marked.
Each untrusted result is also scored by a decision model (the guard role when it is a decision model, else decide) for whether it tries to steer the agent. A score at or above taint_threshold (0.5) taints that call and the next taint_decay_calls (3) calls of the turn. With no decision model, a scorer error, or a result over 256 KiB, the content counts as steering. Attached documents taint every call of their turn.
With taint_escalates = true, a tainted exec or external call needs an approval, and the allow-list no longer answers it. In auto mode the guard never allows one.
Warning
taint_escalates is off by default. With the default policy, a turn steered by a web page can call fetch, browser.do or a connector tool without asking. Turn it on for an agent that reads the web and holds anything private.
Secrets
Secrets live in auth.toml, never in the config files. See Secrets.
auth.tomlmust have mode0600(SEC001), and the config directory must not be world-writable (SEC005).- Credentials are write-only over the API: they can be set, never read back, except in a backup an admin asked to include them in.
- The database holds no secret, only token hashes, but it holds every conversation.
checkwarnsDAT002when others can read it. - The model never sees a secret, so no tool argument can carry one.
execchildren get a rebuilt environment. Errors are scrubbed of tokens before they are logged. - A provider (
NET003) or connector (CON003) with a token, reached over plainhttpoff the machine, is a check error. - Backups leave
auth.tomlout unless you pass--include-secrets. Keep such an archive like a key.
Deployment hardening
The policy decides which calls run. The deployment narrows what an allowed call can still reach. It does not replace the policy.
Container
The container is the recommended deployment. exec sees only the container, never the host, and runs only the programs in the image. The daemon and the browser sidecar run as two separate users inside it. Publish the API on loopback only (-p 127.0.0.1:8484:8484), and put TLS in front of it before you expose it further.
System service
The systemd unit runs the daemon as the holaclaw system user, with no login shell:
- It can write only its state directory, its config directory (for
auth.toml,connectors.tomland skills), the secrets directory and the browser sidecar's socket directory. The rest of the filesystem is read-only, and/homeis hidden. - The control socket lives in
/run/holaclaw/, mode0700. Everything the daemon creates is private to its user. - No capabilities, no new privileges, no namespaces, no writable-executable memory, a private
/tmpand/dev, the@system-servicesystem call set, and only unix and IP sockets.
exec children inherit all of this: the same user, the same read-only filesystem and the same system call filter.
The browser sidecar
Chromium runs in its own process, as its own user, holaclaw-browser, because it cannot run under the daemon's restrictions: its JIT needs writable-executable memory and its sandbox needs user namespaces. The sidecar holds no provider keys, no auth.toml, no database and no network listener, only its unix socket, and is capped at 2 GiB of memory. Chromium's own sandbox is never turned off: when it cannot start, the browser does not launch and check reports BRW003. See The browser.
Checklist
- Run the container, or the hardened unit, and keep the host up to date.
- Keep
server.listenon loopback, or behind TLS. - Keep
execdenied, or ataskwith a shortexec_allow. - Set
browser.allowfor every agent that uses the browser. - Turn on
taint_escalatesfor agents that read the web and hold anything private. - Keep
access.dm = "invite"(the default) inchannels.tomlrather than open access, unless the guest policy is read-only. - Run
holaclaw checkafter every change, and verify each release before you install it.
Related
Was this page helpful?
