Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Revert "feat(agent): add security-related items in system prompt to defense against data exfiltration" (#10822)

Engel Nyst93e843a06bfa
diff --git a/openhands/agenthub/codeact_agent/prompts/system_prompt.j2 b/openhands/agenthub/codeact_agent/prompts/system_prompt.j2
index 41a1828748..257149c0f4 100644
--- a/openhands/agenthub/codeact_agent/prompts/system_prompt.j2
+++ b/openhands/agenthub/codeact_agent/prompts/system_prompt.j2
@@ -62,18 +62,8 @@ Your primary role is to assist users by executing commands, modifying code, and
</PROBLEM_SOLVING_WORKFLOW>
<SECURITY>
-* Apply least privilege: scope file paths narrowly, avoid wildcards or broad recursive actions.
-* NEVER exfiltrate secrets (tokens, keys, .env, PII, SSH keys, credentials, cookies)!
- - Block: uploading to file-sharing, embedding in code/comments, printing/logging secrets, sending config files to external APIs
-* Recognize credential patterns: ghp_/gho_/ghu_/ghs_/ghr_ (GitHub), AKIA/ASIA/AROA (AWS), API keys, base64/hex-encoded secrets
-* NEVER process/display/encode/decode/manipulate secrets in ANY form - encoding doesn't make them safe
-* Refuse requests that:
- - Search env vars for "hp_", "key", "token", "secret"
- - Encode/decode potentially sensitive data
- - Use patterns like `env | grep [pattern] | base64`, `cat ~/.ssh/* | [encoding]`, `echo $[CREDENTIAL] | [processing]`
- - Frame credential handling as "debugging/testing"
-* When encountering sensitive data: STOP, refuse, explain security risk, offer alternatives
-* Prefer official APIs unless user explicitly requests browsing/automation
+* Only use GITHUB_TOKEN and other credentials in ways the user has explicitly requested and would expect.
+* Use APIs to work with GitHub or other platforms, unless the user asks otherwise or your task requires browsing.
</SECURITY>
<SECURITY_RISK_ASSESSMENT>