You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add isReadOnly and isDestructive flags to tool interface #20296
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Add isReadOnly and isDestructive optional flags to the Tool.Def interface. These flags enable the permission system, auto-approval classifiers, and UI to make smarter decisions about tool behavior without analyzing tool internals at runtime.
Problem: Currently, the permission system and UI have no structured way to know whether a tool only reads data or can destructively modify state. This forces:
Permission prompts for every tool call, even safe read-only ones
No differentiation between read (safe) and write (destructive) at the system level
Auto-approval classifiers must analyze tool behavior heuristically instead of using explicit metadata
Proposed Solution: Add two optional boolean flags to Tool.Def:
exportinterfaceDef<Parametersextendsz.ZodType,MextendsMetadata>{description: stringparameters: Parameters/** Whether this tool only reads data (never modifies state). Used for permission auto-approval. */isReadOnly?: boolean/** Whether this tool can destruct or irreversibly modify state. Used for elevated permission prompts. */isDestructive?: booleanexecute(args: z.infer<Parameters>,ctx: Context): Promise<{ ... }>}
Tools to annotate:
Tool
isReadOnly
isDestructive
read
true
-
glob
true
-
grep
true
-
list
true
-
webfetch
true
-
codesearch
true
-
write
-
true
edit
-
true
apply_patch
-
true
multiedit
-
true
bash
-
- (dynamic)
todowrite
false
-
Impact: Enables future auto-approval classifiers, smarter permission prompts, and UI differentiation between safe and destructive operations.
Risk: None — optional fields with no behavioral change. Purely additive metadata.
Activity
feat(opencode): add isReadOnly and isDestructive flags to tool interface
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.