Skip to content

hardening: run platform services in a helper process - #67

Draft
sorah wants to merge 2 commits into
hardening/installfrom
hardening/platform-helper
Draft

sorah wants to merge 2 commits into
hardening/installfrom
hardening/platform-helper

Conversation

@sorah

@sorah sorah commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Implements docs/specs/006-platform-helper.md.

  • mairu.platform.PlatformHelper service and the PlatformServices trait; the agent spawns its own image as mairu platform-helper --fd over a socketpair created with the marker gid, keeps a pidfd, and respawns it at most once per 30 s. Every call fails closed when no verified helper runs
  • mutual verification: the helper serves only its parent (same uid, socket creator pid == getppid(), marker gid when hardened) and exits with status 3 otherwise
  • platform-services and platform-helper features, and a standalone mairu-platform-helper binary without cli code (2.9 MB release); CI builds it on Linux/macOS and adds it to the size report (5 MB ceiling)
  • system bus trust rules (pinned socket, uid-0 owner) ready for later layers
  • GetAgentStatus / doctor show the helper and merged capabilities

Concrete backends (polkit, integrity stores, notifications) come in later layers; this one serves fallback services only.

Verified in Docker (41 checks): helper verified under a hardened agent, kill and respawn, rogue callers refused (hand-started, unhardened parent, non-parent), fate sharing with the agent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM

@sorah
sorah added this pull request to stack #63 October 30, 2026 23:01
sorah and others added 2 commits October 31, 2026 08:01
The agent spawns its own image as `mairu platform-helper --fd <n>` over
a socketpair created with the marker gid raised. The helper serves only
a parent that created the pair and, when hardened, holds the marker; the
agent trusts the child it exec'd. Calls fail closed while no verified
helper runs, and the helper is respawned at most once per 30 s.

The `platform-helper` feature builds the same helper as a standalone
`mairu-platform-helper` binary without the `cli` code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM
@sorah sorah changed the title hardening/platform helper hardening: run platform services in a helper process Oct 30, 2026
@sorah
sorah force-pushed the hardening/platform-helper branch from 41f2ad8 to 8df6330 Compare October 30, 2026 23:02

This branch has not been deployed

No deployments
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.

1 participant