Skip to content

feat(settings): show how agents run in this workspace, and which config decided it - #4290

Merged
reachjalil merged 2 commits into
devfrom
effective-permissions-view
Sep 3, 2026
Merged

reachjalil merged 2 commits into
devfrom
effective-permissions-view

Conversation

@reachjalil

Copy link
Copy Markdown
Member

What

Settings > Permissions gains a read-only How agents run here section: what the engine will do in this workspace before asking — shell commands, file edits, web fetches, MCP tools, files outside authorized folders, .env files, repeated identical calls — shown as Runs / Asks you / Blocked, each with the config layer that decided it (engine default, your global opencode.json, OpenWork, this workspace's opencode.json) and the number of narrower rules under it.

Why

Permissions are OpenCode's; they come from three files merged in a fixed order and evaluated last-match-wins. Today none of that is visible in OpenWork, so people cannot tell whether a prompt (or its absence) comes from an engine default, their own global file, or a workspace file. This is the understanding layer that every later control builds on, and it aligns with OpenCode by design: OpenWork evaluates nothing — the rows are the engine's own answer from GET /agent, and attribution only looks up the winning rule in the files as written.

How

  • GET /workspace/:id/permissions/effective (client auth, read-only) reads /config + /agent through the existing bounded diagnostics client, picks the governing agent (configured default, else openwork, else build), and summarises with apps/server/src/effective-permissions.ts — a mirror of the engine's wildcard matcher and fromConfig flattening, used only to find the winning rule in each layer.
  • EffectivePermissionsPanel renders the rows; refreshes when authorized folders change.

Proof (head ef4a3f70f, local lane — Daytona credentials unavailable in this shell)

Check Command Result
Real engine: default install attributed to the engine with OpenWork folder grants as exceptions; global bash ask (+1 narrower allow) and workspace edit deny attributed to their layers pnpm evals:pr specs/effective-permissions-attribution.test.ts 1 passed, 2 claims ✅
Route: auth, governing agent, rows, attribution, file paths pnpm --filter openwork-server exec bun --conditions=development test effective-permissions 1 pass / 0 fail
Panel SSR (claims nothing before the engine answers; explains when unavailable) bun test --isolate tests/effective-permissions-panel.test.tsx 2 pass / 0 fail
Spec-impact guard · layers pnpm evals:pr specs/spec-impact.test.ts · pnpm --dir evals run lint:layers 6 passed · no violations
Typecheck pnpm --filter openwork-server typecheck && pnpm --filter @openwork/app typecheck 0 / 0
Full apps/server / apps/app pnpm --filter openwork-server test / pnpm --filter @openwork/app test 819 pass / 1 fail · 1124 pass / 5 fail
Control at f74c26840, same commands server 817 / 2 (same node:sqlite failure + one flaky not seen on branch) · app 1122 / 5 identical names → pre-existing

Notes

  • webfetch, websearch, todowrite, question, doom_loop are action-only in the engine schema; the summary probes them accordingly.
  • Next on this base: "Always allow in this workspace" from the prompt with a revocable list (#B), then a mode picker that edits the workspace opencode.json (#C).

@vercel

vercel Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 2, 2026 6:10pm UTC
openwork-den Ready Ready Preview Sep 2, 2026 6:10pm UTC
openwork-diagnostics Ready Ready Preview Sep 2, 2026 6:10pm UTC
openwork-landing Ready Ready Preview, v0 Sep 2, 2026 6:10pm UTC

@reachjalil

Copy link
Copy Markdown
Member Author

Test evidence — the-effective-permissions-summary-reports-the-engine-s-decisions-and-names-the-l — 0/0 screenshots passed · 2 assertions

✅ 0/0 screenshots passed · 2 assertions · 2 expectations passed · 0 failed · 0 pending

screenshots not uploaded (no BLOB_READ_WRITE_TOKEN)

ℹ️ ASSERTION — 1. A default install is reported as the engine's own posture

Engine 1.18.18: {"shell":{"action":"allow","source":"engine","exceptions":0},"edit":{"action":"allow","source":"engine","exceptions":0},"web":{"action":"allow","source":"engine","exceptions":0},"mcp":{"action":"allow","source":"engine","exceptions":0},"outside_folders":{"action":"ask","source":"engine","exceptions":5},"env_files":{"action":"ask","source":"engine","exceptions":2},"doom_loop":{"action":"ask","source":"engine","exceptions":0}}.

  • ✅ PASS A default install is reported as the engine's own posture — Engine 1.18.18: {"shell":{"action":"allow","source":"engine","exceptions":0},"edit":{"action":"allow","source":"engine","exceptions":0},"web":{"action":"allow","source":"engine","exceptions":0},"mcp":{"action":"allow","source":"engine","exceptions":0},"outside_folders":{"action":"ask","source":"engine","exceptions":5},"env_files":{"action":"ask","source":"engine","exceptions":2},"doom_loop":{"action":"ask","source":"engine","exceptions":0}}.

ℹ️ ASSERTION — 2. Each decision is attributed to the layer that wrote the winning rule

Global {bash: ask + "git status *" allow, webfetch: ask} and workspace {edit: deny} → {"shell":{"action":"ask","source":"global","exceptions":1},"edit":{"action":"deny","source":"workspace","exceptions":0},"web":{"action":"ask","source":"global","exceptions":0},"mcp":{"action":"allow","source":"engine","exceptions":0},"outside_folders":{"action":"ask","source":"engine","exceptions":4},"env_files":{"action":"ask","source":"engine","exceptions":2},"doom_loop":{"action":"ask","source":"engine","exceptions":0}}.

  • ✅ PASS Each decision is attributed to the layer that wrote the winning rule — Global {bash: ask + "git status *" allow, webfetch: ask} and workspace {edit: deny} → {"shell":{"action":"ask","source":"global","exceptions":1},"edit":{"action":"deny","source":"workspace","exceptions":0},"web":{"action":"ask","source":"global","exceptions":0},"mcp":{"action":"allow","source":"engine","exceptions":0},"outside_folders":{"action":"ask","source":"engine","exceptions":4},"env_files":{"action":"ask","source":"engine","exceptions":2},"doom_loop":{"action":"ask","source":"engine","exceptions":0}}.

Test run created 2026-09-01T23:59:41.924Z · Source: evals/results/test-runs/2026-09-01T23-59-41-924Z-the-effective-permissions-summary-reports-the-engine-s-decisions-and-names-the-l/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4290 --test-run 2026-09-01T23-59-41-924Z-the-effective-permissions-summary-reports-the-engine-s-decisions-and-names-the-l

@diff-warden diff-warden 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (ef4a3f70fdeb8e50351384da1c556a4bd833d5fa). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

…ig decided it

Settings > Permissions gains a read-only "How agents run here" section. It
asks the engine for the evaluated permission ruleset of the agent that governs
new threads and summarises the decisions people care about — shell commands,
file edits, web fetches, MCP tools, files outside authorized folders, .env
files, repeated identical calls — as runs / asks you / blocked. Each row names
the layer whose rule won: the engine's default, the user's global
opencode.json, OpenWork, or this workspace's opencode.json, plus how many
narrower rules (allow-lists, folder grants) sit under it.

OpenWork evaluates nothing itself: the ruleset is the engine's own answer from
GET /agent, read through the bounded diagnostics client, and attribution only
looks up the winning rule in the three config files as written, in the
engine's merge order. The section refreshes when authorized folders change.
…ed engine

Boots the real engine with a user global file, OpenWork's rendered injected
file, and a workspace file, then runs the server's own summary over the
engine's evaluated ruleset: a default install is reported as the engine's
posture with OpenWork's folder grants as exceptions, and when the global file
asks for shell commands while the workspace file denies edits, each row is
attributed to the layer that wrote its winning rule.

@diff-warden diff-warden 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (986ab093e9983732f56457578bce38cc04289d71). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil merged commit 5c77e3d into dev Sep 3, 2026
24 checks passed

This branch was successfully deployed

4 active deployments
Preview – openwork-den — 986ab093 Deployed Sep 2, 2026 by vercel[bot]
Preview – openwork-landing — 986ab093 Deployed Sep 2, 2026 by vercel[bot]
Preview – openwork-app — 986ab093 Deployed Sep 2, 2026 by vercel[bot]
Preview – openwork-diagnostics — 986ab093 Deployed Sep 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants