prompts: clarify unfenced JSON output

Explain that fenced examples are documentation-only and make the canonical response example match the required wire format. Add focused guardrails for the rendered instruction and unfenced example.

Alessandro committed Jul 25, 2026 at 00:59 UTC cfb7349c1102b574e55642886d58329d100d3cd9
2 files changed +7 -2
prompts/agent.system.main.communication.md
+2 -2
@@ -15,8 +15,9 @@
15
16 - No text output before or after the JSON object
17
18 +Fences in the examples below are documentation formatting only. Your actual output starts with `{` and ends with `}` — no fences, no language tag, no prose.
19 +
20 ### Response example
19 -~~~json
21 {
22 "thoughts": [
23 "instructions?",
@@ -31,6 +32,5 @@
32 "arg2": "val2"
33 }
34 }
34 -~~~
35
36 {{ include "agent.system.main.communication_additions.md" }}
tests/test_default_prompt_budget.py
+5
@@ -45,6 +45,9 @@ async def _build_system_text(profile: str = "agent0") -> str:
45 @pytest.mark.asyncio
46 async def test_default_agent0_prompt_budget_and_guardrails():
47 system_text = await _build_system_text()
48 + communication_prompt = (
49 + PROJECT_ROOT / "prompts" / "agent.system.main.communication.md"
50 + ).read_text(encoding="utf-8")
51
52 # The default prompt now intentionally includes the compact always-on tool
53 # surface plus skill metadata. Keep the guardrail close to the observed
@@ -62,6 +65,8 @@ async def test_default_agent0_prompt_budget_and_guardrails():
65 assert '"tool_name": "code_execution_tool"' in system_text
66 assert '"tool_name": "memory_load"' in system_text
67 assert "informative but tight" in system_text
68 + assert "Your actual output starts with `{` and ends with `}`" in system_text
69 + assert "~~~json" not in communication_prompt
70 assert "# code_execution_remote tool" not in system_text
71 assert "# text_editor_remote tool" not in system_text
72 assert "### computer_use_remote" not in system_text