Agent security: running on behalf of - local

I need some explanation about the rights/priviledges an agent runs with that has the “run on behalf of” property set.

Background: to prevent copy/paste I have an agent that is triggered by pasting that collects note ids in a parameter doc and calls a second agent by the RunOnServer method of NotesAgent class.

The secons agent uses the note id to delete the docs again. Both agents are signed with an id with manager access and deletion priviledge.

Everything works fine when a database replica on a server is used. Trying to paste in a local replica lets the second agent throw an error in the remove method.

So: Whats wronf here? Is there any way to make it work local too?

regards

klaus buecher