openclaw - ✅(Solved) Fix security audit should resolve model aliases before tier checks [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74455Fetched 2026-04-30 06:23:48
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
2
Author
Timeline (top)
referenced ×2closed ×1commented ×1cross-referenced ×1

openclaw security audit --deep appears to classify configured model alias strings directly instead of resolving them through agents.defaults.models before applying model-tier hygiene checks.

This creates a false warning after migrating runtime model fields to aliases, e.g. gpt-prev is flagged as below the recommended GPT-5 family even though it resolves to openai-codex/gpt-5.4.

Error Message

WARN Some configured models are below recommended tiers

Root Cause

Using stable aliases for runtime fields is useful operationally: when a new model target is promoted, only the central alias mapping needs to change instead of migrating every agent, cron job, and task payload. The security audit should support that configuration style without false warnings.

Fix Action

Fix / Workaround

A local runtime patch following the approach above removed the false alias-tier warning. The config itself remained alias-based; only the audit evaluation changed.

PR fix notes

PR #74532: fix(security): resolve model aliases before audit classification

Description (problem / solution / changelog)

Before classification, model strings are now resolved through the alias index so that configured aliases (e.g. 'gpt-prev') are translated to their canonical provider/key form (e.g. 'openai/gpt-5.4') before hygene and tier checks run.

Fixes #74455.

Summary

Describe the problem and fix in 2–5 bullets:

If this PR fixes a plugin beta-release blocker, title it fix(<plugin-id>): beta blocker - <summary> and link the matching Beta blocker: <plugin-name> - <summary> issue labeled beta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.

  • Problem:
  • Why it matters:
  • What changed:
  • What did NOT change (scope boundary):

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write N/A. If the cause is unclear, write Unknown.

  • Root cause:
  • Missing detection / guardrail:
  • Contributing context (if known):

Regression Test Plan (if applicable)

For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
  • Scenario the test should lock in:
  • Why this is the smallest reliable guardrail:
  • Existing test that already covers this (if any):
  • If no new test is added, why not:

User-visible / Behavior Changes

List user-visible changes (including defaults/config).
If none, write None.

Diagram (if applicable)

For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write N/A.

Before:
[user action] -> [old state]

After:
[user action] -> [new state] -> [result]

Security Impact (required)

  • New permissions/capabilities? (Yes/No)
  • Secrets/tokens handling changed? (Yes/No)
  • New/changed network calls? (Yes/No)
  • Command/tool execution surface changed? (Yes/No)
  • Data access scope changed? (Yes/No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS:
  • Runtime/container:
  • Model/provider:
  • Integration/channel (if any):
  • Relevant config (redacted):

Steps

Expected

Actual

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
  • Edge cases checked:
  • What you did not verify:

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No)
  • Config/env changes? (Yes/No)
  • Migration needed? (Yes/No)
  • If yes, exact upgrade steps:

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk:
    • Mitigation:

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/security/audit-extra.summary.ts (modified, +4/-60)
  • src/security/audit-extra.sync.ts (modified, +2/-60)
  • src/security/audit-model-hygiene.test.ts (modified, +20/-0)
  • src/security/audit-model-refs.ts (added, +93/-0)
  • src/security/audit-small-model-risk.test.ts (modified, +23/-0)

Code Example

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "gpt",
        "fallbacks": ["gpt-prev", "gpt-mini"]
      },
      "models": {
        "openai-codex/gpt-5.5": { "alias": "gpt" },
        "openai-codex/gpt-5.4": { "alias": "gpt-prev" },
        "openai/gpt-5-mini": { "alias": "gpt-mini" },
        "anthropic/claude-opus-4-7": { "alias": "opus" }
      }
    }
  }
}

---

openclaw security audit --deep

---

WARN Some configured models are below recommended tiers
Smaller/older models are generally more susceptible to prompt injection and tool misuse. - gpt-prev (Below GPT-5 family) @ agents.defaults.model.fallbacks

---

const aliasIndex = buildModelAliasIndex({
  cfg,
  defaultProvider: DEFAULT_PROVIDER,
  allowPluginNormalization: false,
});

function resolveAuditModelId(cfg, raw, aliasIndex) {
  const resolved = resolveModelRefFromString({
    cfg,
    raw,
    defaultProvider: DEFAULT_PROVIDER,
    aliasIndex,
    allowPluginNormalization: false,
  })?.ref;

  return resolved ? `${resolved.provider}/${resolved.model}` : raw.trim();
}
RAW_BUFFERClick to expand / collapse

Summary

openclaw security audit --deep appears to classify configured model alias strings directly instead of resolving them through agents.defaults.models before applying model-tier hygiene checks.

This creates a false warning after migrating runtime model fields to aliases, e.g. gpt-prev is flagged as below the recommended GPT-5 family even though it resolves to openai-codex/gpt-5.4.

Reproduction

Example config shape:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "gpt",
        "fallbacks": ["gpt-prev", "gpt-mini"]
      },
      "models": {
        "openai-codex/gpt-5.5": { "alias": "gpt" },
        "openai-codex/gpt-5.4": { "alias": "gpt-prev" },
        "openai/gpt-5-mini": { "alias": "gpt-mini" },
        "anthropic/claude-opus-4-7": { "alias": "opus" }
      }
    }
  }
}

Then run:

openclaw security audit --deep

Observed warning:

WARN Some configured models are below recommended tiers
Smaller/older models are generally more susceptible to prompt injection and tool misuse. - gpt-prev (Below GPT-5 family) @ agents.defaults.model.fallbacks

Expected behavior

The audit should resolve aliases before tier/small-model classification:

  • gpt-prev -> openai-codex/gpt-5.4
  • classify the resolved provider/model ID
  • preserve the original source path in the report, e.g. agents.defaults.model.fallbacks

With the example above, gpt-prev should not be warned as below GPT-5 merely because the alias string starts with gpt- but does not contain gpt-5.

Root cause found locally

The model collection/classification path stores raw strings and then checks those raw strings:

  • collectModelHygieneFindings(cfg)
  • collectSmallModelRiskFindings({ cfg, env })

In the built package this was visible in:

  • dist/audit.nondeep.runtime-*.js
    • collectModels() / collectModels$1()
    • local addModel*() helpers push { id, source } with id still being the raw alias string.

The existing alias resolver already seems available and suitable:

  • buildModelAliasIndex(...)
  • resolveModelRefFromString(...)

from the model-selection shared module.

Suggested fix

Resolve model refs once during audit model collection, before classification. Conceptually:

const aliasIndex = buildModelAliasIndex({
  cfg,
  defaultProvider: DEFAULT_PROVIDER,
  allowPluginNormalization: false,
});

function resolveAuditModelId(cfg, raw, aliasIndex) {
  const resolved = resolveModelRefFromString({
    cfg,
    raw,
    defaultProvider: DEFAULT_PROVIDER,
    aliasIndex,
    allowPluginNormalization: false,
  })?.ref;

  return resolved ? `${resolved.provider}/${resolved.model}` : raw.trim();
}

Then have both audit model collectors push the resolved ID for tier/param-size checks while keeping the original source path.

Local validation

A local runtime patch following the approach above removed the false alias-tier warning. The config itself remained alias-based; only the audit evaluation changed.

Why this matters

Using stable aliases for runtime fields is useful operationally: when a new model target is promoted, only the central alias mapping needs to change instead of migrating every agent, cron job, and task payload. The security audit should support that configuration style without false warnings.

extent analysis

TL;DR

Resolve model aliases before applying model-tier hygiene checks to prevent false warnings.

Guidance

  • Update the collectModelHygieneFindings and collectSmallModelRiskFindings functions to use the resolveModelRefFromString function to resolve model aliases before classification.
  • Create a resolveAuditModelId function to handle alias resolution, as suggested in the issue.
  • Modify the audit model collectors to push the resolved ID for tier/param-size checks while keeping the original source path.
  • Verify the fix by running the openclaw security audit --deep command with the updated configuration and checking for the absence of false warnings.

Example

const aliasIndex = buildModelAliasIndex({
  cfg,
  defaultProvider: DEFAULT_PROVIDER,
  allowPluginNormalization: false,
});

function resolveAuditModelId(cfg, raw, aliasIndex) {
  const resolved = resolveModelRefFromString({
    cfg,
    raw,
    defaultProvider: DEFAULT_PROVIDER,
    aliasIndex,
    allowPluginNormalization: false,
  })?.ref;

  return resolved ? `${resolved.provider}/${resolved.model}` : raw.trim();
}

Notes

The suggested fix relies on the existing buildModelAliasIndex and resolveModelRefFromString functions, which are assumed to be available and suitable for alias resolution.

Recommendation

Apply the suggested fix to resolve model aliases before classification, as it addresses the root cause of the issue and prevents false warnings.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The audit should resolve aliases before tier/small-model classification:

  • gpt-prev -> openai-codex/gpt-5.4
  • classify the resolved provider/model ID
  • preserve the original source path in the report, e.g. agents.defaults.model.fallbacks

With the example above, gpt-prev should not be warned as below GPT-5 merely because the alias string starts with gpt- but does not contain gpt-5.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix security audit should resolve model aliases before tier checks [1 pull requests, 1 comments, 2 participants]