claude-code: declare the account agents run as and the command that starts it
The control node is to run its agents under an account that cannot become root (hq ADR 0266). Declare it as a user the node-engine judges root: never, put the agent's directory in its home, and place claude-agent so the operator starts a session there through their own sudo. Where no agent account is named, both name the operator's account, as before.
This commit is contained in:
@@ -8,12 +8,25 @@ configuration, and the consumer side of the Anthropic licence manager (design 39
|
||||
Two directories, declared, so the mesh refuses a second module owning either:
|
||||
|
||||
- `/etc/claude-code`, the agent's machine-wide managed directory, root's, `0755`.
|
||||
- `~/.claude` under the operator account's home, the operator's, `0700`. The module owns the directory —
|
||||
- `~/.claude` under the home of the account agents run as (the operator's, unless the machine names an agent
|
||||
account of its own), that account's, `0700`. The module owns the directory —
|
||||
that it exists, who owns it, its mode — and of what is inside only what it writes. Everything else
|
||||
in it (memory, history, projects, local settings, a person's own rules and skills) is the person's
|
||||
and is never read or written (hq ADR 0182). Unassigned, the module leaves the directory: the host
|
||||
removes a directory only when it is empty.
|
||||
|
||||
And, for where the agent runs as an account of its own (hq ADR 0266):
|
||||
|
||||
- **the account agents run as**, a `user` named by the machine fact `agent-account` — the operator's
|
||||
account where the machine names none, which declares nothing new of it. Where it names one, the mesh
|
||||
makes the account (its home, its own group, no password, no group of the mesh's) and asks the node-engine
|
||||
to judge `root: never` on every look: that it is not root, is in no group that grants root, has no sudo
|
||||
rule and can read no secret the mesh placed for another account. A way found is this module's condition,
|
||||
and the controller's self-check says it urgently.
|
||||
- `/usr/local/bin/claude-agent`, root's, `0755`: starts the agent as that account — `claude` itself when run
|
||||
as it, otherwise `sudo -iu <account> claude` through the operator's own sudo, carrying the guard's
|
||||
override only when it is set in the operator's shell.
|
||||
|
||||
## What it writes
|
||||
|
||||
Under the agent's managed directory, `/etc/claude-code`, owned whole by this module and rewritten
|
||||
|
||||
Reference in New Issue
Block a user