














@@ -18,12 +18,14 @@ report drift through `doctor --lint`. The final conformance signal is a clean
1818instead of creating a separate health gate.
19192020Policy currently manages configured channels, MCP servers, model providers,
21-network SSRF posture, and governed tool declarations. For example, IT or a
22-workspace operator can record that Telegram is not an approved channel
23-provider, restrict MCP servers and model refs to approved entries, require
24-private-network fetch/browser access to remain disabled, require governed tools
25-to carry risk and sensitivity metadata, then use `doctor --lint` as the shared
26-conformance gate.
21+network SSRF posture, OpenClaw config secret provider/auth profile posture,
22+and governed tool declarations. For example, IT or a workspace operator can
23+record that Telegram is not an approved channel provider, restrict MCP servers
24+and model refs to approved entries, require private-network fetch/browser
25+access to remain disabled, require OpenClaw config SecretRefs to use managed
26+providers, require config auth profiles to carry provider/mode metadata,
27+require governed tools to carry risk and sensitivity metadata, then use
28+`doctor --lint` as the shared conformance gate.
27292830Use policy when a workspace needs a durable statement such as "these channels
2931must not be enabled" or "governed tools must declare approval metadata" and a
@@ -44,8 +46,9 @@ arbitrary plugins. The plugin remains enabled if `policy.jsonc` is missing, so
4446doctor can report the missing artifact.
45474648Policy is authored, not generated from the user's current settings. A minimal
47-policy for channels, MCP servers, model providers, network posture, and tool
48-metadata looks like this:
49+policy for channels, MCP servers, model providers, network posture,
50+OpenClaw config secret provider/auth profile posture, and tool metadata looks
51+like this:
49525053```jsonc
5154{
@@ -75,6 +78,17 @@ metadata looks like this:
7578"allow": false,
7679 },
7780 },
81+"secrets": {
82+"requireManagedProviders": true,
83+"denySources": ["exec"],
84+"allowInsecureProviders": false,
85+ },
86+"auth": {
87+"profiles": {
88+"requireMetadata": ["provider", "mode"],
89+"allowModes": ["api_key", "token"],
90+ },
91+ },
7892"tools": {
7993"requireMetadata": ["risk", "sensitivity", "owner"],
8094 },
@@ -84,8 +98,12 @@ metadata looks like this:
8498The rules are the authority. A category block is only a namespace; checks run
8599when a concrete rule is present. OpenClaw reads current `channels.*` settings
86100`mcp.servers.*`, `models.providers.*`, selected agent model refs, network SSRF
87-settings, and `TOOLS.md` declarations as evidence, then reports observed state
88-that does not conform.
101+settings, OpenClaw config secret provider and SecretRef provenance, config auth
102+profile metadata, and `TOOLS.md` declarations as evidence, then reports
103+observed state that does not conform. Secret evidence records provider/source
104+posture and SecretRef metadata, never raw secret values. Policy does not read
105+or attest per-agent credential stores such as `auth-profiles.json`; those
106+stores remain owned by the existing auth and credential flows.
8910790108Run policy-only checks during authoring:
91109@@ -218,6 +236,31 @@ Example JSON output:
218236"value": false
219237 }
220238 ],
239+"secrets": [
240+ {
241+"id": "vault",
242+"kind": "provider",
243+"source": "oc://openclaw.config/secrets/providers/vault",
244+"providerSource": "env"
245+ },
246+ {
247+"id": "oc://openclaw.config/models/providers/openai/apiKey",
248+"kind": "input",
249+"source": "oc://openclaw.config/models/providers/openai/apiKey",
250+"provenance": "secretRef",
251+"refSource": "env",
252+"refProvider": "vault"
253+ }
254+ ],
255+"authProfiles": [
256+ {
257+"id": "github",
258+"source": "oc://openclaw.config/auth/profiles/github",
259+"validMetadata": true,
260+"provider": "github",
261+"mode": "token"
262+ }
263+ ],
221264"tools": [
222265 {
223266"id": "deploy",
@@ -229,7 +272,7 @@ Example JSON output:
229272 }
230273 ]
231274 },
232-"checksRun": 15,
275+"checksRun": 20,
233276"checksSkipped": 0,
234277"findings": []
235278}
@@ -277,23 +320,28 @@ choose a different interval.
277320278321Policy currently verifies:
279322280-| Check id | Finding |
281-| ---------------------------------------- | --------------------------------------------------------------------- |
282-| `policy/policy-jsonc-missing` | Policy is enabled but `policy.jsonc` is missing. |
283-| `policy/policy-jsonc-invalid` | Policy cannot be parsed or contains malformed rule entries. |
284-| `policy/policy-hash-mismatch` | Policy does not match configured `expectedHash`. |
285-| `policy/attestation-hash-mismatch` | Current policy evidence no longer matches the accepted attestation. |
286-| `policy/channels-denied-provider` | An enabled channel matches a channel deny rule. |
287-| `policy/mcp-denied-server` | A configured MCP server is denied by policy. |
288-| `policy/mcp-unapproved-server` | A configured MCP server is outside the allowlist. |
289-| `policy/models-denied-provider` | A configured model provider or model ref uses a denied provider. |
290-| `policy/models-unapproved-provider` | A configured model provider or model ref is outside the allowlist. |
291-| `policy/network-private-access-enabled` | A private-network SSRF escape hatch is enabled when policy denies it. |
292-| `policy/tools-missing-risk-level` | A governed tool declaration is missing risk metadata. |
293-| `policy/tools-unknown-risk-level` | A governed tool declaration uses an unknown risk value. |
294-| `policy/tools-missing-sensitivity-token` | A governed tool declaration is missing sensitivity metadata. |
295-| `policy/tools-missing-owner` | A governed tool declaration is missing owner metadata. |
296-| `policy/tools-unknown-sensitivity-token` | A governed tool declaration uses an unknown sensitivity value. |
323+| Check id | Finding |
324+| ---------------------------------------- | -------------------------------------------------------------------------------- |
325+| `policy/policy-jsonc-missing` | Policy is enabled but `policy.jsonc` is missing. |
326+| `policy/policy-jsonc-invalid` | Policy cannot be parsed or contains malformed rule entries. |
327+| `policy/policy-hash-mismatch` | Policy does not match configured `expectedHash`. |
328+| `policy/attestation-hash-mismatch` | Current policy evidence no longer matches the accepted attestation. |
329+| `policy/channels-denied-provider` | An enabled channel matches a channel deny rule. |
330+| `policy/mcp-denied-server` | A configured MCP server is denied by policy. |
331+| `policy/mcp-unapproved-server` | A configured MCP server is outside the allowlist. |
332+| `policy/models-denied-provider` | A configured model provider or model ref uses a denied provider. |
333+| `policy/models-unapproved-provider` | A configured model provider or model ref is outside the allowlist. |
334+| `policy/network-private-access-enabled` | A private-network SSRF escape hatch is enabled when policy denies it. |
335+| `policy/secrets-unmanaged-provider` | A config SecretRef references a provider not declared under `secrets.providers`. |
336+| `policy/secrets-denied-provider-source` | A config secret provider or SecretRef uses a source denied by policy. |
337+| `policy/secrets-insecure-provider` | A secret provider opts into insecure posture when policy denies it. |
338+| `policy/auth-profile-invalid-metadata` | A config auth profile is missing valid provider or mode metadata. |
339+| `policy/auth-profile-unapproved-mode` | A config auth profile mode is outside the policy allowlist. |
340+| `policy/tools-missing-risk-level` | A governed tool declaration is missing risk metadata. |
341+| `policy/tools-unknown-risk-level` | A governed tool declaration uses an unknown risk value. |
342+| `policy/tools-missing-sensitivity-token` | A governed tool declaration is missing sensitivity metadata. |
343+| `policy/tools-missing-owner` | A governed tool declaration is missing owner metadata. |
344+| `policy/tools-unknown-sensitivity-token` | A governed tool declaration uses an unknown sensitivity value. |
297345298346Policy findings can include both `target` and `requirement`. `target` is the
299347observed workspace thing that does not conform. `requirement` is the authored
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。