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.
npx agentmods add agents/modelstudioai/cli/auth-changegit clone --depth 1 https://github.com/modelstudioai/cliWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.03667 |
| Opus 5 | $0.00000 | $0.01834 |
| Sonnet 5 | $0.00000 | $0.00733 |
| Haiku 4.5 | $0.00000 | $0.00367 |
Grade A, and why
auth-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.
How it starts
The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.
鉴权扩展
触发条件
- 增加新的鉴权域或 token 来源(env / config / flag / 文件)
- 调整 API Key / Console token 解析优先级
- 改
bl auth login/auth status/auth logout流程 - 改 runtime 对 command
auth的 gating 或 credential 注入
鉴权链路
argv flags ─┐
env var ──┼─ buildSources(flags) ─┐
config ──┘ │
├─ buildSettings(sources) → ctx.settings
│
├─ resolveApiKey(sources) → model-domain Client
├─ resolveConsole(sources) → console-domain Client
└─ resolveOpenApi(sources) → OpenAPI Client
defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx)
当前 command 鉴权域(AuthRequirement):
apiKey— DashScope / OpenAI-compatible 模型域,用 API key 与 model base URLconsole— Bailian Console Gateway,用 console access token + region/site/switchAgent;workspace_id是独立的 Settings 作用域,不属于 credentialopenapi— 阿里云 OpenAPI 签名域,用 AccessKey ID/Secret 调用 Token Plan 等 OpenAPInone— 本地命令、登录/配置类命令、无需 credential 的命令
多凭证并存
~/.bailian/config.json 可同时保存 api_key、access_token 与 access_key_*。登录任一种方式不得删除另一种:
bl auth login --api-key ...更新api_key;显式base_url会一并写入,所选命名 Profile 若命中内置套餐预设(当前为token-plan),则在尚未保存base_url时补写预设地址,并把该预设的默认模型物化写入。API Key 落盘成功后,api_key_capabilities保留已有项并追加当前 preset 中缺少的项,不自动删除任何已有能力;无 preset 的自定义 Profile 不做合并。登录仍不得删除其他鉴权域的凭证bl auth login --console只更新access_token以及回调携带的 console 作用域字段bl auth login --open-api ...更新access_key_id/access_key_secret,同时会调用 OpenAPI 生成 CLIaccess_token并一并写入;即一次--open-api登录同时产生openapi与console域凭证bl auth logout --console只清access_tokenbl auth logout --open-api只清access_key_id/access_key_secret/security_tokenbl auth logout清api_key+base_url+access_token+access_key_*
解析分工:
resolveApiKey()—auth: "apiKey"命令;优先级--api-key>DASHSCOPE_API_KEY> configapi_keyresolveModelBaseUrl()— model base URL;优先级--base-url>DASHSCOPE_BASE_URL> configbase_url>REGIONS.cn,返回前统一归一化为 URL origin(仅保留协议、host 和显式端口,去除 path、query、fragment)--config只选择 config 文件 block,不提升该 block 的字段优先级。对auth: "apiKey"命令,runtime 会先按叶子命令路径检查所选 Profile 的api_key_capabilities:--api-key/--base-url或DASHSCOPE_API_KEY/DASHSCOPE_BASE_URL任一显式连接覆盖存在时,完全跳过自动降级,继续走统一的 flag > env > selected config file > 默认值- 配置文件显式声明
api_key_capabilities后,命中能力时保留所选 Profile,未命中时仅把 file-backedapi_key/base_url来源切到顶层default,其他 Settings 仍来自所选 Profile - 字段缺失时不启用降级,包括命中内置套餐预设的 Profile;preset 只在 API Key 登录落盘成功后物化写入,升级 preset 需要重新登录
- fallback 反馈写 stderr:text 模式输出本地化句子,
--output json输出两空格缩进的多行warning对象;若后续鉴权失败,warning 与多行error对象以空行分隔,stdout 仍只保留命令结果
- 显式
auth login --config <name>在凭证落盘成功后自动激活目标 Profile;未传--config时继续写当前激活项,失败和 dry-run 不切换 resolveConsole()—auth: "console"命令;当前 token 来自 configaccess_token,region/site/switchAgent 来自 flag > config > 默认resolveOpenApi()—auth: "openapi"命令;优先级--access-key-id/--access-key-secret>ALIBABA_CLOUD_ACCESS_KEY_ID/ALIBABA_CLOUD_ACCESS_KEY_SECRET> configaccess_key_*。兼容读取旧字段openapi_access_key_*,新写入只写短字段describeAuthState()—auth status/ banner / telemetry 使用的只读快照
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.
- 2d ago First seen · 175 lines · 0 tokens per session scan A e89c6cd133dd
auth-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 3,667 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.
Other agents, from other repositories
index
Browse built-in Agent Framework capabilities for multimodal input, tools, retrieval, evaluation, security, and autonomous execution.
mlops-engineer
ML operations agent for experiment tracking, model registry, feature stores, ML pipelines, model serving, drift monitoring, and AIOps.
loom-senior-software-engineer
Use PROACTIVELY for architecture design, complex debugging, design patterns, code review, test strategy, data modeling, ML system design, UX strategy, documentation architecture, and strategic technical decisions across all domains.
loom-advisor
Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.
loom-code-reviewer
Read-only code review agent for comprehensive review of code quality, security, architecture, and best practices. Cannot modify files.
integrity-check
Detect adversarial content in .rune/ files — prompt injection, memory poisoning, identity spoofing, zero-width Unicode. Verdict: CLEAN/SUSPICIOUS/TAINTED.