Skip to content

feat(dedicated-server): support multiple agent users on one box - #219

Merged
robercano merged 1 commit into
mainfrom
feat/multi-agent-dedicated-server
Aug 5, 2026
Merged

feat(dedicated-server): support multiple agent users on one box#219
robercano merged 1 commit into
mainfrom
feat/multi-agent-dedicated-server

Conversation

@robercano

Copy link
Copy Markdown
Owner

Prep for provisioning a second and third agent user (reDeploy, reDeFi) on the box from #212/#213.

The bug this prevents

The nftables fence matched meta skuid 1001 literally, and the drop-and-log rule sits in a chain only that uid ever jumps into. A second agent user would have had no egress restriction and no alarm — an unfenced agent indistinguishable from a quiet one, which is exactly the failure mode this layer exists to prevent.

The auditd rules and divergence tripwire were merely path-hardcoded — annoying rather than dangerous.

What changes

/etc/recode-agents.conf becomes the registry (one user:repo line per agent), and everything reads it:

  • nftables matches an agent_uids set instead of a literal uid
  • posture-check.sh (was divergence-check.sh) iterates the registry for git divergence and cross-checks every registered uid against the live nftables set, paging when they disagree
  • gen-audit-rules.sh regenerates the auditd watch list from the registry

One deliberate non-automation

The nftables set is not generated from the registry. A generator that fails leaves the set empty — and empty means no agent is fenced, silently, for the one component where fail-open is least acceptable. So the set is hand-edited, and posture-check.sh makes forgetting noisy instead of invisible.

Not verified on a live box

type uid set syntax parsed correctly under nft -c but couldn't be applied without root, and there is no second agent user yet to exercise the multi-agent path. Run sudo nft -c -f before restarting the unit, and confirm with nft list set inet recode_agent agent_uids afterwards.

🤖 Generated with Claude Code

The first provisioning run hardcoded a single agent user, which would have
left the second and third silently unprotected.

The dangerous one was the nftables fence: it matched `meta skuid 1001`
literally, and the drop-and-log rule lives in a chain only that uid ever jumps
into. A second agent user would therefore have had NO egress restriction and
raised NO alarm -- an unfenced agent would look exactly like a quiet one. The
auditd rules and the divergence tripwire were merely path-hardcoded.

Introduces /etc/recode-agents.conf as the registry (one `user:repo` line per
agent) and drives everything from it:

- nftables now matches an `agent_uids` SET rather than a literal uid.
- divergence-check.sh becomes posture-check.sh: it iterates the registry for
  git divergence AND cross-checks that every registered agent's uid is present
  in the live nftables set, paging when they disagree.
- gen-audit-rules.sh regenerates the auditd watch list from the registry,
  replacing the hand-written single-user rules file.

The nftables set is deliberately NOT generated from the registry. A generator
that fails leaves the set empty, and an empty set means no agent is fenced --
fail-open, silently, for the one component where that is least acceptable. The
set is edited by hand and posture-check.sh makes forgetting noisy instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@robercano-ghbot robercano-ghbot added the needs-human Loop escalated: attempt budget exhausted, manual triage required label Aug 5, 2026
@robercano-ghbot

Copy link
Copy Markdown
Collaborator

feat(dedicated-server): support multiple agent users on one box (not yet reviewed)

@robercano
robercano merged commit 83ceab0 into main Aug 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human Loop escalated: attempt budget exhausted, manual triage required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants