Skip to content

minSecurity inverted — security="full" session override clamped to "allowlist" by agent config #91283

Description

@korewaChino

In exec-approvals.js, minSecurity has the rank order backwards:

function minSecurity(a, b) {
  const order = {
    deny: 0,
    allowlist: 1,
    full: 2
  };
  return order[a] <= order[b] ? a : b;
}

This treats full as the MOST restrictive (rank 2) instead of the LEAST restrictive. When resolveExecHostApprovalContext calls:

const hostSecurity = minSecurity(params.security, approvals.agent.security);

a session override of security="full" gets clamped down to the agent's security="allowlist" because order["full"] (2) > order["allowlist"] (1), so it returns "allowlist".

Note execSecurityFloorRank in the same file already uses the correct order where full=0 is least restrictive — so the fix is swapping minSecurity's order to match:

function minSecurity(a, b) {
  const order = {
    full: 0,
    allowlist: 1,
    deny: 2
  };
  return order[a] <= order[b] ? a : b;
}

Steps to reproduce:

  1. Set exec.security: "full" in a session or config
  2. Agent default/overrides have security: "allowlist"
  3. Run any command → exec denied: allowlist miss

Impact: Users can never have per-session security="full" unless the agent config is also "full" (which applies to all sessions). The discord.execApprovals schema also lacks a security/ask field, so there's no way to set per-channel exec security either.

Found in: OpenClaw 2026.6.1

Related: #58691, #59079

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.securitySecurity documentation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions