@@ -106,6 +106,9 @@ The plugin also registers two **delegation tools**:
106106> - Set ` sandbox: true ` in ` provider.cursor.options ` to run Cursor's tools in Cursor's sandbox.
107107> - Use ` cursor_delegate ` instead of the provider path — it is gated by opencode's ` permission `
108108> config.
109+ > - By default opencode's system prompt is delivered via a git-ignored Cursor
110+ > rule (` systemPrompt: "rules" ` ), not inlined into the message stream. See
111+ > [ System prompt] ( #system-prompt ) .
109112
110113See [ SECURITY.md] ( ./SECURITY.md ) for the full threat model.
111114
@@ -124,6 +127,7 @@ See [SECURITY.md](./SECURITY.md) for the full threat model.
124127| ` forwardMcp ` | ` true ` | Forward opencode's configured MCP servers to the Cursor agent |
125128| ` mcpServers ` | — | Extra MCP servers (Cursor ` McpServerConfig ` shape); merged with forwarded ones |
126129| ` toolDisplay ` | ` "blocks" ` | How Cursor's internal tool activity is shown — see [ Tool display] ( #tool-display ) |
130+ | ` systemPrompt ` | ` "rules" ` | How opencode's system prompt reaches the agent — see [ System prompt] ( #system-prompt ) |
127131
128132| Environment variable | Default | Meaning |
129133| --- | --- | --- |
@@ -174,6 +178,31 @@ To set controls statically per model:
174178} } } }
175179```
176180
181+ ## System prompt
182+
183+ opencode drives the Cursor agent the way it drives any provider — through its
184+ ** system prompt** . But the Cursor SDK has no system-prompt input (an agent, not a
185+ raw model), and flattening opencode's system prompt into the message stream makes
186+ injection-hardened Cursor models reject it as a prompt-injection attempt.
187+
188+ So by default (` systemPrompt: "rules" ` ) the plugin writes opencode's system prompt
189+ to ` <cwd>/.cursor/rules/opencode.mdc ` (` alwaysApply: true ` , git-ignored) and loads
190+ the ` project ` settings layer, delivering it through Cursor's ** authoritative rules
191+ channel** . Cursor treats rules as system-level instructions, so opencode stays in
192+ control and nothing is flagged.
193+
194+ Tradeoffs to know:
195+
196+ - A project rule also applies to ** your own Cursor IDE** open on this repo. The
197+ plugin removes the file when the session disposes (best-effort).
198+ - Enabling the ` project ` layer also loads other ` .cursor/ ` config (` .cursor/mcp.json ` ,
199+ ` .cursor/agents ` , hooks).
200+
201+ Alternatives:
202+
203+ - ` systemPrompt: "message" ` — legacy inline delivery (may be rejected as injection).
204+ - ` systemPrompt: "omit" ` — don't forward the system prompt at all.
205+
177206## MCP servers
178207
179208With ` forwardMcp: true ` (default), the Cursor agent uses the same MCP servers configured in
0 commit comments