Rename Agent Instructions and add System Prompt
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3521905. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !102 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently we just have a field in the agent form that is System Prompt, which holds the whole instructions for an agent. This is first of all not the naming that is being used by tools like LangGraph and CrewAI, but rather "Agent Instructions".</p> <p>The other issue we have is that there might be times where an agent has to set certain fixed values, that we don't want a "normal" agent editor to change. </p> <p>One example - its fine for instance if someone wants to override so the Field Agent create media fields instead of image fields, but the order of for instance checking or createing a field storage, before a field config should always happen.</p> <p>So the proposal is that we add another config value/form field actually called System Prompt that can use tokens like any other field, but that also has the agent_instructions token. For backward compability, this field can be empty and then it would just be replaced with [agent_instructions].</p> <p>Since this is an "expert" configuration it should only be editable if you have changed a settings.php setting.</p> <h3>Proposed resolution</h3> <ul> <li>Rename the System Prompt to Agent Instructions in the form, but keep the data name.</li> <li>Add a System Prompt called secured_system_prompt in the configuration/entity.</li> <li>Hide the System Prompt from the form, unless you set $settings['show_secured_ai_agent_system_prompt'].</li> <li>Add the token for the agent_instructions/system_prompt into the System Prompt.</li> <li>Add the custom token and on the runner make sure that the agent_instructions token is also replaced.</li> <li>If the secured_system_prompt is empty, set it to [agent_instructions]</li> <li>On the runner make sure to run the secured_system_prompt and replace the tokens and use this.</li> </ul> <h3>Remaining tasks</h3> <ul> <li>On the runner make sure to run the secured_system_prompt and replace the tokens and use this.</li> </ul>
issue