惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
量子位
V
Visual Studio Blog
博客园 - Franky
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
罗磊的独立博客
小众软件
小众软件
V
V2EX
GbyAI
GbyAI
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
月光博客
月光博客
Recent Announcements
Recent Announcements
雷峰网
雷峰网
F
Fortinet All Blogs
M
MIT News - Artificial intelligence

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
docs: clarify file-backed secret refs · openclaw/openclaw...
steipete · 2026-05-17 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -203,6 +203,41 @@ Define providers under `secrets.providers`:

203203

</Accordion>

204204

</AccordionGroup>

205205
206+

## File-backed API keys

207+
208+

Do not put `file:...` strings in the config `env` block. The `env` block is

209+

literal and non-overriding, so `file:...` is not resolved.

210+
211+

Use a file SecretRef on a supported credential field instead:

212+
213+

```json5

214+

{

215+

secrets: {

216+

providers: {

217+

xai_key_file: {

218+

source: "file",

219+

path: "~/.openclaw/secrets/xai-api-key.txt",

220+

mode: "singleValue",

221+

},

222+

},

223+

},

224+

models: {

225+

providers: {

226+

xai: {

227+

apiKey: { source: "file", provider: "xai_key_file", id: "value" },

228+

},

229+

},

230+

},

231+

}

232+

```

233+
234+

For `mode: "singleValue"`, the SecretRef `id` is `"value"`. For

235+

`mode: "json"`, use an absolute JSON pointer such as

236+

`"/providers/xai/apiKey"`.

237+
238+

See [SecretRef credential surface](/reference/secretref-credential-surface) for

239+

the config fields that accept SecretRefs.

240+
206241

## Exec integration examples

207242
208243

<AccordionGroup>

Original file line numberDiff line numberDiff line change

@@ -36,6 +36,38 @@ Two equivalent ways to set inline env vars (both are non-overriding):

3636

}

3737

```

3838
39+

The config `env` block accepts literal string values only. It does not expand

40+

`file:...` values; for example, `XAI_API_KEY: "file:secrets/xai-api-key.txt"`

41+

is passed to providers as that exact string.

42+
43+

For file-backed provider keys, use a SecretRef on the credential field that

44+

supports it:

45+
46+

```json5

47+

{

48+

secrets: {

49+

providers: {

50+

xai_key_file: {

51+

source: "file",

52+

path: "~/.openclaw/secrets/xai-api-key.txt",

53+

mode: "singleValue",

54+

},

55+

},

56+

},

57+

models: {

58+

providers: {

59+

xai: {

60+

apiKey: { source: "file", provider: "xai_key_file", id: "value" },

61+

},

62+

},

63+

},

64+

}

65+

```

66+
67+

See [Secrets Management](/gateway/secrets) and the

68+

[SecretRef credential surface](/reference/secretref-credential-surface) for

69+

supported fields.

70+
3971

## Shell env import

4072
4173

`env.shellEnv` runs your login shell and imports only **missing** expected keys:

@@ -100,6 +132,8 @@ OpenClaw supports two env-driven patterns:

100132

- SecretRef objects (`{ source: "env", provider: "default", id: "VAR" }`) for fields that support secrets references.

101133
102134

Both resolve from process env at activation time. SecretRef details are documented in [Secrets Management](/gateway/secrets).

135+

The config `env` block itself does not resolve SecretRefs or `file:...`

136+

shorthand values.

103137
104138

## Path-related env vars

105139