I think at a minimum, agents are programs that clients submit to the server. The server runs the agent with a very limited API and likely as a pure function (lang could be JS or wasm maybe). The agent could run in response to events on the server (like webhooks), or in response to requests coming in from the client.
Here is a scribble: https://gist.github.com/AriaMinaei/69e1a9166e7ffbd61e7f6709d...