Agent devices: enrolled only on Nelson's approval, SSH only as ROMAINE\claude (SES-314) #210

Merged
merge-queue merged 1 commit from agent-devices into main 2026-11-29 14:06:18 -08:00
Owner

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

The Claude agents get their own Windows account on each home PC, ROMAINE\claude in the home domain. This makes that account a device of its own, agent-<pc>, enrolled only on Nelson's approval, and makes its SSH certificates log in as that account and nothing else. Nelson's own devices, grants and certificates are unchanged.

Enrolment (src/agent-device.ts, README "Agent devices on approval"):

  • POST /api/agent-devices/requests, with a PC's own machine token and the agent account's public key, files a request for agent-<that PC>. An agent device can't file one; a key that is already a live device's is refused.
  • Nelson decides it as he decides break-glass (AGT-74): romaine-auth approve|deny --kind agent-device ID from an approver device, or /agent-device/<id>, which takes only a browser session, never an admin bearer token, and shows the key's thumbprint. A request lapses undecided after an hour.
  • Approval creates the device row under the PC's sponsor, revokes any earlier live agent-<pc>, and creates its machine account with no SSH grants. The personal enroll now refuses agent- names, so every agent device came through an approval.
  • GET /api/agent-devices/requests/<id>?wait=N lets the filing PC follow it; approved, it carries the registration.
  • Client: romaine-auth agent-device key (run as the agents' account: its own TPM key's public half; refused on an account enrolled as a PC), request [--no-wait], wait, registration, and adopt (run as the agents' account: saves the registration only after a machine token signed with its own key comes back for that device).

What an agent device may do:

  • Machine and ssh tokens only: no azure, home-cluster-break-glass or tailscale token.
  • No PC sign-in: its key never signs a browser in as its sponsor (the PC host and the redeem both refuse it).
  • No Azure access or break-glass request, and it is never an approver.
  • SSH: machineSshPrincipal (the grants route and certificate issuance) lets an agent device log in only as romaine\claude, Win32-OpenSSH's name for the domain account, and lets no other device have that login. Certificates stay permit-pty only.

Host trust (client/ssh-host.go):

  • ssh-host accepts a domain login domain\user. sshd expands %u to romaine\claude, so on Windows its principals file is romaine-principals\romaine\claude. Read from Win32-OpenSSH's contrib/win32/win32compat/pwd.c: a domain user's name is domain\user, lowercased. Its uid switching is a no-op there, so sshd reads the file as SYSTEM and today's SYSTEM-and-Administrators ACL serves a non-admin login.
  • --installed lists the login as romaine\claude. Removing it removes the domain's folder with its last file.

Not a boundary yet: until agents leave Nelson's Windows session, anything there can sign the approver's assertion or sign the browser in as him. The comments and README say so. owner-guard refusing approve/deny from a session is the interim control.

Tested: Go tests for the request, wait, adopt and key-refusal client paths, and for domain logins in ssh-host. TS tests for the agent rules, the SSH login rule through machineSshPrincipal, the agent-device decide kind, and PC sign-in refusing an agent key. Not tested live: no agent device, account or domain exists yet. A certificate login as romaine\claude belongs in the upstairspc proof.

Not here:

  • home-sync (at-home-tools) refuses a backslash login in sshPrincipals and removes installed trust it doesn't list, so the state.json line for romaine\claude waits on that change.
  • The agent's OpenProject user, session-index's ALLOWED_DEVICES entry for agent-<pc>, and strip-owner presenting --kind agent-device in the window.
Work package: https://openproject.home.romaine.life/wp/SES-314 The Claude agents get their own Windows account on each home PC, `ROMAINE\claude` in the home domain. This makes that account a device of its own, `agent-<pc>`, enrolled only on Nelson's approval, and makes its SSH certificates log in as that account and nothing else. Nelson's own devices, grants and certificates are unchanged. Enrolment (`src/agent-device.ts`, README "Agent devices on approval"): - `POST /api/agent-devices/requests`, with a PC's own machine token and the agent account's public key, files a request for `agent-<that PC>`. An agent device can't file one; a key that is already a live device's is refused. - Nelson decides it as he decides break-glass (AGT-74): `romaine-auth approve|deny --kind agent-device ID` from an approver device, or `/agent-device/<id>`, which takes only a browser session, never an admin bearer token, and shows the key's thumbprint. A request lapses undecided after an hour. - Approval creates the device row under the PC's sponsor, revokes any earlier live `agent-<pc>`, and creates its machine account with no SSH grants. The personal enroll now refuses `agent-` names, so every agent device came through an approval. - `GET /api/agent-devices/requests/<id>?wait=N` lets the filing PC follow it; approved, it carries the registration. - Client: `romaine-auth agent-device key` (run as the agents' account: its own TPM key's public half; refused on an account enrolled as a PC), `request [--no-wait]`, `wait`, `registration`, and `adopt` (run as the agents' account: saves the registration only after a machine token signed with its own key comes back for that device). What an agent device may do: - Machine and `ssh` tokens only: no `azure`, `home-cluster-break-glass` or `tailscale` token. - No PC sign-in: its key never signs a browser in as its sponsor (the PC host and the redeem both refuse it). - No Azure access or break-glass request, and it is never an approver. - SSH: `machineSshPrincipal` (the grants route and certificate issuance) lets an agent device log in only as `romaine\claude`, Win32-OpenSSH's name for the domain account, and lets no other device have that login. Certificates stay `permit-pty` only. Host trust (`client/ssh-host.go`): - `ssh-host` accepts a domain login `domain\user`. sshd expands `%u` to `romaine\claude`, so on Windows its principals file is `romaine-principals\romaine\claude`. Read from Win32-OpenSSH's `contrib/win32/win32compat/pwd.c`: a domain user's name is `domain\user`, lowercased. Its uid switching is a no-op there, so sshd reads the file as SYSTEM and today's SYSTEM-and-Administrators ACL serves a non-admin login. - `--installed` lists the login as `romaine\claude`. Removing it removes the domain's folder with its last file. Not a boundary yet: until agents leave Nelson's Windows session, anything there can sign the approver's assertion or sign the browser in as him. The comments and README say so. owner-guard refusing `approve`/`deny` from a session is the interim control. Tested: Go tests for the request, wait, adopt and key-refusal client paths, and for domain logins in `ssh-host`. TS tests for the agent rules, the SSH login rule through `machineSshPrincipal`, the `agent-device` decide kind, and PC sign-in refusing an agent key. Not tested live: no agent device, account or domain exists yet. A certificate login as `romaine\claude` belongs in the upstairspc proof. Not here: - home-sync (at-home-tools) refuses a backslash login in `sshPrincipals` and removes installed trust it doesn't list, so the state.json line for `romaine\claude` waits on that change. - The agent's OpenProject user, session-index's `ALLOWED_DEVICES` entry for `agent-<pc>`, and strip-owner presenting `--kind agent-device` in the window.
Agent devices: enrolled only on Nelson's approval, SSH only as ROMAINE\claude (SES-314)
All checks were successful
Suite tofu / check-plan (pull_request) Has been skipped
Suite web-app / scope (pull_request) Successful in 18s
Suite web-app / publish-static (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite web-app / check-image (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite tofu / apply (pull_request) Has been skipped
Suite web-app / publish (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / home-sync (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 24s
Suite default / check-logs (pull_request) Successful in 34s
Suite go / check-test-linux (pull_request) Successful in 54s
Suite tofu / reused-checks (pull_request) Successful in 35s
Suite default / check-rules (pull_request) Successful in 33s
Suite go / check-format (pull_request) Successful in 42s
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Successful in 2m14s
Suite default / reused-checks (pull_request) Successful in 42s
Suite release / check-package (pull_request) Successful in 3m58s
Suite web-app / reused-checks (pull_request) Successful in 35s
Suite web-app / check-test (.) (pull_request) Successful in 5m36s
merge-queue landed on main
Suite release / reused-checks (pull_request) Successful in 19s
Suite go / check-test-windows (pull_request) Successful in 2m9s
Suite go / reused-checks (pull_request) Successful in 21s
7ac1b9e469
merge-queue deleted branch agent-devices 2026-11-29 14:06:19 -08:00
Sign in to join this conversation.
No description provided.