Skip to content

feat(sandbox): add per-agent sandbox config overrides#351

Closed
imfing wants to merge 7 commits intoopenclaw:mainfrom
imfing:multi-agent-sandbox-config
Closed

feat(sandbox): add per-agent sandbox config overrides#351
imfing wants to merge 7 commits intoopenclaw:mainfrom
imfing:multi-agent-sandbox-config

Conversation

@imfing
Copy link
Copy Markdown
Contributor

@imfing imfing commented Jan 7, 2026

Support agent-specific sandbox settings via routing.agents.[id].sandbox.

The config schema for routing.agents.[id].sandbox is there but the implementation is missing.

Changes

  • Add resolveSandboxAgentId() to extract agent ID from session keys
  • Extend defaultSandboxConfig() to look up per-agent overrides from routing.agents.[agentId].sandbox
  • Apply per-agent config in resolveSandboxContext() and ensureSandboxWorkspaceForSession()
  • Add test coverage for per-agent sandbox configuration

Config priority

  1. routing.agents.<agentId>.sandbox.* (per-agent)
  2. agent.sandbox.* (global)
  3. Built-in defaults

This allows different agents to use different sandbox modes, workspace roots, and per-session settings.

imfing added 2 commits January 7, 2026 01:13
- Add resolveSandboxAgentId() to extract agent ID from session keys
- Extend defaultSandboxConfig() to look up per-agent overrides from
  routing.agents.[agentId].sandbox
- Apply per-agent config in resolveSandboxContext() and
  ensureSandboxWorkspaceForSession()

Config priority: per-agent → global agent.sandbox → defaults

This allows different agents to use different sandbox modes, workspace
roots, and per-session settings via the routing.agents configuration.
@imfing imfing force-pushed the multi-agent-sandbox-config branch from 8780ad8 to 3817bc3 Compare January 7, 2026 01:13
@steipete
Copy link
Copy Markdown
Contributor

steipete commented Jan 7, 2026

Thank you! Will take over!

@imfing
Copy link
Copy Markdown
Contributor Author

imfing commented Jan 7, 2026

Thank you! Will take over!

thanks!

@imfing
Copy link
Copy Markdown
Contributor Author

imfing commented Jan 7, 2026

this can probably be closed since the change is included in #380

@steipete steipete closed this Jan 7, 2026
@imfing imfing deleted the multi-agent-sandbox-config branch January 7, 2026 11:14
dgarson added a commit to dgarson/clawdbot that referenced this pull request Feb 9, 2026
* infra: consolidate tool approval types and clean protocol schema

* infra: bridge tool approval routing config into forwarder

* agents: enrich tool approval decision engine with config resolution and reason codes

* test: update tool approval tests for protocol and decision engine changes

* infra: consolidate tool approval types and clean protocol schema

* infra: bridge tool approval routing config into forwarder

* agents: enrich tool approval decision engine with config resolution and reason codes

* test: update tool approval tests for protocol and decision engine changes

* chore: conflict resolution

* chore: checkou tfrom main

* Tool approvals: preserve exec command details (openclaw#340)

* Claude/runtime orchestrator tools eu d uu (openclaw#327)

* feat(agents): add runtime tool-approval orchestrator with approvals.tools config

- Add approvals.tools config types + zod schema (enabled, mode, timeoutMs, policy, routing, classifier)
- Create tool-approval orchestrator module (decision engine, param redaction, gateway integration)
- Integrate orchestrator into before-tool-call wrapper path (runs after plugin hooks, before execution)
- Add ToolApprovalBlockedError with stable machine-readable error shape
- Add 90 tests covering all mode/decision/risk branches
- Backward-compatible: no behavior change when approvals.tools is missing or disabled

* feat: upgrade /approve and Discord handler to canonical tool approvals

- /approve now queries tool.approvals.get for canonical records and resolves
  via tool.approval.resolve (with requestHash); falls back to legacy
  exec.approval.resolve when no canonical record is found
- Discord handler listens for tool.approval.requested/resolved events and
  renders generic tool approval embeds for non-exec tools
- resolveApproval prefers tool.approval.resolve when requestHash is cached,
  keeping legacy exec path for backward compatibility
- Updated command description to 'tool approval requests'
- Added shouldHandleToolApproval for canonical event filtering
- Extended tests with canonical, legacy-fallback, and gateway-error scenarios

* refactor: rename .clawdbrain → .openclaw and fix repo/domain references

- Settings dir: ~/.clawdbrain → ~/.openclaw
- Repo references: openclaw/clawdbrain → dgarson/clawdbrain
- Domain: clawdbrain.bot → openclaw.ai
- CLI command: clawdbrain login → openclaw login
- 48 files changed across src/, docs/, apps/web/, ui/

* cron timeout fixes

* feat(agents): wire tool approval context from config into tool creation path

- Inject approvals.tools config into wrapToolWithBeforeToolCallHook context
- Populate channel field from messageProvider via resolveGatewayMessageChannel
- Wire callGatewayTool as the gateway call adapter for approval requests
- Approval context is only constructed when approvals.tools exists and is enabled

* fix: address review gaps in tool approval handler

- Exec dedup: store canonical request for exec tools and defer embed
  creation by 200ms so the legacy mirror gets first shot; if the mirror
  never arrives, fall back to a generic tool embed (future-proofs against
  legacy event removal)
- Extract sendToolApprovalEmbed to eliminate code duplication
- Add buildApprovalCustomId / parseApprovalData generic aliases (same
  wire format, clearer naming for non-exec tool code paths)
- Add alias identity tests

* fix: minor tool approval request fixes

* auto-reply/approval integration fix

* include exec approval doc

* fix: agent-runner-execution integration into auto-reply, executor/kernel fixes

* more work on agent runner and memory/heartbeta integration

* lots of tests resulting from unification of exec kernel; refactored

* Redact arrays in approval helper

* lancedb fixes

* more fixes/test updates

* fix: minor problem

* fix: restore proper non-throwing session label truncation

---------

Co-authored-by: Claude <[email protected]>

* Tool approval/protocol cleanup (openclaw#334)

* infra: consolidate tool approval types and clean protocol schema

* infra: bridge tool approval routing config into forwarder

* agents: enrich tool approval decision engine with config resolution and reason codes

* test: update tool approval tests for protocol and decision engine changes

* infra: consolidate tool approval types and clean protocol schema

* infra: bridge tool approval routing config into forwarder

* agents: enrich tool approval decision engine with config resolution and reason codes

* test: update tool approval tests for protocol and decision engine changes

* chore: conflict resolution

* chore: checkou tfrom main

* Tool approvals: preserve exec command

---------

Co-authored-by: Claude <[email protected]>

* chore: cleanup fixes

---------

Co-authored-by: Claude <[email protected]>
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.

2 participants