Summary
Follow-up to #3835.
#3835 introduces the strict, balanced, and autonomous safety modes. The mode can currently be selected through --safety, the legacy --yolo flag, or the session API, but it cannot be declared in YAML.
Add declarative safety mode defaults at the team, agent, and user levels.
Proposed configuration
Team-wide default, with an optional per-agent override:
runtime:
safety: balanced
agents:
root:
model: anthropic/claude-sonnet-4-5
instruction: You are a general-purpose assistant.
reviewer:
model: anthropic/claude-sonnet-4-5
instruction: Review changes without modifying files.
safety: strict
automation:
model: anthropic/claude-sonnet-4-5
instruction: Run trusted automation.
safety: autonomous
Optional user-wide default:
# ~/.config/cagent/config.yaml
settings:
safety: balanced
runtime.safety applies to every agent in the team unless the selected agent defines its own safety value.
Proposed precedence
For a new root session:
| Priority |
Source |
| 1 |
Explicit --safety |
| 2 |
Explicit --yolo, equivalent to autonomous |
| 3 |
User-owned alias options |
| 4 |
settings.safety or legacy settings.YOLO |
| 5 |
agents.<selected-agent>.safety |
| 6 |
runtime.safety |
| 7 |
Existing unset behavior |
When both --safety and --yolo are passed, --safety wins, matching #3835.
The existing unset behavior must remain unchanged: read-only annotated tools may run automatically, while other calls require confirmation.
Session semantics
- YAML values are defaults used when creating a new root session.
- Resuming a session without an explicit CLI override preserves the safety mode stored in that session.
- Switching or handing off to another agent must not silently replace a mode already selected by the user.
- Delegated and spawned sessions should continue inheriting the parent session’s effective safety mode.
- An explicit
--safety or --yolo may still override the stored mode when resuming.
Compatibility
- Only
strict, balanced, and autonomous should be accepted in new YAML fields.
- Invalid values should fail configuration loading with a clear error.
- Existing
settings.YOLO, alias yolo, and --yolo behavior must remain supported as aliases for autonomous.
- If both
safety and the legacy YOLO value are configured at the same scope, safety should win.
- Configurations that omit all safety fields must retain the current behavior.
Security consideration
Agent configurations can be loaded from local files, URLs, or OCI references. An author-provided YAML must not silently weaken a user-owned global safety preference.
The implementation should explicitly decide whether autonomous is allowed in runtime.safety and agents.<name>.safety, or whether it should only be selectable from user-owned settings and explicit CLI/API input.
Acceptance criteria
Non-goals
Summary
Follow-up to #3835.
#3835 introduces the
strict,balanced, andautonomoussafety modes. The mode can currently be selected through--safety, the legacy--yoloflag, or the session API, but it cannot be declared in YAML.Add declarative safety mode defaults at the team, agent, and user levels.
Proposed configuration
Team-wide default, with an optional per-agent override:
Optional user-wide default:
runtime.safetyapplies to every agent in the team unless the selected agent defines its ownsafetyvalue.Proposed precedence
For a new root session:
--safety--yolo, equivalent toautonomoussettings.safetyor legacysettings.YOLOagents.<selected-agent>.safetyruntime.safetyWhen both
--safetyand--yoloare passed,--safetywins, matching #3835.The existing unset behavior must remain unchanged: read-only annotated tools may run automatically, while other calls require confirmation.
Session semantics
--safetyor--yolomay still override the stored mode when resuming.Compatibility
strict,balanced, andautonomousshould be accepted in new YAML fields.settings.YOLO, aliasyolo, and--yolobehavior must remain supported as aliases forautonomous.safetyand the legacyYOLOvalue are configured at the same scope,safetyshould win.Security consideration
Agent configurations can be loaded from local files, URLs, or OCI references. An author-provided YAML must not silently weaken a user-owned global safety preference.
The implementation should explicitly decide whether
autonomousis allowed inruntime.safetyandagents.<name>.safety, or whether it should only be selectable from user-owned settings and explicit CLI/API input.Acceptance criteria
runtime.safetydefines a team-wide default.agents.<name>.safetyoverrides the team default for a newly created root session using that agent.settings.safetydefines a user-wide default and cannot be silently weakened by downloaded agent configuration.YOLOandyolosettings remain compatible.agent-schema.json, configuration documentation, and the safety modes example are updated.Non-goals
allow,ask, anddenypermission rules.