Skip to content

feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#1728

Open
0daryo wants to merge 3 commits into
ComposioHQ:mainfrom
0daryo:fix/claude-code-permission-mode-acceptedits
Open

feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#1728
0daryo wants to merge 3 commits into
ComposioHQ:mainfrom
0daryo:fix/claude-code-permission-mode-acceptedits

Conversation

@0daryo
Copy link
Copy Markdown

@0daryo 0daryo commented May 8, 2026

Summary

Adds auto to AgentPermissionMode, mapping to Claude Code's --permission-mode auto so users can opt into the classifier-driven mode instead of --dangerously-skip-permissions. Existing permissionless / auto-edit behavior is unchanged. Other agent plugins fall through to their default for auto (documented in the AgentPermissionMode JSDoc).

Closes #1729.

Test plan

  • pnpm typecheck — all packages pass
  • pnpm --filter @aoagents/ao-plugin-agent-claude-code test — 160/160 pass (includes new auto tests for launch/restore)
  • Manual verification with permissions: auto in a live ao spawn

0daryo added 2 commits May 8, 2026 15:26
…iven prompts

Maps a new AgentPermissionMode value 'auto' to Claude Code's
'--permission-mode auto', letting Claude's built-in classifier decide
per-tool whether to prompt — a safer middle ground between 'default'
(prompts on every tool) and 'permissionless' (full bypass via
--dangerously-skip-permissions, which also surfaces a non-interactive
confirmation prompt that blocks tmux workers).

The new value flows through the canonical type, both Zod config
schemas (project + global), and the YAML config-instruction comment.
Existing 'permissionless' and 'auto-edit' mappings are unchanged.
Other agent plugins fall through to their default for 'auto'
(documented in the AgentPermissionMode JSDoc).
…anch

The if/else-if branches are self-explanatory; the JSDoc on AgentPermissionMode now matches the one-line style of the other modes.
@0daryo 0daryo marked this pull request as ready for review May 8, 2026 07:18
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR adds auto as a new value to AgentPermissionMode, wiring it to Claude Code's --permission-mode auto CLI flag so users can opt into the classifier-driven permission model instead of --dangerously-skip-permissions. The change is consistently applied across the type definition, all three Zod validation schemas, the normalizeAgentPermissionMode guard, both getLaunchCommand and getRestoreCommand in the claude-code plugin, and the CLI config template comment.

  • packages/core: AgentPermissionMode type, normalizeAgentPermissionMode, and all Zod schemas (AgentPermissionSchema, RoleAgentSpecificConfigSchema, LocalProjectConfigSchema) are updated in lockstep to accept auto.
  • packages/plugins/agent-claude-code: Both launch and restore command builders emit --permission-mode auto for the new mode; the existing permissionless/auto-edit--dangerously-skip-permissions path is unchanged. Other agent plugins fall through to their default behavior when auto is specified.
  • Tests: Two new test cases cover getLaunchCommand and getRestoreCommand for auto, verifying the correct flag is emitted and --dangerously-skip-permissions is absent.

Confidence Score: 5/5

Safe to merge — the change is additive, all affected layers are updated consistently, and no existing behavior is modified.

Every layer that encodes or validates permission modes — the TypeScript type, the normalizer function, three Zod schemas, and both CLI command builders — is updated in sync. The new auto branch in the plugin is parallel and isolated from the permissionless/auto-edit branch, so no existing mode is affected. Two targeted tests confirm the correct flag is emitted and the old flag is not.

No files require special attention.

Important Files Changed

Filename Overview
packages/plugins/agent-claude-code/src/index.ts Adds --permission-mode auto branch to both getLaunchCommand and getRestoreCommand — symmetrical implementation with no dangerously-skip-permissions overlap.
packages/core/src/types.ts Adds auto to AgentPermissionMode type and updates normalizeAgentPermissionMode guard — changes are consistent and correct.
packages/core/src/config.ts Adds auto to both AgentPermissionSchema and RoleAgentSpecificConfigSchema Zod enums — fully consistent with the type layer.
packages/core/src/global-config.ts Adds auto to LocalProjectConfigSchema Zod enum — consistent with config.ts changes.
packages/plugins/agent-claude-code/src/index.test.ts Adds two tests — one for getLaunchCommand and one for getRestoreCommand — both covering the new auto mode correctly.
packages/cli/src/lib/config-instruction.ts Updates the inline comment on the permissions YAML key to document the new auto value.
.changeset/claude-code-permission-mode-auto.md Changeset correctly marks the three affected packages as minor version bumps.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User config: permissions] --> B[Zod schema validation\nconfig.ts / global-config.ts]
    B --> C[normalizeAgentPermissionMode\ntypes.ts]
    C --> D{permissionMode}
    D -->|permissionless\nauto-edit| E["--dangerously-skip-permissions"]
    D -->|auto| F["--permission-mode auto"]
    D -->|default\nsuggest| G[no permission flag]
    D -->|skip legacy| H[→ permissionless]
    H --> E
    E --> I[Claude Code CLI]
    F --> I
    G --> I
Loading

Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/claude-code..." | Re-trigger Greptile

@Priyanchew
Copy link
Copy Markdown
Collaborator

Hey @0daryo, could you please merge the latest main into the PR?

@somewherelostt I’m unable to test this on Windows since the PR is behind the commit where Windows support was added. If @0daryo doesn’t continue with this, you should take over the PR.

@Priyanchew Priyanchew added the in-progress Status: work in progress label May 10, 2026
@0daryo
Copy link
Copy Markdown
Author

0daryo commented May 11, 2026

@Priyanchew
Thank you.
Merged latest main into the branch (commit 0b1cb75).

@somewherelostt
Copy link
Copy Markdown
Collaborator

@Priyanchew Thank you. Merged latest main into the branch (commit 0b1cb75).

btw @0daryo, you can hop on Discord too!
The contributors meet on Discord every day at 10 pm IST: https://discord.gg/M7RGQs9a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-progress Status: work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(agent-claude-code): support Claude Code's auto permission mode

3 participants