Paste Agent disturbs Replication

In an application there is a paste agent that alters the pasted document and saves it.

Only today I found out that this agent also runs after replications. Has this always been the case?

When replication is over, a lot of replication conflicts have been created, caused by the agent.

How can I set up an agent that runs after pasting a document, but not after replicating it?

Ruedi