Skip to content

feat(tools): autonomous mode to bypass the confirmation gate - #13

Merged
ayman3000 merged 1 commit into
mainfrom
feat/autonomous-mode
Jul 27, 2026
Merged

feat(tools): autonomous mode to bypass the confirmation gate#13
ayman3000 merged 1 commit into
mainfrom
feat/autonomous-mode

Conversation

@ayman3000

Copy link
Copy Markdown
Owner

Summary

Adds an opt-in autonomous mode so an app can let the agent run requiresConfirmation tools without prompting AgentCallbacks.onToolConfirmation — full-autonomy runs when you want them, safe by default.

  • AgentConfig(autonomousMode:) — default false; applied at Agent.init.
  • Agent.setAutonomousMode(_:) and ToolDispatcher.setAutonomousMode(_:) — flip it at runtime.

Default behavior is unchanged: confirmation-gated, and fail-closed when a confirmation-required tool is dispatched with no handler and autonomous mode off.

Tests

  • New: testAutonomousModeBypassesConfirmationGate — a DangerousTool runs with no onToolConfirmation handler once autonomous mode is enabled.
  • All 94 tests pass (swift test).

Motivation

Consumed by the Naseem app (native tools + confirmation UI): a Settings toggle drives autonomousMode so users can grant the agent full freedom per preference.

🤖 Generated with Claude Code

Adds an opt-in way to run requiresConfirmation tools without prompting
AgentCallbacks.onToolConfirmation:

- AgentConfig(autonomousMode:) — default false, applied at Agent.init.
- Agent.setAutonomousMode(_:) / ToolDispatcher.setAutonomousMode(_:) —
  flip it at runtime.

Default behavior is unchanged: confirmation-gated and fail-closed when a
confirmation-required tool is dispatched without a handler. Regression
coverage: autonomous mode runs a DangerousTool with no handler present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@ayman3000
ayman3000 merged commit 9485da7 into main Jul 27, 2026
1 check passed
@ayman3000
ayman3000 deleted the feat/autonomous-mode branch July 27, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant