Repository navigation
feat(workspaces): enforce workspace policy at runtime - #1084
Draft
LinuxDevil wants to merge 1 commit into
Draft
LinuxDevil wants to merge 1 commit into
LinuxDevil wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinuxDevil
force-pushed
the
fb-prod-policy
branch
from
November 12, 2026 08:18
20bce15 to
ca70784
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
P1.5: the runtime enforces the workspace policy, already narrowed by the host ceiling. A page cannot get past workspace security through its harness,
page.jsonoragents.json.Changes
src/workspaces/runtime/policy.ts:effectiveToolsetreturnsagentTools ∩ host registry ∩ policy.tools.allow ∩ (attachment.tools.only ?? all). Tools come only from the hostHostToolRegistry, matched by name, and workspace.tsfiles are never imported. An agent tool with no matching host tool is reported as a warning.effectivePermissionsorders rules so a ceiling or workspace deny or ask always beats an agent allow. An agent allow that a policy rule shadows produces a warning at load.approvals.requireturns into an enforced approval, which also applies in workflowtoolCallsteps throughflowToolGate.agentPolicyOptionsbuilds thecreateAgentoptions for an attachment or the main agent.pagePolicyfails page start withLOUSHO_WORKSPACE_CAPABILITY_MISSING(capability-missing).alwaysAskinsrc/execution/permissions.tsis now shared withregistryEnforce.ts, so the enforced-approval wrapper is no longer duplicated.{ file }tool refs now use the stem and filltoolFiles.mcpServers,guardrails,subagents,handoffs,triggers,flow. So are the folderssubagents/,schedules/andchannels/.note-keeper) is added.LOUSHO_WORKSPACE_CAPABILITY_MISSING, plus updates to docs/errors.md and docs/workspaces.md and regenerated api reports.Testing
npx vitest run src/workspacespasses, including the ticket's six tests and a grep test checking that no code undersrc/workspaces/runtimebuilds a toolset withouteffectiveToolset.typecheck,typecheck:tests,lint,api:check,docs:llms:checkand the docs ratchet (1649 ≤ 1724) pass.devSpecTriggersfailed under full load and passes on its own.🤖 Generated with Claude Code