Skip to content

feat(config): add YAML safety mode defaults - #3860

Merged
dgageot merged 1 commit into
mainfrom
feat/3837-yaml-safety-defaults
Jul 28, 2026
Merged

feat(config): add YAML safety mode defaults#3860
dgageot merged 1 commit into
mainfrom
feat/3837-yaml-safety-defaults

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • add declarative safety defaults to team runtime, individual agents, user settings, and aliases
  • enforce CLI, user-owned, author-owned, and persisted-session precedence without weakening user preferences
  • preserve legacy YOLO/yolo behavior and validate canonical YAML values
  • update the schema, documentation, example configuration, sandbox forwarding, and session/API coverage

Closes #3837

Precedence

Priority Source
1 explicit --safety
2 explicit --yolo
3 alias safety or legacy yolo
4 settings.safety or legacy settings.YOLO
5 selected agents.<name>.safety
6 runtime.safety
7 historical unset behavior

At the same scope, safety wins over the legacy boolean alias. Resumed sessions keep their persisted mode unless an explicit CLI override is supplied.

Acceptance criteria

Expectation Implementation
Team-wide default runtime.safety is propagated through the loaded team
Per-agent override the initially selected agent's safety wins over the runtime default
User-wide protection settings and alias defaults outrank local, URL, and OCI author configuration
CLI precedence explicit flag state is tracked independently from defaults
Resume behavior only explicit CLI safety flags replace persisted state
Agent/session inheritance switches, handoffs, spawned sessions, and delegated sessions preserve or inherit the effective mode
Compatibility settings.YOLO, alias yolo, and --yolo remain autonomous aliases
Validation only strict, balanced, and autonomous are accepted in new YAML fields
Schema and docs schema, CLI/config docs, headless guidance, and safety example are updated
Tests precedence, validation, selection, resume, API, sandbox, and persistence paths are covered

Validation

  • env -u HTTP_PROXY -u HTTPS_PROXY -u http_proxy -u https_proxy go test ./...
  • go test -race -count=1 ./pkg/server -run 'TestAuthorSafetyDefault|TestSessionManager_SetSessionAgentModel'
  • golangci-lint run
  • go run ./lint .
  • go build ./...
  • go mod tidy -diff
  • jq empty agent-schema.json
  • npx --yes markdownlint-cli2@0.22.1
  • ./scripts/docs-check-canonical.sh
  • ./scripts/docs-check-llms-txt.sh

Known limitation

An API session created without a safety choice receives author defaults when its first run starts. If the server restarts before that first run, it retains the conservative historical unset behavior rather than being re-defaulted later.

@Sayt-0
Sayt-0 requested a review from a team as a code owner July 28, 2026 13:36
@aheritier aheritier added area/config For configuration parsing, YAML, environment variables area/core Core agent runtime, session management area/docs Documentation changes area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/sessions For features/issues/fixes related to session lifecycle (resume, persistence, export) kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 28, 2026
@dgageot
dgageot merged commit aaf8bbd into main Jul 28, 2026
20 checks passed
@dgageot
dgageot deleted the feat/3837-yaml-safety-defaults branch July 28, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config For configuration parsing, YAML, environment variables area/core Core agent runtime, session management area/docs Documentation changes area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/sessions For features/issues/fixes related to session lifecycle (resume, persistence, export) kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: allow safety mode defaults to be configured in YAML

4 participants