zeroclaw/src
Anton Markelov 96f25ac701
fix(prompt): respect autonomy level in SafetySection (Agent/gateway WS path) (#3952) (#4037)
The `SafetySection` in `SystemPromptBuilder` always hardcoded
"Do not run destructive commands without asking" and "Do not bypass
oversight or approval mechanisms" regardless of the configured
autonomy level. This caused the gateway WebSocket path (web interface)
to instruct the LLM to simulate approval dialogs even when
`autonomy.level = "full"`.

PRs #3955/#3970/#3975 fixed the channel dispatch path
(`build_system_prompt_with_mode_and_autonomy`) but missed the
`Agent::from_config` → `SystemPromptBuilder` path used by
`gateway/ws.rs`.

Changes:
- Add `autonomy_level` field to `PromptContext`
- Rewrite `SafetySection::build()` to conditionally include/exclude
  approval instructions based on autonomy level, matching the logic
  already present in `build_system_prompt_with_mode_and_autonomy`
- Add `autonomy_level` field to `Agent` struct and `AgentBuilder`
- Pass `config.autonomy.level` through `Agent::from_config`
- Add tests for full/supervised autonomy safety section behavior

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:22:35 -04:00
..
agent fix(prompt): respect autonomy level in SafetySection (Agent/gateway WS path) (#3952) (#4037) 2026-03-20 18:22:35 -04:00
approval fix(channels): allow low-risk shell in non-interactive mode (#3771) 2026-03-17 13:39:37 -04:00
auth feat: stabilize codex oauth and add provider model connectivity workflow 2026-02-24 16:03:01 +08:00
channels fix(qq): respond to WebSocket Ping frames to prevent connection timeout (#4041) 2026-03-20 18:22:30 -04:00
commands fix(cli): align self-test and update commands with implementation plan 2026-03-17 17:24:59 -04:00
config fix(config): add challenge_max_attempts field to OtpConfig (#3921) 2026-03-20 18:22:19 -04:00
cost fix(agent): parse MiniMax tool call formats for execution 2026-02-21 12:36:28 +08:00
cron fix(cron): persist delivery for api-created cron jobs (#4087) 2026-03-20 15:42:00 -04:00
daemon merge: resolve conflicts with master after #3891 merge 2026-03-19 18:29:36 -04:00
doctor feat(delegate): make sub-agent timeouts configurable via config.toml (#3909) 2026-03-18 17:07:03 -04:00
gateway fix(cron): persist delivery for api-created cron jobs (#4087) 2026-03-20 15:42:00 -04:00
hands feat(hands): add autonomous knowledge-accumulating agent packages (#3603) 2026-03-15 16:06:14 -04:00
hardware Addressed clippy lint issues 2026-03-10 01:48:19 -04:00
health refactor(sync): migrate remaining std mutex usage to parking_lot 2026-02-18 00:45:26 +08:00
heartbeat feat(heartbeat): add health metrics, adaptive intervals, and task history 2026-03-16 12:08:32 -04:00
hooks feat(hooks): add webhook-audit builtin hook (#3212) 2026-03-11 23:34:17 -04:00
integrations fix: add interrupt_on_new_message support for Matrix channel (#4070) 2026-03-20 12:17:16 -04:00
memory feat(heartbeat): default interval 30→5min + prune heartbeat from auto-save (#3938) 2026-03-19 08:17:08 -04:00
nodes feat(nodes): add secure HMAC-SHA256 node transport layer (#3654) 2026-03-16 01:53:47 -04:00
observability fix(observability): handle missing OtelObserver match arms and add all-features CI check (#3981) 2026-03-19 17:48:35 -04:00
onboard feat(verifiable_intent): add native verifiable intent lifecycle module (#2938) 2026-03-20 17:52:55 -04:00
peripherals feat(knowledge): add knowledge graph for expertise capture and reuse (#3596) 2026-03-17 01:11:29 -04:00
plugins fix(plugins): integrate WASM tools into registry, add gateway routes and tests 2026-03-17 18:10:24 -04:00
providers fix(providers): clamp unsupported temperatures in Claude Code provider (#3961) 2026-03-20 18:22:26 -04:00
rag chore(lint): extend low-risk clippy cleanup batch 2026-02-17 16:40:58 +08:00
runtime feat(tools): add Windows support for shell tool_call execution (#3442) 2026-03-13 17:12:16 -04:00
security feat(security): inject security policy summary into LLM system prompt (#4002) 2026-03-19 17:54:12 -04:00
service fix(packaging): ensure Homebrew var directory exists on first start (#3524) 2026-03-19 22:32:13 -04:00
skillforge chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
skills fix(skills): improve ClawhHub skill installer with zip crate and URL parsing (#4088) 2026-03-20 15:46:52 -04:00
sop fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
tools feat(tools): route web_search providers with alias fallback (#4038) 2026-03-20 18:22:32 -04:00
tunnel Feat/add pinggy tunnel (#4060) 2026-03-20 15:11:50 -04:00
verifiable_intent feat(verifiable_intent): add native verifiable intent lifecycle module (#2938) 2026-03-20 17:52:55 -04:00
i18n.rs feat(i18n): externalize tool descriptions for translation (#3912) 2026-03-18 17:01:39 -04:00
identity.rs test: cover deterministic HashMap ordering paths 2026-02-18 21:55:40 +08:00
lib.rs feat(verifiable_intent): add native verifiable intent lifecycle module (#2938) 2026-03-20 17:52:55 -04:00
main.rs feat(verifiable_intent): add native verifiable intent lifecycle module (#2938) 2026-03-20 17:52:55 -04:00
migration.rs readd tests, remove markdown files 2026-02-18 14:42:39 +08:00
multimodal.rs fix(agent): strip vision markers from history for non-vision providers (#3734) 2026-03-16 16:25:45 -04:00
util.rs fix(ci): restore containerized validation on main (#1096) 2026-02-20 07:48:58 -05:00