Skip to content

feat(prompt): add AI disclosure policy for external service communications#2476

Merged
xingyaoww merged 1 commit intomainfrom
add-ai-disclosure-policy
Mar 17, 2026
Merged

feat(prompt): add AI disclosure policy for external service communications#2476
xingyaoww merged 1 commit intomainfrom
add-ai-disclosure-policy

Conversation

@xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Mar 17, 2026

Summary

Adds an AI disclosure instruction to the <EXTERNAL_SERVICES> section of the system prompt. When the agent posts messages, comments, issues, or any human-readable content to external services, it should include a brief note indicating the content was generated by an AI agent on behalf of the user.

Motivation

Currently, nothing in the system prompt or skills instructs the agent to identify itself as AI when posting to external services. This means messages posted to Slack, GitHub comments, Discord channels, Linear issues, Notion pages, etc. can appear as if they were written directly by a human — which is misleading to readers.

Why the SDK system prompt (not just individual skills)?

The agent can post human-visible messages through many channels beyond the handful of provider skills in the extensions repo:

  • MCP tools (e.g., Slack, email, CRM integrations)
  • Custom tools built by SDK users
  • Raw API calls via curl
  • Platform-injected tools (e.g., Slack tools in OpenHands Cloud)

Placing the rule in the system prompt ensures universal coverage regardless of the tool or integration used. Individual provider skills in the extensions repo can optionally reinforce with platform-specific formatting guidance.

Changes

openhands-sdk/openhands/sdk/agent/prompts/system_prompt.j2 — Added one bullet point to the <EXTERNAL_SERVICES> section:

AI disclosure: When posting messages, comments, issues, or any content to external services that will be read by humans (e.g., Slack messages, GitHub/GitLab comments, PR/MR descriptions, Discord messages, Linear/Jira issues, Notion pages, emails, etc.), always include a brief note indicating the content was generated by an AI agent on behalf of the user.

The instruction:

  • Provides a concrete example format
  • Enumerates common platforms for clarity
  • Explicitly covers all channels: dedicated tools, MCP integrations, and direct API calls

Impact

  • All prompt variants (system_prompt_interactive.j2, system_prompt_long_horizon.j2, system_prompt_tech_philosophy.j2) inherit this via {% include "system_prompt.j2" %}
  • No test changes needed — no Python tests assert on EXTERNAL_SERVICES content
  • Fixture files containing rendered prompts will naturally update on regeneration

Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:bd0530f-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-bd0530f-python \
  ghcr.io/openhands/agent-server:bd0530f-python

All tags pushed for this build

ghcr.io/openhands/agent-server:bd0530f-golang-amd64
ghcr.io/openhands/agent-server:bd0530f-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:bd0530f-golang-arm64
ghcr.io/openhands/agent-server:bd0530f-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:bd0530f-java-amd64
ghcr.io/openhands/agent-server:bd0530f-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:bd0530f-java-arm64
ghcr.io/openhands/agent-server:bd0530f-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:bd0530f-python-amd64
ghcr.io/openhands/agent-server:bd0530f-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-amd64
ghcr.io/openhands/agent-server:bd0530f-python-arm64
ghcr.io/openhands/agent-server:bd0530f-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-arm64
ghcr.io/openhands/agent-server:bd0530f-golang
ghcr.io/openhands/agent-server:bd0530f-java
ghcr.io/openhands/agent-server:bd0530f-python

About Multi-Architecture Support

  • Each variant tag (e.g., bd0530f-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., bd0530f-python-amd64) are also available if needed

…tions

When the agent posts messages, comments, issues, or other human-readable
content to external services (Slack, GitHub, Discord, Linear, Notion, etc.),
it should always include a brief note indicating the content was generated
by an AI agent on behalf of the user.

This applies universally — whether through dedicated tools, MCP integrations,
or direct API calls — ensuring transparency regardless of the communication
channel.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

Python API breakage checks — ✅ PASSED

Result:PASSED

Action log

@github-actions
Copy link
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result:PASSED

Action log

@xingyaoww xingyaoww marked this pull request as ready for review March 17, 2026 06:34
Copy link
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Taste Rating: Acceptable

This solves a real transparency problem with a simple, pragmatic approach. The instruction is comprehensive and covers the right cases.

⚠️ Eval Risk Flag

This PR modifies the system prompt template, which directly affects agent behavior. Per repo guidelines, prompt changes require human review with lightweight evals before approval. A maintainer should verify this doesn't negatively impact benchmark performance.

Assessment

Solving a real problem: AI-generated content appearing as human-written is genuinely misleading
Simple implementation: Just adds a rule to the prompt, no complexity
Comprehensive coverage: Lists platforms, covers all integration types
⚠️ Minor verbosity: The bullet point is quite long (~5 lines) - see inline comment

Verdict: Good change, but needs human approval due to prompt modification policy.

<EXTERNAL_SERVICES>
* When interacting with external services like GitHub, GitLab, or Bitbucket, use their respective APIs instead of browser-based interactions whenever possible.
* Only resort to browser-based interactions with these services if specifically requested by the user or if the required operation cannot be performed via API.
* **AI disclosure**: When posting messages, comments, issues, or any content to external services that will be read by humans (e.g., Slack messages, GitHub/GitLab comments, PR/MR descriptions, Discord messages, Linear/Jira issues, Notion pages, emails, etc.), always include a brief note indicating the content was generated by an AI agent on behalf of the user. For example, you could add a line like: _"This [message/comment/issue/PR] was created by an AI assistant (OpenHands) on behalf of [user]."_ This applies to any communication channel — whether through dedicated tools, MCP integrations, or direct API calls.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: This bullet point is quite long (~5 lines of text). Consider breaking it into sub-bullets for readability:

Suggested change
* **AI disclosure**: When posting messages, comments, issues, or any content to external services that will be read by humans (e.g., Slack messages, GitHub/GitLab comments, PR/MR descriptions, Discord messages, Linear/Jira issues, Notion pages, emails, etc.), always include a brief note indicating the content was generated by an AI agent on behalf of the user. For example, you could add a line like: _"This [message/comment/issue/PR] was created by an AI assistant (OpenHands) on behalf of [user]."_ This applies to any communication channel — whether through dedicated tools, MCP integrations, or direct API calls.
* **AI disclosure**: When posting messages, comments, issues, or any content to external services that will be read by humans, always include a brief note indicating the content was generated by an AI agent on behalf of the user.
- **Platforms**: Slack, GitHub/GitLab (comments, PR/MR descriptions), Discord, Linear/Jira, Notion, email, etc.
- **Example format**: _"This [message/comment/issue/PR] was created by an AI assistant (OpenHands) on behalf of [user]."_
- **Scope**: This applies to any communication channel — dedicated tools, MCP integrations, or direct API calls.

That said, the current version is clear and complete. This is a minor style preference, not a blocking issue.

Copy link
Contributor

@VascoSch92 VascoSch92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Sometimes I have a hard time understanding who is writing what 😄

@xingyaoww xingyaoww merged commit 58e7ff3 into main Mar 17, 2026
35 checks passed
@xingyaoww xingyaoww deleted the add-ai-disclosure-policy branch March 17, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants