redline
MediumAI tellsfloating-model

Floating model alias

Floating model alias. A -latest alias ("claude-sonnet-latest"). The model behind it can change under you.

This is how the comment reads inline, under the flagged line.

Why it matters

Aliases move to new snapshots without notice, so prompts, costs and outputs change with no code change.

What to do

Pin a dated model id and upgrade on purpose.

Examples

Flagged
model: "some-model-latest"
Better
model: "some-model-2026-06-01"

What it catches

It reads a pattern on each line, aware of strings and comments. Languages: TypeScript and JavaScript, Python. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

const m = "claude-sonnet-latest";

Left alone

const m = "model-2026-06-01";

Research

Floating model aliases (`-latest`) and model calls with no timeout or token cap. Behavior changes silently, and calls can hang or overspend.

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "floating-model"
    ],
    "severity": {
      "floating-model": "low"
    }
  }
}

Read the source or report a false positive.