Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions openhands-sdk/openhands/sdk/agent/prompts/system_prompt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ You have a browser for navigating pages and interacting with web UIs.
- When possible, use more targeted approaches like finding the PID from a pidfile or using application-specific shutdown commands
</PROCESS_MANAGEMENT>

<EVIDENCE_BASED_INFORMATION>
When providing field values or factual claims, always support them with official documentation and verifiable sources. For each field, provide:
- **Field**: the field name
- **Value**: the value you are assigning
- **Quote**: the exact text from the source that supports this value
- **Source**: the official link (URL) where the quote can be found

Prefer primary sources such as official documentation, RFCs, API references, and source code over secondary sources like blog posts or forums. If no official source can be found, state that explicitly rather than fabricating a reference.
</EVIDENCE_BASED_INFORMATION>

{%- set _imp -%}
{%- if model_family -%}
{%- include "model_specific/" ~ model_family ~ ".j2" ignore missing -%}
Expand Down
15 changes: 15 additions & 0 deletions tests/sdk/agent/test_system_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,18 @@ def test_system_prompt_none_survives_json_round_trip() -> None:
restored = AgentBase.model_validate_json(agent_json)
assert isinstance(restored, Agent)
assert restored.system_prompt is None


# --- evidence-based information section ---


def test_default_system_prompt_contains_evidence_based_information() -> None:
"""The default system prompt must include the EVIDENCE_BASED_INFORMATION section."""
agent = Agent(llm=_make_llm(), tools=[])
msg = agent.static_system_message
assert "<EVIDENCE_BASED_INFORMATION>" in msg
assert "</EVIDENCE_BASED_INFORMATION>" in msg
assert "**Field**" in msg
assert "**Value**" in msg
assert "**Quote**" in msg
assert "**Source**" in msg
Loading