← Back to Pull requests

feat(permissions): a planned per-seat permission account, and setup's router-line question #1843

Closed
unknown closed this pull request without merging on Oct 23, 2026 14:05 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 12:45 UTC
Author

What a user gets

Before anything changes, an honest view of each seat's planned permissions, and a saved yes or no for the one line OpenRig can add to shared guidance files.

  • rig seat status <seat> shows what the seat's next managed launch will ask for:

  • - the native permission argument, verbatim;
    - where it comes from;
    - what OpenRig adds;
    - which recorded policy an explicit seat choice is used instead of;
    - the existing commands that change it;
    - what isn't known.

    It's labelled planned, not observed.

  • rig setup shows the exact line OpenRig can add to each seat's CLAUDE.md or AGENTS.md, which files it goes in, and what a no gives up. It saves the person's answer with rig setup --router-line yes|no. No answer isn't a yes: nothing is added.
  • This is a partial step towards letting a person choose how much OpenRig changes and how freely its agents act. It doesn't move OpenRig's other writes out of the project or isolate a person's own sessions. It names those writes instead.

    The change

    The planned permission account (permission-account.ts, on rig seat status as permissions.account):

  • Built from a fresh launch's own decisions: the binding a fresh launch starts from (the persisted policy posture, else the floor), passed through NativePermissionStore.apply, claudePostureFlag/codexPostureArg, and the team and kernel allowance lists. It adds no new rule, runs no harness and probes nothing.

  • The source:

  • - an explicit seat choice, with its actor and reason;
    - the member's or rig's policy;
    - the kernel default;
    - OpenRig's team default;
    - the floor, or a named Codex profile.

    A seat with no policy launches at the floor even when the daemon has OPENRIG_YOLO set, and the account says so. ~~An earlier head listed "the daemon's OPENRIG_YOLO" as a source and showed full bypass for such a seat~~: that was wrong, since every launch path binds the floor when no policy is recorded. Both reviewers caught it.

  • One correction: a team-default seat used to read "acceptEdits (OpenRig default)". It now reads as the team default, with the allowances and lifecycle asks OpenRig passes per launch.

  • What OpenRig adds:

  • - the team or kernel lists (exact, in JSON);
    - Codex's extra writable roots;
    - the non-interruptive flags where they apply.
  • What's unknown:

  • - native settings OpenRig doesn't manage (the person's user, project and managed Claude settings, and Codex's configuration, profiles and requirements);
    - whether the harness applies the argument;
    - Codex's network default, which is decided at launch from Codex's own configuration;
    - that this is the saved plan for a fresh launch: a restore re-reads a custom policy file, and a Codex rebuild handover can carry the previous occupant's observed sandbox and approvals instead, without the extra roots or network setting.
  • The human output replaces the old permission lines with the account when the daemon sends it. An older daemon's response still prints as before.
  • Setup's router-line question:

  • A router_line step reports the saved answer, or saves the one given with --router-line yes|no, as skills.router_line.enabled, and reads it back. It says when the environment's OPENRIG_SKILLS_ROUTER_LINE_ENABLED overrides the saved answer. A dry run saves nothing.

  • The printed preview (also in JSON as routerLine):

  • - the line verbatim;
    - the file rule;
    - what a no gives up;
    - the limit: a later no doesn't remove a line already written, and rig down removes OpenRig's blocks unless a seat of another active rig, or a still-running seat of this one, uses the file;
    - that the answer covers only this line.
  • The daemon exports the line and its preview helper (@openrig/daemon/router-line) for the CLI.
  • Setup's "OpenRig may modify" list is now complete, each entry checked at the code that writes it. It adds:

  • the managed blocks in CLAUDE.md/AGENTS.md (culture, the OpenRig Start identity pointer, onboarding at a fresh start, and guidance a team merges);

  • .openrig/context-collector.cjs;

  • Codex plugin folders;

  • .git/info/exclude entries, written only for new openrig-core plugin files (for another new file, OpenRig prints how to ignore it);

  • the Codex home's hooks, marketplace and plugin.
  • It drops the old "acceptEdits floor fragment", which nothing writes any more.

    Guidance and docs:

  • The kernel operator's plan step says how to read an existing seat's planned permissions. It no longer tells the person that a team's project settings put their own Claude Code into accept-edits mode: the shared settings fragment only enables the exa and context7 MCP servers.

  • getting-started.md tells the installing agent to show the router-line preview, ask, and save the answer.

  • cli-reference.md lists --router-line.
  • Cost: source +304/−13 across 6 files, tests +231/−3 across 3 files, docs and guidance +20/−6 across 3 files (numstat).

    How you verified it

    New tests:

  • permission-account.test.ts, one case each:

  • - the team default (the exact team lists, not "OpenRig default");
    - the kernel default;
    - an explicit Claude mode beating a recorded member policy, with its actor and reason;
    - a member's full-bypass policy;
    - Codex's team default (its roots, with network unknown);
    - a Codex profile;
    - Claude and Codex: OPENRIG_YOLO doesn't widen a seat with no policy, and the account's argument matches what the real adapter emits for the binding a fresh launch builds;
    - Pi, which has no native argument;
    - a Codex member asking for auto, which keeps the resolver's "launches at the floor" reason;
    - a Codex profile supplying the argument under a policy;
    - the account on rig seat status.
  • setup.test.ts, with a real config file in a temporary folder:

  • - an unanswered question saves nothing and isn't a yes;
    - --router-line yes and no are saved and read back, and a later bare run reports them;
    - a dry run saves nothing;
    - an environment override is named;
    - an answer other than yes or no is refused before setup runs.
  • The disclosure list's test now pins all 9 entries.

  • seat.test.ts: the human status output with an account, labelled planned, with the unknowns and controls, and without the old mode line.
  • Results, in a network-off Linux container at the exact commit (24d184f3):

  • daemon 91 of 91: permission-account, seat-status-service, s03-native-permissions, declarative-permission-modes, team-permission-default, seat-route-oracle-injection;

  • CLI 293 of 293: setup, setup-output, seat, seat-lifecycle-verbs, config-store-extended, skill-loadout-seat;

  • the full build (every package's tsc) passed with no type errors.
  • Two later commits came after that run, with CI as their proof: the seat.test.ts case (1bc54372, test only), and three review fixes (e8780420: the Codex auto fallback reason, a Codex profile under a policy, and a dry run skipping a saved answer).

    Review round 1 (86f503a6): the no-policy floor, the fresh-launch scope, and the text corrections. On the executor at exact commits: without it (e8780420 plus the new account test), daemon 10 of 12, with both new Claude and Codex checks failing on the old account's bypass claim; with it (86f503a6), daemon 93 of 93 across 5 files, CLI 124 of 124 across 3, and the full build with no type errors. A run without the change would only show the new modules missing, so none was made. No live launch was run, which is why the account says planned.

    Anything you were unsure about

  • This isn't the whole crawl. OpenRig still writes its guidance blocks, project settings, MCP and hook files, and the Codex home entries regardless of the router-line answer. Setup names them; moving them is later work.

  • Planned, not observed. The account reads stored choices and the launch decision. It doesn't read the person's own native settings layers or run Codex's configuration reader, so those stay unknown rather than guessed.

  • Seats that don't exist yet. The account covers existing seats. For a spec that hasn't launched, rig policy permissions current --spec already says per site what applies, team default included. A per-member account there needs each member's runtime from its agent spec, and isn't in this change.

  • Setup now saves a setting (skills.router_line.enabled), its first. It only does so when --router-line is given.
  • One concern per PR; no version bump; no CHANGELOG.md edit

  • Tests added or updated where the change is testable

  • I listed the checks I ran, their results, and any checks I could not run
  • 🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: mvschwarz Review duration: 80m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.80) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.80 · 650 lines diff across 8 files
    0.80
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.080
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1843"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 80.2% (HIGH) · Higher = larger blast radius
    80.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 31.7% · Safe to merge
    31.7%