Start claude as the PC's agents' account through a broker (SES-314) #335

Merged
merge-queue merged 5 commits from ses-314-agent-broker into main 2026-11-29 14:43:40 -08:00
Owner

Work package: https://openproject.home.romaine.life/wp/SES-314

Claude agents on the home PCs are moving to their own non-admin account, ROMAINE\claude. This PR is at-claude's part: the host starts claude as that account through a per-PC broker. It builds on PR 328, which made the host judge a peer by account and job membership.

What it adds

  • at-claude agent-broker -person <SID> -drive S:=\NelsonNAS\files. It runs as the agents' account from the at-claude-agent boot task, which at-app.json now declares. at-update registers that task with the account's password (romaine-life/at-update#33), so the broker has a full logon and maps S: in it.
  • The broker serves \.\pipe\at-claude-agent to the person's SID only, and the person cannot create an instance of that pipe. The host refuses any pipe whose owner is not the agents' account.
  • How a start works:
    • The host makes claude's three pipes, which only the agents' account may open.
    • The broker opens them as claude's stdio and starts claude suspended with no window. The process lets the person put it in a job and end it. The broker's default DACL lets the person read every process claude's tools start, so the host's InJob check works on them.
    • The host puts claude in its usual kill-on-close job and checks that the pipes' client is the broker. Only then does the broker let claude run. If the host goes away first, the broker ends claude.
    • Claude is not in Task Scheduler's job. I checked on upstairspc that a task's job allows silent breakaway. So restarting the broker on a release leaves running sessions alone.
  • After that, Detach/Adopt moves, Kill and peer checks are today's code, and the agents' processes are now readable from the host's side.
  • Claude's environment is the agents' own logon block. From the host it takes only the session's variables (AT_CLAUDE_*, AT_TMUX_*, TMUX*, terminal), plus CLAUDE_CONFIG_DIR set to the agents' %USERPROFILE%\.claude, DISABLE_UPDATES=1, and AT_CLAUDE_HOST.
  • Claude itself runs from C:\Program Files\at-home\claude-agent\current\claude.exe, the agents' copy that home-sync keeps and they cannot write.
  • Agent sessions get --settings {"disableAllHooks":false}. Command-line settings outrank project and local settings (Claude Code's settings docs), so no project file the agents can write turns owner-guard's hook off. They get no --chrome.
  • The broker refuses every start until the agents cannot change their own settings.json or delete, rename or re-permission their .claude. It checks this with Windows' own AccessCheck.
  • The host's socket grants the agents' account access. The session tools' client commands dial AT_CLAUDE_HOST, because the agents cannot reach tmux or the person's hosts folder.
  • The window shows a notice when claude starts as the agents: what does not work there yet (side panel, window states, Claude in Chrome), plus anything the broker reported, such as a drive it could not map.

What it changes

  • The host reads sessions from both config folders: resume, background agents' spend, and running sessions.
  • -full-access now also means "as you". It refuses to continue a session the agents saved.
  • A resumed session that the person's own claude saved stays the person's. Nothing copies conversations between the two accounts.

What it leaves alone

  • A PC with no agents' account, and that is every PC until the domain join sets AT_AGENT_ACCOUNT, starts claude exactly as today.
  • The Low trial is unchanged and never combined with this.

What it does not do

  • No fallback to the person when the broker is missing. The window says why and points to -full-access.
  • The side panel, tmux operations and Chrome for agent sessions are design step 7's host operations, still to be built.

Tests

  • internal/agent: request validation, the environment, drives, and a broker of the test's own account starting the test binary in the host's job with no window. Also its refusals for unprotected settings, a pipe of another account and no broker, a claude no host takes, and the pipe's rights.
  • internal/host: which account a start uses, -full-access on an agents' session, the notice, and a turn answered through a broker.
  • internal/claude: the arguments, and sessions found in both folders.
  • cmd: host lookup by AT_CLAUDE_HOST.
  • The account boundary itself was proved on upstairspc with a temporary standard account (recorded on SES-314).

Order: romaine-life/at-update#33 first, so at-update reads this manifest's account field. at-update is not cut over yet, so nothing registers the task before then.

Local go test on nelsonpc fails TestLowIntegrityChild the same way on main: %LOCALAPPDATA%\Temp\Low lost its Low label in the 2026-11-28 label revert.

Work package: https://openproject.home.romaine.life/wp/SES-314 Claude agents on the home PCs are moving to their own non-admin account, ROMAINE\claude. This PR is at-claude's part: the host starts claude as that account through a per-PC broker. It builds on PR 328, which made the host judge a peer by account and job membership. **What it adds** - `at-claude agent-broker -person <SID> -drive S:=\NelsonNAS\files`. It runs as the agents' account from the `at-claude-agent` boot task, which at-app.json now declares. at-update registers that task with the account's password (romaine-life/at-update#33), so the broker has a full logon and maps `S:` in it. - The broker serves `\.\pipe\at-claude-agent` to the person's SID only, and the person cannot create an instance of that pipe. The host refuses any pipe whose owner is not the agents' account. - How a start works: - The host makes claude's three pipes, which only the agents' account may open. - The broker opens them as claude's stdio and starts claude suspended with no window. The process lets the person put it in a job and end it. The broker's default DACL lets the person read every process claude's tools start, so the host's InJob check works on them. - The host puts claude in its usual kill-on-close job and checks that the pipes' client is the broker. Only then does the broker let claude run. If the host goes away first, the broker ends claude. - Claude is not in Task Scheduler's job. I checked on upstairspc that a task's job allows silent breakaway. So restarting the broker on a release leaves running sessions alone. - After that, Detach/Adopt moves, Kill and peer checks are today's code, and the agents' processes are now readable from the host's side. - Claude's environment is the agents' own logon block. From the host it takes only the session's variables (`AT_CLAUDE_*`, `AT_TMUX_*`, `TMUX*`, terminal), plus `CLAUDE_CONFIG_DIR` set to the agents' `%USERPROFILE%\.claude`, `DISABLE_UPDATES=1`, and `AT_CLAUDE_HOST`. - Claude itself runs from `C:\Program Files\at-home\claude-agent\current\claude.exe`, the agents' copy that home-sync keeps and they cannot write. - Agent sessions get `--settings {"disableAllHooks":false}`. Command-line settings outrank project and local settings (Claude Code's settings docs), so no project file the agents can write turns owner-guard's hook off. They get no `--chrome`. - The broker refuses every start until the agents cannot change their own `settings.json` or delete, rename or re-permission their `.claude`. It checks this with Windows' own AccessCheck. - The host's socket grants the agents' account access. The session tools' client commands dial `AT_CLAUDE_HOST`, because the agents cannot reach tmux or the person's hosts folder. - The window shows a notice when claude starts as the agents: what does not work there yet (side panel, window states, Claude in Chrome), plus anything the broker reported, such as a drive it could not map. **What it changes** - The host reads sessions from both config folders: resume, background agents' spend, and running sessions. - `-full-access` now also means "as you". It refuses to continue a session the agents saved. - A resumed session that the person's own claude saved stays the person's. Nothing copies conversations between the two accounts. **What it leaves alone** - A PC with no agents' account, and that is every PC until the domain join sets `AT_AGENT_ACCOUNT`, starts claude exactly as today. - The Low trial is unchanged and never combined with this. **What it does not do** - No fallback to the person when the broker is missing. The window says why and points to `-full-access`. - The side panel, tmux operations and Chrome for agent sessions are design step 7's host operations, still to be built. **Tests** - internal/agent: request validation, the environment, drives, and a broker of the test's own account starting the test binary in the host's job with no window. Also its refusals for unprotected settings, a pipe of another account and no broker, a claude no host takes, and the pipe's rights. - internal/host: which account a start uses, `-full-access` on an agents' session, the notice, and a turn answered through a broker. - internal/claude: the arguments, and sessions found in both folders. - cmd: host lookup by `AT_CLAUDE_HOST`. - The account boundary itself was proved on upstairspc with a temporary standard account (recorded on SES-314). Order: romaine-life/at-update#33 first, so at-update reads this manifest's `account` field. at-update is not cut over yet, so nothing registers the task before then. Local `go test` on nelsonpc fails `TestLowIntegrityChild` the same way on main: `%LOCALAPPDATA%\Temp\Low` lost its Low label in the 2026-11-28 label revert.
Start claude as the PC's agents' account through a broker (SES-314)
Some checks failed
Suite default / scope (pull_request) Successful in 18s
Suite go / scope (pull_request) Successful in 17s
Suite default / check-fetches (pull_request) Has been skipped
Suite go / check-test-windows (pull_request) Has been skipped
Suite go / check-services (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 20s
Suite release / module (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / home-sync (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite default / check-logs (pull_request) Successful in 25s
Suite default / check-rules (pull_request) Successful in 27s
Suite release / reused-checks (pull_request) Successful in 25s
Suite go / check-format (pull_request) Successful in 33s
Suite go / check-test-linux (pull_request) Failing after 1m22s
merge-queue CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran)
Suite default / reused-checks (pull_request) Successful in 27s
go.mod merge conflicts in TESTING.md too, not only go.mod and go.sum
Suite go / reused-checks (pull_request) Successful in 22s
a391a0f12f
On a PC naming its agents' account (AT_AGENT_ACCOUNT), the host starts claude
as that account: the agents' broker (at-claude agent-broker, a boot task run
with the account's password, which this manifest declares) opens pipes the
host made as claude's input and output and starts it suspended, in a process
the person may put in a job; the host puts it in its kill-on-close job and the
broker lets it run. Its environment is the agents' own plus the session's
variables, its config folder theirs, its program the agents' copy of Claude
Code, and it gets settings no project can override to turn hooks off. The
host's socket admits the account and its tools find it by AT_CLAUDE_HOST.
-full-access, a session the person saved, and a PC with no agents' account
start claude as the person, as before.
Collaborator

merge-queue stopped this at a391a0f: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at a391a0f: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
agent: the environment test holds on Linux's path separator too
Some checks failed
Suite release / module (pull_request) Has been skipped
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
merge-queue 2nd in line, behind #336: Take Go dependencies
Suite release / home-sync (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 30s
Suite default / scope (pull_request) Successful in 30s
Suite release / reserve (pull_request) Has been skipped
Suite go / check-services (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite go / scope (pull_request) Successful in 28s
Suite go / check-test-windows (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 21s
Suite go / check-format (pull_request) Successful in 27s
Suite default / check-logs (pull_request) Successful in 22s
Suite release / reused-checks (pull_request) Successful in 25s
Suite go / check-test-linux (pull_request) Successful in 1m10s
Suite default / reused-checks (pull_request) Has been cancelled
Suite go / reused-checks (pull_request) Has been cancelled
1a7a4d43d6
nelson force-pushed ses-314-agent-broker from 1a7a4d43d6
Some checks failed
Suite release / module (pull_request) Has been skipped
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
merge-queue 2nd in line, behind #336: Take Go dependencies
Suite release / home-sync (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 30s
Suite default / scope (pull_request) Successful in 30s
Suite release / reserve (pull_request) Has been skipped
Suite go / check-services (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite go / scope (pull_request) Successful in 28s
Suite go / check-test-windows (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 21s
Suite go / check-format (pull_request) Successful in 27s
Suite default / check-logs (pull_request) Successful in 22s
Suite release / reused-checks (pull_request) Successful in 25s
Suite go / check-test-linux (pull_request) Successful in 1m10s
Suite default / reused-checks (pull_request) Has been cancelled
Suite go / reused-checks (pull_request) Has been cancelled
to b03984d2bc
Some checks failed
merge-queue 2nd in line, behind #336: Take Go dependencies
Suite release / deliver (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 30s
Suite go / check-format (pull_request) Has been cancelled
Suite go / check-test-linux (pull_request) Has been cancelled
Suite go / reused-checks (pull_request) Has been cancelled
Suite release / reused-checks (pull_request) Has been cancelled
Suite default / check-rules (pull_request) Has been cancelled
Suite default / check-logs (pull_request) Has been cancelled
Suite go / check-services (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 26s
Suite default / check-fetches (pull_request) Has been skipped
Suite release / home-sync (pull_request) Has been skipped
Suite go / scope (pull_request) Successful in 27s
Suite go / check-test-windows (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite default / reused-checks (pull_request) Has been cancelled
2026-11-29 14:27:17 -08:00
Compare
Merge branch 'main' into ses-314-agent-broker
Some checks failed
merge-queue 1st in line, waiting for CI
Suite default / scope (pull_request) Has been cancelled
Suite default / check-fetches (pull_request) Has been cancelled
Suite default / check-rules (pull_request) Has been cancelled
Suite default / check-logs (pull_request) Has been cancelled
Suite default / reused-checks (pull_request) Has been cancelled
Suite go / scope (pull_request) Has been cancelled
Suite go / check-format (pull_request) Has been cancelled
Suite go / check-test-linux (pull_request) Has been cancelled
Suite go / check-test-windows (pull_request) Has been cancelled
Suite go / check-services (pull_request) Has been cancelled
Suite go / reused-checks (pull_request) Has been cancelled
Suite release / scope (pull_request) Has been cancelled
Suite release / module (pull_request) Has been cancelled
Suite release / reserve (pull_request) Has been cancelled
Suite release / finalize (pull_request) Has been cancelled
Suite release / home-sync (pull_request) Has been cancelled
Suite release / deliver (pull_request) Has been cancelled
Suite release / deliver-prune (pull_request) Has been cancelled
Suite release / publish (pull_request) Has been cancelled
Suite release / check-package (pull_request) Has been cancelled
Suite release / deploy-image (pull_request) Has been cancelled
Suite release / reused-checks (pull_request) Has been cancelled
30486467ed
agent: claude's output pipes grant reading their attributes and are labelled Medium; a stranger's refusal names another account (SES-314)
All checks were successful
Suite release / publish (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite go / check-test-linux (pull_request) Successful in 1m7s
Suite default / scope (pull_request) Successful in 23s
Suite default / check-fetches (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / home-sync (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 23s
Suite go / scope (pull_request) Successful in 24s
Suite go / check-services (pull_request) Has been skipped
Suite go / check-test-windows (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 25s
Suite release / reserve (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite go / check-format (pull_request) Successful in 25s
Suite release / reused-checks (pull_request) Successful in 22s
Suite default / check-logs (pull_request) Successful in 23s
merge-queue landed on main
Suite default / reused-checks (pull_request) Successful in 35s
Suite go / reused-checks (pull_request) Successful in 27s
ce7a52b6c8
merge-queue deleted branch ses-314-agent-broker 2026-11-29 14:43:41 -08:00
Sign in to join this conversation.
No reviewers
No labels
queue
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/at-claude!335
No description provided.