Skip to content

Add opt-in Full Access policy for automations and bot launches - #47534

Open
beatkapo wants to merge 1 commit into
stablyai:mainfrom
beatkapo:beatkapo/automation-full-access
Open

beatkapo wants to merge 1 commit into
stablyai:mainfrom
beatkapo:beatkapo/automation-full-access

Conversation

@beatkapo

@beatkapo beatkapo commented Nov 23, 2026 •

Copy link
Copy Markdown

ELI5

Allow an owner to opt all automations and selected bots on a host into Full Access without changing unrelated manual-chat defaults.

What Changed

Add a default-off automationFullAccess host policy and a settings-write RPC with a durable compare-and-set update. Apply the policy before creating automation chats or terminals, including bot launches. Update reused chat permissions before delivery, including recovered group messages. Start a fresh terminal when the policy is enabled so an existing restricted process cannot be reused.

Add an independently selected fullAccessBotIds list for ordinary bot conversations and local descendant workers. Reuse the durable dispatch-creator walk to propagate the choice to workers and their handoffs. Reused structured workers receive the permission before delivery; closed-worker follow-ups start fresh with prior-work context. Existing PTY reuse refuses. Selected-bot remote worker starts refuse before forwarding because the federation protocol does not yet carry this policy. That limitation is explicit rather than claiming remote parity.

The policy covers existing and future automations without rewriting their schedules, prompts, enabled states, business authorization or agent arguments. Unsupported agents refuse the launch. Add a policy activation script, read-only Codex transcript audit, inert probe-plan generator and deployment/rollback instructions in config/scripts/automations/README.md.

Why

Automation bot launches previously inherited the bot's manual-chat permission choice. A final saved Full Access label also cannot prove that the original provider thread started with those permissions. Apply the choice before creation and require provider transcript evidence for deployment verification.

Linked Issue

Fixes #11043

Visual Proof

N/A — no rendered UI or interaction controls change; this adds a host policy and launch behavior.

Testing

  • Manually exercised read-only policy inspection against an older installed host (unsupported, no writes), positive and negative transcript audits, and the inert probe generator on Windows.
  • Added real policy projection and persistent session-store regression coverage.
  • Tests assert automation/manual isolation and saved permission survival after reopening the store; the persistence expectation fails without the change.
  • Targeted persistence test passes. ORCA_BACKGROUND_LAUNCH=1 timeout 900 pnpm check:changed --base=HEAD passed all 31 checks in 383.7 seconds on Windows before commit 50d4e3a984d.
  • Windows release JavaScript/assets and NSIS packaging passed at 50d4e3a984d, producing local unsigned version 1.4.267-automation.1. Read-only ASAR inspection confirms both policy keys and the update RPC are packaged. Installer SHA-256: f07f5abca021ce027dbd5759d3404752d41c47bb97cbe4928425d6da579b3887. No installer has been executed.
  • No production automation has been run and no installed application has been restarted. Actual fresh-provider-thread verification remains a post-deployment step.

Performance

The policy adds a settings read per automation launch and a session permission write when a reused chat needs changing. It adds no polling or startup scan. Full Access opts reused terminal automations into fresh processes, trading process startup cost for an effective launch permission guarantee.

Risk

Level: High when explicitly enabled; default-off for existing installations.

Full Access selects the provider's unrestricted mode for the opted-in work. Provider-managed constraints and project deny rules remain authoritative; Claude's bypass mode does not remove deny rules. Shared-chat changes persist and therefore also affect later manual turns in those particular chats. They do not change global manual-chat defaults. Disabling automation elevation and clearing the bot list stops future elevations but does not restore individual chat choices; capture them before activation and restore only unchanged choices through supported APIs during rollback. Downgrading the binary alone is insufficient. Remote automation owners need the corrected build and their own opt-in; forwarding selected-bot workers remotely is currently refused. No schema migration or direct database modification is used.

AI Disclosure

Prepared and self-reviewed with OpenAI Codex. Human deployment coordination is still required.

Review

Reviewed launch choice precedence, opt-in/manual isolation, shared-chat persistence, recovered delivery, unsupported providers, durable update concurrency, terminal reuse, and older-host refusal. Codex's existing turn admission applies the stored choice on the next turn; a record label is not used as runtime verification evidence.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer material copied.

Checklist

  • Focused on automation permissions.
  • Explained behavior and mechanism.
  • Stated persistent-data and permission risks and rollback limits.
  • N/A visual proof with reason.
  • Self-reviewed correctness, security and performance.
  • Cross-platform and remote-host behavior considered; only Windows executed locally.
  • Changed-file gate and local Windows package build pass.

Upstream CI is not green: the five fork-PR workflows returned action_required before creating jobs. The contributor has READ access to upstream; workflow approval is outside that permission. No review approval is claimed.

Before claiming complete descendant coverage, follow-up work must transport a typed, capability-gated policy through both federation protocols, persist authenticated policy provenance on receiving dispatches, and record durable parent/child provenance for handoff chains outside worker lineage. Old receivers must keep refusing rather than dropping the policy. Contract round-trips, restart persistence and unrelated-chat isolation need coverage before rebuilding and attempting provider-thread verification.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The change adds host-level automation full-access settings and an optional bot allowlist, with an RPC and CLI for policy updates. Automation and bot-chat flows apply full-access permissions to launches and sessions. Worker placement propagates the policy to new or reused sessions, while selected remote starts reject unpropagated bot access. New scripts and documentation cover probe preparation, transcript audits, deployment, and rollback.

Merge Risk: Moderate · up to 50d4e · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

The opt-in Full Access policy does not take effect in several paths, including structured workers, terminal automations whose args set a permission, and agent.launchReplay launches. The documented rollback can also leave selected bots elevated. The feature is off by default, but these gaps should be fixed before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Add opt-in Full Access policy for automations and bot launches" matches the main change. The changeset adds a default-off automationFullAccess host policy and a fullAccessBotIds selection, …
Linked Issues check Passed [#11043] The issue asks that an automation can run in yolo mode, without that mode becoming the default for the agent or project. The PR meets this request through the coding changes in the reviewed s…
Out of Scope Changes check Passed The changes support the Full Access opt-in and its verification. They are not unrelated to #11043:
- Policy, settings, RPC, and launch changes implement the requested behavior.
- The shared `botOnAgen…
Description check Passed The PR description is thorough and covers nearly every template section. The ELI5, What Changed, Why, Linked Issue (Fixes #11043), Visual Proof (N/A with reason), Testing, Performance, Risk (Level: Hi…
Full details: Title check

Explanation

The title "Add opt-in Full Access policy for automations and bot launches" matches the main change. The changeset adds a default-off automationFullAccess host policy and a fullAccessBotIds selection, and applies them to automation and bot launches. The title is specific and concise, and it does not cover the audit scripts, the rollback docs, or the worker changes.

Full details: Linked Issues check

Explanation

[#11043] The issue asks that an automation can run in yolo mode, without that mode becoming the default for the agent or project. The PR meets this request through the coding changes in the reviewed summary:

  • automationFullAccess defaults to off. RuntimeClientSettingsController.get() resolves it as true only when the stored value is exactly true.
  • automationChatPermissionMode in src/shared/automations/launch/automation-permission-policy.ts selects full access only for automation runs when the host policy is on, or when the bot ID is in fullAccessBotIds. Manual chats keep their fallback mode.
  • launchAutomationChatAgent, launchAutomationTerminalAgent, reuseAutomationChat, bot-group-delivery.ts, and the worker placement path apply the choice before chat or terminal creation or delivery. Reused terminals start fresh when full access is enabled.
  • The automation.setPermissionPolicy RPC performs a compare-and-set update of the policy, and it rereads the stored value.
  • Automated tests cover the projection and the persistence of the saved permission. The summary records a Windows run of pnpm check:changed.

The PR does not add a general ability to set arbitrary agent parameters. The PR text states this scope limit. The issue body asks only for yolo-mode automation without a default change, so the narrower scope satisfies the directly linked requirement. The remote-worker refusal is an explicit limitation, not a coding requirement of the issue. The ignored generated RPC catalog file was not inspected. This does not change the verdict, because the issue does not depend on it.

Full details: Out of Scope Changes check

Explanation

The changes support the Full Access opt-in and its verification. They are not unrelated to #11043:

  • Policy, settings, RPC, and launch changes implement the requested behavior.
  • The shared botOnAgent move and the export of startedForBot support reuse of the bot-agent setup and worker-keep-open logic. They do not add new behavior.
  • The PowerShell audit scripts, the inert probe-plan generator, and the policy activation script in config/scripts/automations/ verify and deploy the policy. The PR description states that verification of a fresh provider thread is required before the policy is trusted. These scripts do not run production actions. The probe generator marks executes as false.
  • The README documents deployment, rollback, and the limits of saved state.

The tooling is larger than the code change strictly requires. It remains connected to the same policy and is explicitly described in the PR. No change was found that is unrelated to automation or bot Full Access permissions.

Full details: Description check

Explanation

The PR description is thorough and covers nearly every template section. The ELI5, What Changed, Why, Linked Issue (Fixes #11043), Visual Proof (N/A with reason), Testing, Performance, Risk (Level: High, with rollback limits), AI Disclosure, Review, upstream boundary and Checklist are all filled in with specific content. The description is detailed about behavior, scope, and the limits of rollback. Its gaps are minor: the Testing checklist items are checked, but the Testing section's manual steps are listed as results rather than reproducible steps for a reviewer. The Testing section also reports that the final Windows rebuild is pending, which is a status note rather than a missing section. The Notes section of the template is absent, and the description adds an unusual claim that upstream CI is not green, which is informational rather than a blocker. Overall the description is mostly complete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b67cf3cb-5934-4721-9e80-da013537a236
Commits

Reviewing files that changed from the base of the PR and between b7fd7ca and 50d4e3a.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 32

  • config/scripts/automations/README.md
  • config/scripts/automations/audit-automation-access.ps1
  • config/scripts/automations/audit-claude-access.ps1
  • config/scripts/automations/prepare-automation-access-probe.ps1
  • config/scripts/automations/set-automation-access.ts
  • src/main/automations/bot-automation-launch.ts
  • src/main/automations/launch/automation-chat-agent-launch.ts
  • src/main/automations/launch/automation-chat-permission.test.ts
  • src/main/automations/launch/automation-chat-permission.ts
  • src/main/automations/launch/automation-chat-session-reuse.ts
  • src/main/automations/launch/automation-terminal-launch.ts
  • src/main/bots/bot-chat-session.ts
  • src/main/bots/bot-full-access-policy.ts
  • src/main/bots/bot-group-delivery.ts
  • src/main/runtime/client/settings/runtime-client-settings-shape.ts
  • src/main/runtime/client/settings/runtime-client-settings.ts
  • src/main/runtime/construction/runtime-store-contract.ts
  • src/main/runtime/orchestration/federation/remote-owned/remote-owned-start.ts
  • src/main/runtime/orchestration/legacy-remote-home/federated-worker-start.ts
  • src/main/runtime/rpc/methods/agent-launch/agent-launch.ts
  • src/main/runtime/rpc/methods/agent-launch/bot-handoff-permission-policy.ts
  • src/main/runtime/rpc/methods/automations/automations.ts
  • src/main/runtime/rpc/methods/orchestration/worker/start/placement/worker-permission-policy.ts
  • src/main/runtime/rpc/methods/orchestration/worker/start/placement/worker-placement-topology.ts
  • src/main/runtime/rpc/methods/orchestration/worker/start/placement/worker-start-agent-placement.ts
  • src/main/runtime/rpc/methods/orchestration/worker/start/placement/worker-worktree-creation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/start/worker-keep-open-default.ts
  • src/shared/automations/launch/automation-permission-policy.test.ts
  • src/shared/automations/launch/automation-permission-policy.ts
  • src/shared/bots/bot-agent-setup.ts
  • src/shared/rpc-contract/automations/automation-params.ts
  • src/shared/settings/global-settings-base.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

$ErrorActionPreference = 'Stop'
$frames = @(Get-Content -LiteralPath $WireTranscript | ForEach-Object {
$frame = $_ | ConvertFrom-Json
if ($frame.type -eq 'system' -and $frame.subtype -in @('init', 'status') -and $null -ne $frame.permissionMode) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Check session identity before filtering out frames without a mode.

An init frame for session A with bypassPermissions, followed by a status frame for session B without permissionMode, passes this audit. Line 8 discards B before the mixed-session check. Status frames can omit permissionMode. (code.claude.com)

Validate session_id on all captured init and status frames. Apply the mode check only when a mode is present. This preserves valid A-only status frames and enforces the README's mixed-session rejection.

Record its source commit and SHA-256, and retain the previous signed installer.
Installing/restarting requires a coordinated maintenance window; building does not.

To undo activation, use `set-automation-access.ts disable` with a new backup path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Security & Privacy · Quick win

Clear the selected-bot policy during rollback.

If activation set fullAccessBotIds, disable without the third argument preserves that list. Selected bots therefore remain eligible for Full Access even after automationFullAccess becomes false. Restoring their chat permissions does not stop a later qualifying delivery from elevating them again. (raw.githubusercontent.com)

Document disable <new-backup-path> none when undoing the bot selection. Verify both settings before restoring chat choices or downgrading. If some bot selections predate activation, state how to restore that recorded list instead.

? { from }
: {}
const body = { ...botMessageBody(text, run), ...sender }
await deps.prepareAutomation?.(sessionId, botId, run?.automation === true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Heavy lift

Make a failed live permission update fail automation delivery.

prepareAutomationFullAccess resolves once setOption writes the stored permission. Refusals throw, but the live update does not. applyStructuredAgentSessionPermissionPick is not awaited. It returns silently when the child is not ready, the fence differs, or the adapter lacks applyPermissionMode. Its rejection is only logged. A running provider can therefore receive the automation turn while still restricted, and the caller receives no error.

For automation runs, delivery must not proceed until the running provider has accepted Full Access, or it must fail before the turn is sent. That failure must reach the caller. The change must keep manual permission picks unchanged, and the required behavior for a child that is not running must stay as the stored-mode launch path defines it.

policy?: HostLaunchContext['agentLaunchPolicy']
): Promise<AgentLaunchResult> {
const host = { ...context, agentLaunchPolicy: policy }
params = botHandoffPermissionPolicy(params, context)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Data Integrity & Integration · Heavy lift

Keep policy-derived Full Access options out of the launch fingerprint.

botHandoffPermissionPolicy adds permissionMode: 'full-access' to sessionOptions and chatOptions before computeAgentLaunchFingerprint runs. The policy depends on the mutable bot selection. An unchanged retry of an admitted bot launch therefore gets a different digest once its bot is selected, or once it arrives through agent.launchReplay, which does not apply the policy. The launch is refused with agent_session_operation_conflict instead of replaying its recorded answer.

The fingerprint contract excludes mutable host settings so that an honest retry does not conflict. The policy-derived permission options violate that contract. Compute the fingerprint from the caller's request before the policy applies, and use the same basis on the agent.launch and agent.launchReplay paths.


Major · Functional Correctness · Heavy lift

Apply the bot Full Access policy to fresh agent.launchReplay admissions.

The agent.launchReplay handler calls runReplaySafeAgentLaunch without botHandoffPermissionPolicy. agent.launch applies that policy in launchAgentOnHost. A selected bot's CLI launch with an operationId therefore runs without the Full Access session and chat options. It also accepts reuseTerminal, which the policy otherwise refuses.

Enforce the policy on fresh admissions in this endpoint, so both RPC entry points apply it. Replays of already-admitted operations must still return the stored result. The policy must not change the fingerprint of a replayed operation or refuse such a replay.

if (previous !== expected || !sameBots(previousBots, expectedBotIds)) {
throw new InvalidArgumentError('Automation permission policy changed; read it again.')
}
if (botIds.some((id) => !runtime.bots.list().some((bot) => bot.id === id))) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Deleted bots stay in the Full Access list and block policy changes.

Deleting a bot does not remove its ID from fullAccessBotIds. The automation.setPermissionPolicy handler then rejects every request that includes that ID, even when enabled is false. The repository's set-automation-access.ts script sends the stored list by default, so disable fails with "Full Access policy names an unknown bot." The rollback path that the PR describes, clearing the policy, is blocked until the operator passes a bot list that excludes the deleted ID.

The required behavior is that a deleted bot cannot block a policy change. Choose the fix: remove the ID when the bot is deleted, or ignore unknown IDs when the policy is cleared. Either way, the policy must still reject unknown IDs in an enable request.

const options = narrowStructuredLaunchSeedOptions(args.launchPreferences)
const options = narrowStructuredLaunchSeedOptions({
...args.launchPreferences,
...(args.fullAccess ? { permissionMode: 'full-access' } : {})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

Structured workers drop the Full Access selection before creation.

narrowStructuredLaunchSeedOptions copies only model, effort, fastMode, and serviceTier. The permissionMode: 'full-access' value added for fullAccess is discarded there. fullAccess is not forwarded to createStructuredWorkerSession. A selected structured worker therefore starts without Full Access, whether its launch preferences are empty or hold a saved restricted mode.

When fullAccess is true, the created structured worker must hold Full Access before its first delivery. The fix must carry that permission through to session creation without changing how the narrowing function treats other saved values.

Comment on lines +30 to +45
export function automationWithFullAccess<
T extends AutomationLaunchSetup & { agentId: TuiAgent; launchSetup?: AutomationLaunchSetup }
>(automation: T, enabled: boolean): T {
if (!enabled) {
return automation
}
if (!agentPermissionChoices(automation.agentId).includes('full-access')) {
throw new Error(`${automation.agentId} cannot start this automation with Full Access.`)
}
const setup = automationCanonicalLaunchSetup(automation)
const launchSetup = {
...setup,
launchPreferences: { ...setup.launchPreferences, permissionMode: 'full-access' as const }
}
return { ...automation, ...launchSetup, launchSetup }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Heavy lift

A Full Access terminal automation can launch without Full Access when its args set a permission.

For a terminal automation, automationWithFullAccess sets launchPreferences.permissionMode to full-access. It leaves launchSetup.agentArgs unchanged. When those args already set a permission, the launch builder adds no Full Access flag. Examples are Codex -a on-request -s read-only and Claude --permission-mode default. The final command keeps the restrictive flags. The automation runs in the restricted mode, and no error is reported.

Unattended runs with restricted modes can stall on approval prompts or fail on writes. The automation then does not run as the enabled Full Access setting requires.

The agentArgs value must stay unchanged, as the PR states. The launch must either start in Full Access or refuse to launch when the args conflict with it. Choose the mechanism. Refusal matches how unsupported agents already refuse launch.

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.

[Feature] automation cannot set params on agents

1 participant