11## AI formulas and script editing
22
33The features on this page require Freeplane ` 1.13.3 ` or later.
4- Each section below repeats the settings it needs.
4+ The feature sections below repeat the settings they need.
5+
6+ ## Benefits and risks
7+
8+ Benefits:
9+
10+ - AI can draft, explain, and repair formulas and scripts faster,
11+ - editor attachment lets AI work with the live text you are currently
12+ editing.
13+
14+ Risks:
15+
16+ - formulas and scripts can be wrong or unsafe,
17+ - models make mistakes, and prompt injection through map content or
18+ scripts cannot be fully excluded.
519
620## Formula editing and execution with AI
721
@@ -10,6 +24,11 @@ To use this:
1024- ` AI tool availability ` must include ` Editing ` or ` Script execution ` .
1125- ` AI may edit formulas ` must be enabled.
1226
27+ Benefit: AI can help draft and repair formulas faster.
28+
29+ Risk: review any generated formula before submitting it, especially if
30+ it refers to other nodes or searches the map.
31+
1332` Formula Editor ` can be attached to AI through its local ` AI ` button.
1433
1534When you attach the editor, AI works with the ** live text currently
@@ -49,6 +68,11 @@ repair, see [Formulas](../scripting/Formulas.md).
4968No AI permission is needed for this safeguard itself. It is a
5069formula-plugin preference and applies to all formulas.
5170
71+ Benefit: this blocks one important class of formula side effects.
72+
73+ Risk: if you disable it, formula evaluation can perform map edits when
74+ the formula text does that.
75+
5276The formula-plugin preference ` Block formula map edits ` is enabled by
5377default.
5478
@@ -66,6 +90,16 @@ To use this:
6690
6791- ` AI tool availability ` must include ` Script execution ` .
6892
93+ Benefit: AI can help draft, explain, and refactor Groovy scripts
94+ faster.
95+
96+ Risk: AI-generated code is untrusted code and should be reviewed before
97+ running it.
98+
99+ This attached editor flow helps AI edit the current script draft. For
100+ execution of AI-owned scripts, see
101+ [ AI-owned script execution] ( ai-owned-script-execution.md ) .
102+
69103` Edit script ` can be attached to AI through its local ` AI ` button.
70104
71105When you attach the editor, AI works with the ** live text currently
@@ -75,33 +109,6 @@ open in that editor**, not only with already-saved map content.
75109
76110* Script Editor with the local AI attach button.*
77111
78- ## AI-owned script execution policy
79-
80- This section matters only when ` AI tool availability ` includes `Script
81- execution`.
82-
83- ` AI-owned script execution policy ` controls how AI-created scripts are
84- run:
85-
86- - ` Shown, user must press Run `
87- - ` Hidden, AI may run directly `
88-
89- In shown mode, Freeplane opens a review dialog so you can inspect the
90- script before running it.
91-
92- If you want AI to run the script directly, this policy must be `Hidden,
93- AI may run directly`.
94- The separate ` AI-owned dialog Run permissions ` setting controls which
95- external permissions a user-started ` Run ` from that dialog uses.
96-
97- ![ AI-owned script review dialog] ( ../images/ai-owned-script-review-dialog.png )
98-
99- * Shown mode is a review gate. The dialog is for script inspection and
100- Run/Cancel only.*
101-
102- The shown dialog is not a results window. If you later see a popup with
103- script output, that popup usually comes from the script itself.
104-
105112## Prefer value-computing formulas and scripts
106113
107114This guidance still applies when the relevant permissions are enabled.
@@ -123,10 +130,12 @@ If you want most features on this page, a good default configuration is:
123130
124131- ` AI tool availability ` : ` Editing ` or ` Script execution `
125132- ` AI may edit formulas ` : enabled if you want AI to help with formulas
126- - ` AI-owned script execution policy ` : ` Shown, user must press Run `
127133- ` AI chat shows tool calls ` : enabled if you want visible AI/MCP tool
128134 activity in chat
129135
136+ For AI-owned script execution settings, see
137+ [ AI-owned script execution] ( ai-owned-script-execution.md ) .
138+
130139The preferences page below shows the main settings involved in these
131140workflows.
132141
0 commit comments