Policy: add agent workspace conformance checks#85096
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-23 03:21 UTC / May 22, 2026, 11:21 PM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: not applicable. this is a new Policy plugin conformance/config surface rather than a bug report. The PR body includes redacted live CLI output and focused tests that give a clear behavior path for the new checks. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Merge only after a human maintainer approves the config-only agent workspace semantics, attestation-hash impact, and sequencing with the adjacent Policy posture stack. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a new Policy plugin conformance/config surface rather than a bug report. The PR body includes redacted live CLI output and focused tests that give a clear behavior path for the new checks. Is this the best way to solve the issue? Yes, with maintainer approval: the Policy plugin is the right owner for config-level conformance, and runtime enforcement should remain a separate decision unless maintainers choose a broader security model. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 2edd6e24621d. |
34c3331 to
6acb671
Compare
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Velvet Signal Puff Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
6acb671 to
9353459
Compare
|
Updated this PR after the predecessor fixes:
Proof run on this head:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9353459 to
fef9d4d
Compare
|
@clawsweeper re-review |
|
@galiniliev this is ready for review when you have a chance. I restacked it on the merged gateway policy base, kept it config/policy-conformance only, updated the docs/body with the agents.workspace syntax, and added redacted CLI proof for malformed policy, nonconforming workspace/tool posture, and accepted read-only posture. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
fef9d4d to
387e11a
Compare
|
@clawsweeper re-review |
|
@galiniliev quick update: I rebased the full policy stack onto current main to clear the shrinkwrap guard, pushed signed head 387e11a, and refreshed the PR body/proof. Still config/policy-conformance only, no runtime enforcement. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
17bd305 to
cf233b7
Compare
cf233b7 to
e0edcdf
Compare
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
* feat(policy): add agent workspace conformance * chore(policy): refresh agent workspace checks * fix(policy): require enabled sandbox for workspace policy * fix(policy): align agent workspace evidence with runtime
Summary
Adds a policy-only conformance surface for locking agent workspace posture down to read-only/no-write configurations.
workspaceAccess, sandbox mode, and tool deny coverage as policy evidenceagents.workspace.allowedAccessandagents.workspace.denyToolschecksoffsandbox mode as nonconforming for read-only/no-write workspace policyThis is stacked after #81981 and intentionally stays at config/policy conformance level; it does not add runtime enforcement.
Policy syntax
{ "agents": { "workspace": { "allowedAccess": ["none", "ro"], "denyTools": ["exec", "process", "write", "edit", "apply_patch"], }, }, }For this policy to pass, the matching OpenClaw config must explicitly enable sandbox mode for the applicable defaults or agent and set
workspaceAccessto an allowed value. A config that omits sandbox mode, or sets it tooff, does not satisfy a read-only/no-write posture even ifworkspaceAccessisro.Enabling or upgrading these rules adds
agentWorkspaceevidence to the workspace and attestation hashes. Operators should review the new evidence and refresh accepted attestation hashes after enabling these rules.Verification
git diff --checkpnpm docs:listpnpm exec oxfmt --write --threads=1 extensions/policy/src/policy-state.ts extensions/policy/src/doctor/register.ts extensions/policy/src/doctor/register.test.ts docs/cli/policy.md docs/plugins/reference/policy.mdnode scripts/run-vitest.mjs extensions/policy/src/doctor/register.test.ts --run --reporter=dot(114 passed)node scripts/run-vitest.mjs extensions/policy/src/cli.test.ts --run --reporter=dot(12 passed)pnpm docs:check-mdx docs/cli/policy.md docs/plugins/reference/policy.md/mnt/c/src/claws-hapi/.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --reviewer codex --fallback-reviewer none(clean: no accepted/actionable findings)Real behavior proof
Behavior addressed: Policy conformance can require agent sandbox workspace access to stay within an allowlist and require explicit deny coverage for shell/process/file-mutation tools. It now rejects read-only/no-write workspace policy when sandbox mode is omitted or
off.Real environment tested: WSL checkout at
/root/src/openclaw-policy-agent-workspaceon Ubuntu-24.04.Exact steps or command run after this patch: direct
policyCheckCommand({ cwd, json: true, severityMin: "error" })against temp OpenClaw configs under/tmp/policy-proof-85096-refresh, withOPENCLAW_CONFIG_PATHset to each config.Evidence after fix: Sandbox omitted/off plus
workspaceAccess: "ro"producedpolicy/agents-workspace-access-deniedatoc://openclaw.config/agents/defaults/sandbox/mode; explicit sandboxmode: "all",workspaceAccess: "ro", andgroup:runtime/group:fsdenies producedok: true.Observed result after fix: The policy check emitted
agentWorkspaceevidence with sandbox mode fields and no longer accepts a default unsandboxed config as read-only/no-write compliant.What was not tested: No runtime sandbox/tool enforcement was tested because this PR only adds config-level policy conformance.
Redacted CLI evidence
Sandbox omitted/off:
{ "exitCode": 1, "ok": false, "checksRun": 30, "findings": [ { "checkId": "policy/agents-workspace-access-denied", "message": "agents.defaults sandbox mode 'off' is not allowed by policy.", "ocPath": "oc://openclaw.config/agents/defaults/sandbox/mode" } ] }Accepted read-only posture:
{ "exitCode": 0, "ok": true, "checksRun": 30, "findings": [] }