config-profile-change

Guidance for managing named configuration profiles and deciding which profile is active in a command-line application.

In plain words
What is it for?
Use it when adding or changing profiles, selecting a profile for a command, changing active configuration, or updating profile-management commands.
Why use it?
It prevents active-profile metadata from being mixed with ordinary settings and clarifies which option wins when flags, environment variables, and saved profiles overlap.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/modelstudioai/cli/config-profile-change
Clone the repo
git clone --depth 1 https://github.com/modelstudioai/cli
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,265 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02265
Opus 5 $0.00000 $0.01132
Sonnet 5 $0.00000 $0.00453
Haiku 4.5 $0.00000 $0.00227

Measured 2d ago against content hash 7e3188082b08, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

config-profile-change scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/config-profile-change.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Config Profile 与激活状态变更清单

适用于新增 Profile 预设、修改命名 Profile 选择规则、调整 active_config,或新增/修改 bl config list/use/show/ui 等 Profile 管理能力。

1. 保持存储边界

  • Profile 业务字段继续由 ConfigFile / CONFIG_FILE_KEYS 管理。
  • active_configconfig.json 顶层元数据,不得进入命名 Profile block,也不得被 config set 当作普通字段写入。
  • 识别命名 Profile 时必须排除业务字段和顶层元数据。
  • 旧配置缺少 active_config 时继续等价于激活 default

2. 保持选择语义

显式 --config <name> > active_config > default
  • 解析阶段用局部变量保留“是否显式传入 --config”的信息;完成 Config 选择后不进入 Settings
  • --config default 必须显式选择顶层配置并绕过命名激活项。
  • 普通命令的显式 --config 只覆盖本次选择,不修改持久化激活状态;例外是 auth login --config ...,凭证落盘成功后自动激活该 Profile。
  • 激活状态只选择配置 block,不改变字段优先级;字段仍为 flag > env > selected config > 默认值。
  • API Key capability fallback 是窄例外:命名 Profile 显式配置 api_key_capabilities 后,不在白名单中的 auth: "apiKey" 叶子命令只把 file 层 api_key / base_url 切到顶层 default;所选 Profile 的其他 settings 和 active_config 均不变。如果 --api-key / --base-urlDASHSCOPE_API_KEY / DASHSCOPE_BASE_URL 任一提供了更高优先级的模型连接参数,则整个 capability fallback 跳过,file 层也不切换;未显式提供的另一部分继续按 flag > env > 所选 Profile 解析。
  • Profile 是否启用 capability fallback 只看持久化的 api_key_capabilities,与名称无关:字段缺失表示关闭策略,[] 表示全部 API Key 命令 fallback。runtime 不注入内置 preset;升级内置 Plan Profile 的 preset 需要重新登录。
  • 对命中内置 preset 的 Profile,API Key 登录落盘成功后会把当前 preset 中缺少的 capability 追加落盘,同时保留已有项且不做删除;Console/OpenAPI 登录、自定义 Profile、dry-run 和失败登录均不修改该白名单。
  • Capability ID 直接使用产品实际叶子命令路径并以 . 连接(例如 video task getvideo.task.get);不新增命令元数据。新增或改名后的 API Key 路由未进入白名单时自然 fail closed。
  • Pipeline 等进程内调用链也要复用统一的 buildSources(),避免绕过激活状态。
  • Console access token 自动刷新等后台读写必须携带 settings.configName,不得直接读写顶层 default。

3. 保持读写命令交互一致

  • auth loginconfig set 等写命令未传 --config 时修改当前激活项。
  • auth login --config <name> 显式指定不存在的 Profile 时,仅在凭证实际落盘时 创建和激活;config set --config <name> 可创建但不自动激活。
  • config showauth status 和业务消费等读命令不得因为显式指定不存在的名称而创建 Profile。
  • auth logout 默认只清理当前激活项;显式 --config 只清理指定项。
  • 按凭证域退出时必须清理该域的完整字段集合,例如 OpenAPI 同时清理 AK、SK 和 STS security_token
  • 所有生产代码读取“当前配置”时优先经过 buildSources() 或携带解析后的 configName;直接调用无名称的 readConfigFile() / writeConfigFile() 只适用于明确操作顶层 default 的底层能力。

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 88 lines · 0 tokens per session scan A 7e3188082b08

Subscribe to this mod's changes

config-profile-change is an agent published in the GitHub repository modelstudioai/cli (320 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,265 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.