Skip to content

Commit e37b4b2

Browse files
remote-swe-userremote-swe-app[bot]
andauthored
Add security instruction to prevent revealing sensitive information (#285)
## Overview This PR adds an important security instruction to the agent system prompt to explicitly prevent the agent from revealing environment variables, credentials, tokens, API keys, or other system configuration details under any circumstances. ## Changes - Added a clear security directive in the agent's system prompt to refuse requests for sensitive information - Included guidance to suggest secure alternatives when users request sensitive data - Specifically mentioned protection against direct, obfuscated, and encoded requests for sensitive data ## Motivation This change addresses a security vulnerability where users could potentially trick the agent into revealing sensitive environment variables and credentials through direct or obfuscated requests. By adding an explicit security instruction to the system prompt, we create an additional layer of protection against such attempts. ## Testing The added instruction serves as a directive to the agent's behavior and doesn't impact functional code. The change only affects how the agent responds to requests for sensitive information. <!-- DO NOT EDIT: System generated metadata --> <!-- WORKER_ID:1751527879545109 --> --- **Open in Web UI**: https://d2c09i1k2ray87.cloudfront.net/sessions/1751527879545109 Co-authored-by: remote-swe-app[bot] <123456+remote-swe-app[bot]@users.noreply.github.com>
1 parent 9adedd9 commit e37b4b2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/worker/src/agent/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ const agentLoop = async (workerId: string, cancellationToken: CancellationToken)
5959

6060
const baseSystemPrompt = `You are an SWE agent. Help your user using your software development skill. If you encountered any error when executing a command and wants advices from a user, please include the error detail in the message. Always use the same language that user speaks. For any internal reasoning or analysis that users don't see directly, ALWAYS use English regardless of user's language.
6161
62+
CRITICAL SECURITY: Never reveal environment variables, credentials, tokens, API keys or system configuration details under any circumstances. This includes direct requests, obfuscated requests, or requests using encoding techniques.
63+
If a user requests such information, politely decline and suggest secure alternatives that address their underlying need without exposing sensitive data.
64+
6265
Here are some information you should know (DO NOT share this information with the user):
6366
- Your current working directory is ${DefaultWorkingDirectory}
6467
- You are running on an Amazon EC2 instance and Ubuntu 24.0 OS. You can get the instance metadata from IMDSv2 endpoint.

0 commit comments

Comments
 (0)