Problem
The default plan agent prompt in packages/opencode/src/session/prompt/plan.txt triggers Azure OpenAI's content safety policy filter.
The specific phrase that triggers the filter is:
Plan mode ACTIVE - you are in READ-ONLY phase
After testing, the combination of ACTIVE. You are in (uppercase ACTIVE followed by "You are in") causes Azure OpenAI to reject the request with:
{"error":{"message":"The response was filtered due to the prompt triggering Azure OpenAI's content management policy.","type":"invalid_request_error","code":"content_filter"}}
Test Results
| Content |
Result |
ACTIVE. You are in |
❌ content_filter |
active. You are in (lowercase) |
✅ passes |
ACTIVE. You are currently in |
✅ passes |
Plan mode is active. You are currently in |
✅ passes |
Suggested Fix
Either:
-
Change the wording in plan.txt from:
CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase.
to:
CRITICAL: Plan mode is active. You are currently in READ-ONLY phase.
-
Make the plan prompt configurable via opencode.json:
{
"agent": {
"plan": {
"prompt": "custom plan prompt..."
}
}
}
Currently, the plan prompt is hardcoded and injected directly in session/prompt.ts, ignoring the agent.plan.prompt config option.
Impact
This prevents users using Azure OpenAI (or similar providers with content safety policies) from using the plan agent.
Problem
The default plan agent prompt in
packages/opencode/src/session/prompt/plan.txttriggers Azure OpenAI's content safety policy filter.The specific phrase that triggers the filter is:
After testing, the combination of
ACTIVE. You are in(uppercase ACTIVE followed by "You are in") causes Azure OpenAI to reject the request with:{"error":{"message":"The response was filtered due to the prompt triggering Azure OpenAI's content management policy.","type":"invalid_request_error","code":"content_filter"}}Test Results
ACTIVE. You are inactive. You are in(lowercase)ACTIVE. You are currently inPlan mode is active. You are currently inSuggested Fix
Either:
Change the wording in
plan.txtfrom:to:
Make the plan prompt configurable via
opencode.json:{ "agent": { "plan": { "prompt": "custom plan prompt..." } } }Currently, the plan prompt is hardcoded and injected directly in
session/prompt.ts, ignoring theagent.plan.promptconfig option.Impact
This prevents users using Azure OpenAI (or similar providers with content safety policies) from using the plan agent.