Skip to content

feat(runner): derive the agent uid from the Runner's euid on the host backend (RIG-3512) - #1125

Merged
trunk-io[bot] merged 2 commits into
compass-service-owner/rig-3512-host-backendfrom
compass-service-owner/rig-3512-host-uid
Sep 13, 2026
Merged

feat(runner): derive the agent uid from the Runner's euid on the host backend (RIG-3512)#1125
trunk-io[bot] merged 2 commits into
compass-service-owner/rig-3512-host-backendfrom
compass-service-owner/rig-3512-host-uid

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 10 PRs:

  1. main
  2. feat(runtime): add the host-process WorkloadRuntime backend (RIG-3512) #1120
  3. "feat(runner): derive the agent uid from the Runner's euid on the host backend (RIG-3512)" (this PR)
  4. feat(runner): deliver the agent socket and config by path on the host backend (RIG-3512) #1135
  5. feat(runtime): distinguish a configured egress policy from an unset one #1142
  6. feat(runtime): refuse an egress policy the host tier cannot enforce #1143
  7. feat(runner): carry no egress policy on a backend that cannot enforce one #1145
  8. feat(runner): report the runtime tier and egress posture per session #1148
  9. feat(cli): show the runtime tier and egress posture per session #1153
  10. feat(ui): mark each agent's runtime tier and egress posture #1154
  11. feat(runner): declare the runtime tier and egress posture at enrollment #1156

The baked agent uid names the uid the agent image bakes /nix and $HOME
as. The host backend runs no image, so on a Runner whose euid is not
1000 -- the normal case, and the premise of the tier -- every provision
exec passed AsUser(1000) and the backend refused it.

The uid now comes from the Runner's own effective uid whenever the
resolved engine is the host backend, read from the engine itself rather
than by re-deriving the backend name, so the flag-then-env fallback
stays in the one place that applies it. Every container tier keeps the
baked constant, which their userns remap maps the invoking uid onto.

Geteuid returns -1 where the syscall is missing, so a negative value is
refused instead of wrapping to a huge uid. Root still falls to the
existing non-root check, which refuses it at startup rather than at the
first provision.

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

RIG-3512

@rigel-mintaka
rigel-mintaka added this pull request to stack #1126 September 12, 2026 00:25
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-service-owner-rig-35-fszb.compass-eng-docs.pages.dev

Deployed from compass-service-owner/rig-3512-host-uid at 3d66da3.

rigel-mintaka and others added 2 commits September 12, 2026 15:14
… backend (RIG-3512)

The baked agent uid names the uid the agent image bakes /nix and $HOME
as. The host backend runs no image, so on a Runner whose euid is not
1000 -- the normal case, and the premise of the tier -- every provision
exec passed AsUser(1000) and the backend refused it.

The uid now comes from the Runner's own effective uid whenever the
resolved engine is the host backend, read from the engine itself rather
than by re-deriving the backend name, so the flag-then-env fallback
stays in the one place that applies it. Every container tier keeps the
baked constant, which their userns remap maps the invoking uid onto.

Geteuid returns -1 where the syscall is missing, so a negative value is
refused instead of wrapping to a huge uid. Root still falls to the
existing non-root check, which refuses it at startup rather than at the
first provision.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…ity (RIG-3512)

The derivation read the effective uid a second time, independently of
the one the host backend captured at construction and enforces in
checkUser. The two agreed only because the euid does not change during
startup, so the contract closure was incidental rather than structural.

The host backend now names its own workspace uid from that captured
value, and the runner resolves it through a capability probe beside the
non-root check that validates the result. A backend without the
capability keeps the baked fleet constant, which is correct for the
container tiers rather than an oversight, so this probe defaults where
the preflight probe fails closed.

This also moves per-backend policy out of the runner binary, which its
own package doc says assembles flags and env and leaves seam logic to
the runner package.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-service-owner/rig-3512-host-uid branch from baac2a4 to 3d66da3 Compare September 12, 2026 19:37
@trunk-io
trunk-io Bot merged commit 684558b into main Sep 13, 2026
16 of 26 checks passed
@trunk-io
trunk-io Bot deleted the compass-service-owner/rig-3512-host-uid branch September 13, 2026 00:29
@trunk-io

trunk-io Bot commented Sep 13, 2026

Copy link
Copy Markdown

This pull request was merged into main as part of stacked PR 1156.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants