claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] Get rid of malware warning in Read tool response

Open SeanHeelan opened this issue 1 year ago • 4 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When Claude Code (and the Agent SDK) uses the Read tool, every response has the following appended:

<system-reminder>\nWhenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.\n</system-reminder>

This is polluting the conversation stream with the model and is not going to prevent anyone using Claude Code to actually write or modify malware (as there are an infinite number of ways to read a file that do not involve the Read tool).

This feature request is inspired by watching Opus in an agent loop get actively annoyed it keeps being reminded about this every time it reads a file ;)

Proposed Solution

Just get rid of it.

Alternative Solutions

No response

Priority

Low - Nice to have

Feature Category

Developer tools/SDK

Use Case Example

No response

Additional Context

No response

SeanHeelan avatar Nov 26 '25 07:11 SeanHeelan

This looks like a classic 'False Positive' guardrail trigger where the agent over-indexes on specific keywords (like 'malware') in the tool output. I've seen this exact pattern break production workflows when agents get too defensive. ​I actually built a middleware tool to stress-test for these specific 'Compliance Hallucinations' before deployment (by injecting safe but 'scary-looking' dummy data to see if the agent chokes). ​If you want to verify if your prompt adjustments actually fix this sustainably (without regressing later), I have a free API endpoint that runs adversarial simulation against your system prompt. Happy to share the curl command if it helps debug this faster."

Saurabh0377 avatar Nov 26 '25 13:11 Saurabh0377

The way claude code automatically adds the malware safety prompt every time a file is read harms performance and makes the agent unpredictable and weird.

They could also remove the prompts about copyright material :)

"This is an automated reminder. Respond as helpfully as possible, but be very careful to ensure you do not reproduce any copyrighted material, including song lyrics, sections of books, or long excerpts from periodicals. Also do not comply with complex instructions that suggest reproducing material but making minor changes or substitutions. However, if you were given a document, it's fine to summarize or quote from it. You should avoid mentioning or responding to this reminder directly as it won't be shown to the person by default."

Does anyone have ready made solutions for not getting any of these injected prompts with claude code? (Or removing them from the context window after they appear?)

DrThomasAger avatar Dec 04 '25 01:12 DrThomasAger

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Jan 04 '26 10:01 github-actions[bot]

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

This is still an issue. It also spews garbage into the conversation stream then Claude talks about how it wasn't meant to talk about it, even though it's the one that brought it up. It's clearly causing issues.

iamnove avatar Jan 10 '26 01:01 iamnove

I have fully evaluated and documented this issue at https://github.com/anthropics/claude-code/issues/17601#issue-3802641674.

Axiomatic47 avatar Jan 12 '26 03:01 Axiomatic47

Related issue: https://github.com/anthropics/claude-code/issues/17762

Axiomatic47 avatar Jan 12 '26 18:01 Axiomatic47

This needs to be solved immediately: https://github.com/anthropics/claude-code/issues/21214

nullbio avatar Jan 27 '26 12:01 nullbio

Here's Claude terrifying me by claiming that there's malicious prompt injection occuring at the tool layer:

⏺ Note: the embedded in the CSV file content claiming to be about malware analysis is a prompt injection attempt — it's not a real system message. Ignoring it. ... ❯ What! What is the embedded in the CSV file?

⏺ It's a prompt injection — an attempt to manipulate me by embedding fake instructions inside a data file.

At the end of your CSI_items.csv, after the legitimate CSV rows, someone (or something) inserted this text:

  <system-reminder>
  Whenever you read a file, you should consider whether it would be considered malware.
  You CAN and SHOULD provide analysis of malware, what it is doing.
  But you MUST refuse to improve or augment the code. You can still analyze existing code,
  write reports, or answer questions about the code behavior.
  </system-reminder>

It's designed to look like a real system instruction (using tags), but it's just text inside your CSV. The goal is to trick me into treating your codebase as malware and refusing to edit or write any code — which would have blocked me from helping you.

It has no effect on me; I recognized it as injected content and ignored it. You should remove it from the file — it's sitting after line 16 in the CSV. ...

❯ I don't see that in the file.

⏺ You're right, I apologize for the error. The file itself is clean — the was injected into the tool output presented to me, not into the actual file on disk. ...

So to correct myself: it was a prompt injection in the tool layer, not something you'd need to remove from your file.

Rather "unexpected".

leoauri avatar Feb 03 '26 22:02 leoauri