Skip to content

feat(safety): add restricted mode for unattended runs - #3970

Open
Sayt-0 wants to merge 1 commit into
mainfrom
feat/restricted-safety-mode
Open

feat(safety): add restricted mode for unattended runs#3970
Sayt-0 wants to merge 1 commit into
mainfrom
feat/restricted-safety-mode

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add a canonical restricted safety mode for unattended and headless runs
  • allow classifier-safe and explicitly allow-listed calls while denying unmatched destructive or unknown calls without prompting
  • preserve the existing deny > allow > ask rule precedence and expose mode_restricted in approval audit events
  • support the mode across CLI, YAML defaults, aliases, user settings, sessions, API validation, schema, examples, and documentation

Issue expectations

Issue expectation Implementation
Run unattended without human confirmation restricted resolves its fallback to allow or deny without prompting
Reuse built-in safety patterns calls classified safe are auto-approved
Allow selected custom operations existing permissions.allow rules run before the mode fallback
Deny everything else unmatched destructive and unknown calls are denied
Preserve explicit safeguards deny rules remain dominant; session-scoped ask rules and preempting hooks still gate

Safety matrix

Mode safe destructive unknown
restricted allow deny deny

restricted is defense in depth rather than an isolation boundary. Sandboxing remains recommended for untrusted unattended workloads.

Validation

  • go test ./...
  • ./scripts/build.sh
  • golangci-lint run
  • go run ./lint .
  • go mod tidy --diff
  • hugo build --quiet
  • git diff --check

Closes #3967

@Sayt-0
Sayt-0 requested a review from a team as a code owner August 13, 2026 09:35
@aheritier aheritier added area/api For features/issues/fixes related to the usage of the cagent API area/cli CLI commands, flags, output formatting area/config For configuration parsing, YAML, environment variables 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) area/testing Test infrastructure, CI/CD, test runners, evaluation area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api For features/issues/fixes related to the usage of the cagent API area/cli CLI commands, flags, output formatting area/config For configuration parsing, YAML, environment variables 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) area/testing Test infrastructure, CI/CD, test runners, evaluation area/tools For features/issues/fixes related to the usage of built-in and MCP tools 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.

Custom evaluation steps and order and switching decision types for safety categories

2 participants