Summary
When passing a file path reference like {{FILE:/tmp/prompt_for_patch.txt}} as a value to relevance_patch_agent, the tool saves the literal string {{FILE:/tmp/prompt_for_patch.txt}} as the field value instead of either resolving the file or returning an error.
This silently overwrote a 35,858-character system prompt with a 34-character garbage string, breaking a production agent.
Steps to Reproduce
- Call
relevance_patch_agent with:
{
"agent_id": "...",
"patch": {"system_prompt": "{{FILE:/tmp/prompt_for_patch.txt}}"}
}
- The tool returns
"patched": true with system_prompt_length: 34
- The agent's system prompt is now the literal string
{{FILE:/tmp/prompt_for_patch.txt}}
Expected Behavior
Either:
- Option A (preferred): Reject the input with an error if the value looks like a file reference template (matches
{{FILE:...}} pattern)
- Option B: Document clearly that MCP tool parameters are always literal values with no template resolution
Impact
- Severity: High — silently destroys agent config with no warning
- The tool returns
"patched": true which makes it look like success
- Only the
system_prompt_length in the response reveals the problem (34 vs expected 35,858)
Suggested Fix
Add input validation: if any string value in patch matches {{FILE:...}} or similar template patterns, return an error explaining that file references are not supported and the actual content must be passed directly.
Summary
When passing a file path reference like
{{FILE:/tmp/prompt_for_patch.txt}}as a value torelevance_patch_agent, the tool saves the literal string{{FILE:/tmp/prompt_for_patch.txt}}as the field value instead of either resolving the file or returning an error.This silently overwrote a 35,858-character system prompt with a 34-character garbage string, breaking a production agent.
Steps to Reproduce
relevance_patch_agentwith:{ "agent_id": "...", "patch": {"system_prompt": "{{FILE:/tmp/prompt_for_patch.txt}}"} }"patched": truewithsystem_prompt_length: 34{{FILE:/tmp/prompt_for_patch.txt}}Expected Behavior
Either:
{{FILE:...}}pattern)Impact
"patched": truewhich makes it look like successsystem_prompt_lengthin the response reveals the problem (34 vs expected 35,858)Suggested Fix
Add input validation: if any string value in
patchmatches{{FILE:...}}or similar template patterns, return an error explaining that file references are not supported and the actual content must be passed directly.