Skip to content

feat: add message to DEFAULT_TOOL_ALLOW in sandbox policy - #86715

Closed
Hidetsugu55 wants to merge 1 commit into
openclaw:mainfrom
Hidetsugu55:feat/sandbox-default-allow-message
Closed

Hidetsugu55 wants to merge 1 commit into
openclaw:mainfrom
Hidetsugu55:feat/sandbox-default-allow-message

Conversation

@Hidetsugu55

Copy link
Copy Markdown
Contributor

Summary

  • Add "message" to DEFAULT_TOOL_ALLOW in src/agents/sandbox/constants.ts
  • Add test coverage proving the default sandbox allowlist permits message without explicit alsoAllow config

Context

The sandbox default allowlist omitted message, which prevented agents in workspace-write sandbox mode from sending visible replies through Discord (and potentially other channels) without an explicit tools.sandbox.tools.alsoAllow: ["message"] override in openclaw.json.

This was the root cause of the Discord channel message tool injection failure, diagnosed through Cycle 2 debug logging.

Verification

  • pnpm test src/agents/sandbox/tool-policy.test.ts — 11 tests passed (1 new)
  • pnpm build — clean

After merge

The runtime workaround (tools.sandbox.tools.alsoAllow: ["message"] in openclaw.json) can be safely withdrawn.

The sandbox default allowlist omitted "message", which prevented agents
in workspace-write mode from sending visible replies without an explicit
alsoAllow override in openclaw.json. This was the root cause of the
Discord channel message tool injection failure (Cycle 2 diagnosis).

With this change, the runtime openclaw.json workaround
(tools.sandbox.tools.alsoAllow: ["message"]) can be safely withdrawn.
@Hidetsugu55
Hidetsugu55 requested a review from a team as a code owner May 26, 2026 01:38
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 29, 2026, 1:21 AM ET / 05:21 UTC.

Summary
The PR adds message to the default sandbox tool allowlist and adds one sandbox policy unit test for that default.

PR surface: Source +1, Tests +14. Total +15 across 2 files.

Reproducibility: no. high-confidence live reproduction is present. Source inspection shows current main omits message from DEFAULT_TOOL_ALLOW and uses that default to build the sandbox policy, but no real Discord/OpenClaw sandbox run was provided.

Review metrics: 1 noteworthy metric.

  • Sandbox default allowlist: 1 tool added. Changing a default tool allowlist entry affects existing sandboxed upgrades and the security posture even when no user config changes.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted real behavior proof from a sandboxed Discord/OpenClaw run after removing tools.sandbox.tools.alsoAllow: ["message"].
  • Record the maintainer decision on whether message belongs in the default sandbox allowlist or should be granted only for source-reply delivery.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Only unit/build verification is present; the PR needs redacted terminal output, logs, screenshot, recording, or linked artifact from a real sandboxed Discord/OpenClaw run showing visible replies without the alsoAllow workaround. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A real visible transport proof would materially help because the claim is that sandboxed Discord replies become visible without the config workaround. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify a sandboxed Discord channel run sends a visible reply without tools.sandbox.tools.alsoAllow ["message"].

Risk before merge

  • [P1] The contributor has not shown a real sandboxed Discord/OpenClaw run proving visible replies work after removing the tools.sandbox.tools.alsoAllow: ["message"] workaround.
  • [P1] Adding message to DEFAULT_TOOL_ALLOW makes outbound channel messaging available by default for all sandboxed runs that use the default policy, not only the reported Discord source-reply path.
  • [P1] Existing deployments using sandbox defaults may see changed visible-message behavior or a wider outbound communication surface after upgrade unless maintainers explicitly accept that new default.

Maintainer options:

  1. Require proof plus boundary approval (recommended)
    Before merge, require redacted real sandboxed Discord/OpenClaw proof without the alsoAllow workaround and maintainer approval that default sandboxed runs should include outbound message.
  2. Narrow to source-reply delivery
    Change the implementation to grant message only for the specific message-tool-only/source-reply runtime path, preserving the current default sandbox communication boundary for other runs.
  3. Accept the wider default
    Maintainers can intentionally accept the broader sandbox default if they are comfortable with the upgrade behavior and document the boundary in release notes or PR context.

Next step before merge

  • [P1] Needs contributor real behavior proof plus maintainer judgment on the sandbox default/security boundary; there is no narrow automation repair beyond choosing the product direction.

Security
Needs attention: The patch has a concrete security-boundary concern because it allows outbound message sends by default from sandboxed runs.

Review details

Best possible solution:

Land only after maintainers explicitly accept the default sandbox messaging boundary and the contributor provides redacted real behavior proof, or narrow the fix to the source-reply path that needs message.

Do we have a high-confidence way to reproduce the issue?

No high-confidence live reproduction is present. Source inspection shows current main omits message from DEFAULT_TOOL_ALLOW and uses that default to build the sandbox policy, but no real Discord/OpenClaw sandbox run was provided.

Is this the best way to solve the issue?

Unclear whether this is the best fix. The one-line default change likely addresses the reported blocked tool, but a narrower source-reply grant may preserve the sandbox boundary better unless maintainers want message as a default sandbox tool.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 8eb5ff08c86b.

Label changes

Label justifications:

  • P1: The PR targets a broken visible channel reply path in sandboxed agent runs and changes a security-sensitive default tool surface.
  • merge-risk: 🚨 compatibility: Existing sandboxed users with default policy would get a new allowed tool after upgrade.
  • merge-risk: 🚨 message-delivery: The change can alter whether sandboxed channel sessions send or suppress visible replies through the shared message tool.
  • merge-risk: 🚨 security-boundary: The patch widens the default sandbox boundary by allowing outbound channel messaging without an explicit operator allow entry.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Only unit/build verification is present; the PR needs redacted terminal output, logs, screenshot, recording, or linked artifact from a real sandboxed Discord/OpenClaw run showing visible replies without the alsoAllow workaround. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +1, Tests +14. Total +15 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 1 14 0 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 15 0 +15

Security concerns:

  • [medium] Default sandbox communication surface widens — src/agents/sandbox/constants.ts:28
    Adding message to DEFAULT_TOOL_ALLOW permits sandboxed runs using defaults to expose the outbound channel message tool without an explicit operator allow entry, so maintainers should approve that boundary before merge.
    Confidence: 0.86

What I checked:

  • Repository policy applied: Root AGENTS.md and the scoped src/agents/AGENTS.md were read; the root policy treats config/default surfaces, message delivery, and security-boundary changes as compatibility-sensitive and requires real behavior proof for user-visible changes. (AGENTS.md:12, 8eb5ff08c86b)
  • Current main default does not include message: Current main's DEFAULT_TOOL_ALLOW includes runtime, filesystem, image, session, subagent, and session_status tools, but not message. (src/agents/sandbox/constants.ts:13, 8eb5ff08c86b)
  • PR adds the default allow entry: The PR head adds message as a new DEFAULT_TOOL_ALLOW entry and adds a unit assertion that default sandbox policy contains it without alsoAllow. (src/agents/sandbox/constants.ts:28, 395683961c3d)
  • Default allowlist drives sandbox policy: resolveSandboxToolPolicyForAgent falls back to DEFAULT_TOOL_ALLOW when no explicit allow/alsoAllow is configured, so this one-line change affects default sandboxed runs. (src/agents/sandbox/tool-policy.ts:96, 8eb5ff08c86b)
  • Sandbox policy is a runtime tool gate: The embedded harness resolves sandbox runtime status and includes sandboxPolicy in the policy list that can deny all tools; the run path also applies sandbox tools to effective tool availability. (src/agents/harness/selection.ts:355, 8eb5ff08c86b)
  • Message is an outbound channel tool: createMessageTool registers the message tool as the shared send/manage message surface, so adding it to the sandbox default is an outbound communication policy change. (src/agents/tools/message-tool.ts:954, 8eb5ff08c86b)

Likely related people:

  • Peter Steinberger: Current-main blame attributes the sandbox allowlist, resolver tests, openclaw-tools message inclusion logic, and forced message-tool path to commit cb085ec. (role: recent area contributor; confidence: high; commits: cb085ec5f1f5; files: src/agents/sandbox/constants.ts, src/agents/sandbox/tool-policy.ts, src/agents/sandbox/tool-policy.test.ts)
  • Gustavo Madeira Santana: Recent git history shows substantial message tool discovery and channel plugin schema/runtime work across shared channel messaging surfaces. (role: adjacent message-tool owner; confidence: medium; commits: bb365dba7333, 0a0ca804aa18, 60104de42861; files: src/channels/plugins/message-tool-api.test.ts, src/agents/tools/message-tool.ts, extensions/discord/src/monitor/message-handler.process.ts)
  • Ayaan Zaidi: Recent history around message-tool delivery includes runner-owned delivery and message-tool-without-delivery fixes that are adjacent to the reported visible-reply behavior. (role: recent adjacent contributor; confidence: low; commits: 13a0d7a9e035, 49ae60d6cae1, 31437b9e3bd1; files: src/agents, src/channels)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@steipete

Copy link
Copy Markdown
Contributor

Closing as superseded by the narrower fix that landed in #88381 (4d135ae28bf39d82b334c690029ae4f3aad80b4f).

This PR adds message to DEFAULT_TOOL_ALLOW, which would widen the default sandbox outbound-message surface for every default sandboxed run. #88381 fixed the reported class of failures at the runtime-tool boundary instead: when message is required by forceMessageTool, message_tool_only, or an explicit runtime allowlist, local-model lean filtering now preserves it through tool construction and embedded-run schema projection.

Proof on #88381:

  • focused Vitest passed 190 tests
  • git diff --check origin/main...HEAD passed
  • PR CI had no failing or pending checks

Thanks for chasing the broken visible-reply path. The safer shape is now on main, so we should not also broaden the sandbox default allowlist here.

@steipete steipete closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants