Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 03153551-136c-49df-a726-242cd03f26a4
|
No need to talk about “session-wide” in description |
|
|
||
| ## Motivation | ||
|
|
||
| OpenClaw currently applies a sandbox policy at a broader session or backend |
There was a problem hiding this comment.
Policies are already applied per tool, no? How does this interact with existing policy config file?
There was a problem hiding this comment.
The existing MXC policy provides a default policy config applied to every MXC-backed call. This proposal adds stored policies for specific tools or arguments. I'm updating the RFC to explicitly state how the per tool policies will interact with the default policy.
| - Allow settled policies to proceed without prompting. | ||
| - Prompt for an operator decision when a matching policy is still in | ||
| development. | ||
| - Persist mutable policy state in OpenClaw's SQLite state database. |
There was a problem hiding this comment.
Do we need to guarantee that openclaw itself is not able to modify these files during runtime without user intervention?
There was a problem hiding this comment.
OpenClaw needs trusted runtime access to update policy lifecycle and usage metadata. The guarantee should be that MXC-backed tool execution cannot modify the policy store directly. Policy changes should only occur through the MXC plugin and supported operator management paths
|
|
||
| ## Goals | ||
|
|
||
| - Evaluate tool calls against local policy before execution. |
There was a problem hiding this comment.
Requested policy is a union of policy settings as configured by gateway admins and per tool policy from policy store. Please update the design accordingly.
There was a problem hiding this comment.
The next iteration I'm sending out will more explicitly state how the default policy applied to every tool will be composed with the per tool policies.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1255dade-bf9b-4463-8c58-52c3470abff8
Idk how to directly reply to this but agree session is overloaded term here. Going to rephrase. The session-wide meant the chat session (i.e. the existing default policy that can be set which applies to every single tool call) |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de39d8d8-c02d-4bc5-a0ca-b15a964b2493
|
|
||
| ## Goals | ||
|
|
||
| - Select a sandbox configuration for each OpenClaw tool call. |
There was a problem hiding this comment.
Open question on per agent, per tool sandbox configurations
There was a problem hiding this comment.
Updated the RFC to clarify this. Per-tool sandbox configurations are stored globally, not per agent, but they are composed with the invoking agent’s resolved sandbox settings and cannot widen that agent’s access
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e7b77e58-db8b-4dea-a202-b2d397478725
|
|
||
| ### Ownership | ||
|
|
||
| The MXC plugin registers a low-priority `before_tool_call` hook. Ordinary hooks |
There was a problem hiding this comment.
Registers only when MXC plugin is enabled right?
There was a problem hiding this comment.
Yes. The hook is registered only when the MXC plugin is enabled. I’ll make that explicit.
| - Keep configuration selection and MXC enforcement in the OpenClaw MXC plugin. | ||
| - Support exact and per-tool wildcard configuration matching. | ||
| - Allow calls with no matching configuration to preserve existing behavior. | ||
| - Persist mutable per-tool sandbox configurations in OpenClaw's SQLite state |
There was a problem hiding this comment.
is this openclaw sqlite corrupt free from both the tools & models / orchestration / agent loop?
There was a problem hiding this comment.
Sandboxed tool processes cannot access the OpenClaw state directory, and the model has no direct database access. Writes go through the trusted MXC plugin using OpenClaw’s validated plugin-state API rather than direct SQLite access.
The OpenClaw host and trusted plugin code necessarily retain access to manage the entries. Store read, parse, or corruption errors fail the governed tool call closed
| operation; OpenClaw starts a new tool execution. A denial that requires | ||
| changing the shared baseline or per-agent settings is reported as a baseline | ||
| configuration change instead of a per-tool change. OpenClaw will not persist | ||
| the denial document, ETL, raw events, or a separate learning session. |
There was a problem hiding this comment.
App caller is responsible for deleting the json files.
There was a problem hiding this comment.
Thanks, I’ll make that lifecycle explicit.
OpenClaw will read and validate the per-run denial JSON after the process exits, retain only the reviewed configuration result in memory or SQLite, and delete the raw JSON on every terminal path. ETL retention will remain disabled, and OpenClaw will clean up any reported retained artifact if one is produced.
| applies to all argument sets for that tool. Configurations are shared across | ||
| agents but are composed with the invoking agent's resolved sandbox settings. | ||
|
|
||
| ### Sandbox configuration fragment |
There was a problem hiding this comment.
@asklar @richiemsft I'm not sure if SandboxPolicy would be better for OpenClaw to store and then call createConfigFromPolicy(). SandboxPolicy seems better for cross platform usage but it seems like it's missing platform specific fields that ContainerConfig includes.
Any recommendations for SandboxPolicy or storing a ContainerConfig fragment?
There was a problem hiding this comment.
That must be a gap, @bbonaby, @theelliotm
Why is this change being made?
OpenClaw currently applies one shared MXC baseline to MXC-backed execution, but
different tools and argument sets can require narrower access. We need a
user-controlled per-tool layer without replacing the existing per-agent sandbox
settings or shared MXC baseline configuration.
We also need an application-owned workflow for consuming MXC denial capture.
MXC returns denial records after the process exits, so OpenClaw must validate
those records, present an approval decision, and rerun only when the requested
change remains within the existing configuration limits.
IMPORTANT NOTE: This is a significant iteration on the existing RFC, not a new
proposal. The per-tool configuration advisor, exact and wildcard matching,
SQLite storage, MXC execution boundary, CLI management, and compatibility
behavior remain recognizable. The main review areas are the
ContainerConfig-shaped sandbox configuration fragment, Learning Mode, and theclarified Gateway and Windows Node boundary.
What changed?
ContainerConfig-shaped sandbox configuration fragment.settings and the shared MXC baseline configuration.
surfaces rather than add grants.
Deny,Allow once, andAlways allowrerun behavior.containment observation and reviewed configuration proposals.
handled as baseline changes instead of per-tool changes.
composition, schema validation, and migration rules.
configuration, structured output metadata, runtime support, and completeness.
Windows Node to adopt the same per-tool matching and Learning Mode workflow.
What changed since the previous review?
surfaces.
configuration.
captureDenialsmodes and post-exit approval.configuration and enforcement.
How was the change tested?
MXC denial-capture contract.