Skip to content

Commit 1d3cfc4

Browse files
authored
Policy: add data handling conformance checks (#87056)
Merged via squash. Prepared head SHA: 6a0e973 Co-authored-by: giodl73-repo < > Co-authored-by: giodl73-repo <[email protected]> Reviewed-by: @giodl73-repo
1 parent 1ff2ffa commit 1d3cfc4

8 files changed

Lines changed: 1239 additions & 75 deletions

File tree

‎docs/cli/policy.md‎

Lines changed: 107 additions & 66 deletions
Large diffs are not rendered by default.

‎docs/concepts/session.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ writes.
110110
## Session maintenance
111111

112112
OpenClaw automatically bounds session storage over time. By default, it runs
113-
in `warn` mode (reports what would be cleaned). Set `session.maintenance.mode`
114-
to `"enforce"` for automatic cleanup:
113+
in `enforce` mode and applies cleanup during maintenance. Set
114+
`session.maintenance.mode` to `"warn"` to report what would be cleaned without mutating the store/files:
115115

116116
```json5
117117
{

‎docs/gateway/config-agents.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ See [Multi-Agent Sandbox & Tools](/tools/multi-agent-sandbox-tools) for preceden
12721272
resetTriggers: ["/new", "/reset"],
12731273
store: "~/.openclaw/agents/{agentId}/sessions/sessions.json",
12741274
maintenance: {
1275-
mode: "warn", // warn | enforce
1275+
mode: "enforce", // enforce (default) | warn
12761276
pruneAfter: "30d",
12771277
maxEntries: 500,
12781278
resetArchiveRetention: "30d", // duration or false
@@ -1311,7 +1311,7 @@ See [Multi-Agent Sandbox & Tools](/tools/multi-agent-sandbox-tools) for preceden
13111311
- **`agentToAgent.maxPingPongTurns`**: maximum reply-back turns between agents during agent-to-agent exchanges (integer, range: `0`-`20`, default: `5`). `0` disables ping-pong chaining.
13121312
- **`sendPolicy`**: match by `channel`, `chatType` (`direct|group|channel`, with legacy `dm` alias), `keyPrefix`, or `rawKeyPrefix`. First deny wins.
13131313
- **`maintenance`**: session-store cleanup + retention controls.
1314-
- `mode`: `warn` emits warnings only; `enforce` applies cleanup.
1314+
- `mode`: `enforce` applies cleanup and is the default; `warn` emits warnings only.
13151315
- `pruneAfter`: age cutoff for stale entries (default `30d`).
13161316
- `maxEntries`: maximum number of entries in `sessions.json` (default `500`). Runtime writes batch cleanup with a small high-water buffer for production-sized caps; `openclaw sessions cleanup --enforce` applies the cap immediately.
13171317
- `rotateBytes`: deprecated and ignored; `openclaw doctor --fix` removes it from older configs.

‎docs/plugins/reference/policy.md‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ settings and governed workspace declarations. Policy currently covers channel
2727
conformance, governed tool metadata, MCP server posture, model-provider posture,
2828
private-network access posture, Gateway exposure posture, agent workspace/tool
2929
posture, configured global/per-agent tool posture, configured sandbox runtime
30-
posture, ingress/channel access posture, and OpenClaw config secret
30+
posture, ingress/channel access posture, data-handling posture, and OpenClaw config secret
3131
provider/auth profile posture.
3232

3333
Policy stores authored requirements in `policy.jsonc`, observes existing
@@ -55,9 +55,16 @@ and require sandbox browser CDP source ranges.
5555
These checks observe config conformance only; they do not read runtime approval
5656
state, inspect live containers, or add runtime enforcement.
5757

58+
Data-handling rules can require sensitive logging redaction, deny telemetry
59+
content capture, require session retention maintenance, and deny session
60+
transcript memory indexing. These checks observe config conformance only; they
61+
do not inspect raw logs, telemetry exports, transcripts, memory files, secrets,
62+
or personal data.
63+
5864
Named policy scopes under `scopes.<scopeName>` can add stricter normal policy
5965
sections for the selector they list. `agentIds` supports `tools`,
60-
`agents.workspace`, and `sandbox`; `channelIds` supports `ingress.channels`.
66+
`agents.workspace`, `sandbox`, and `dataHandling.memory`; `channelIds` supports
67+
`ingress.channels`.
6168
Runtime agent ids that are not explicitly listed in `agents.list[]` are checked
6269
against inherited global/default posture rather than silently passing with no
6370
evidence. Every scope present in `policy.jsonc` must be valid and enforceable

‎docs/reference/session-management-compaction.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ OpenClaw resolves these via `src/config/sessions.ts`.
7878

7979
Session persistence has automatic maintenance controls (`session.maintenance`) for `sessions.json`, transcript artifacts, and trajectory sidecars:
8080

81-
- `mode`: `warn` (default) or `enforce`
81+
- `mode`: `enforce` (default) or `warn`
8282
- `pruneAfter`: stale-entry age cutoff (default `30d`)
8383
- `maxEntries`: cap entries in `sessions.json` (default `500`)
8484
- `resetArchiveRetention`: retention for `*.reset.<timestamp>` transcript archives (default: same as `pruneAfter`; `false` disables cleanup)

0 commit comments

Comments
 (0)