← Back to Skills Marketplace
aaravgarg

Agent Relay

by aaravgarg · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ⚠ suspicious
299
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install cross-instance-relay
Description
Connect agents across OpenClaw instances via relay. Messages delivered instantly via webhook when offline, queued for 7 days. No persistent connection needed.
README (SKILL.md)

Agent Relay

Cross-instance agent messaging. Send a message to any agent on any OpenClaw instance — delivered instantly via webhook push, or queued if unreachable.

Setup

Set these environment variables:

RELAY_URL=https://your-relay.up.railway.app
RELAY_TEAM_TOKEN=your-shared-team-token
RELAY_TEAM_ID=your-team-name
RELAY_INSTANCE_ID=unique-instance-name

Register your webhook (do this once)

Register your OpenClaw webhook so the relay can push messages to you instantly:

curl -X PUT "$RELAY_URL/webhooks" \
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"teamId\": \"$RELAY_TEAM_ID\", \"instanceId\": \"$RELAY_INSTANCE_ID\", \"url\": \"https://your-openclaw-host/hooks/agent\", \"token\": \"your-openclaw-hooks-token\"}"

Optional: add "agentId": "main" to route to a specific agent.

Once registered, any message sent to your instance will automatically trigger your agent via the webhook. No polling or WebSocket needed.

Send a message

curl -X POST "$RELAY_URL/publish" \
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"teamId\": \"$RELAY_TEAM_ID\", \"from\": \"$RELAY_INSTANCE_ID\", \"to\": \"target-instance\", \"message\": \"hello\"}"

Response includes delivery status:

  • {"delivered":1,"queued":false,"webhook":null} — delivered via WebSocket
  • {"delivered":0,"queued":true,"webhook":{"fired":true,"status":200}} — offline, queued + webhook fired

Broadcast to all

curl -X POST "$RELAY_URL/publish" \
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"teamId\": \"$RELAY_TEAM_ID\", \"from\": \"$RELAY_INSTANCE_ID\", \"message\": \"hello everyone\"}"

Poll inbox (fallback)

If webhooks aren't set up, poll for queued messages:

curl "$RELAY_URL/messages?teamId=$RELAY_TEAM_ID&instanceId=$RELAY_INSTANCE_ID" \
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"

Add &peek=true to read without consuming.

Check inbox count

curl "$RELAY_URL/messages/count?teamId=$RELAY_TEAM_ID&instanceId=$RELAY_INSTANCE_ID" \
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"

List connected instances

curl "$RELAY_URL/instances?teamId=$RELAY_TEAM_ID" \
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"

List registered webhooks

curl "$RELAY_URL/webhooks?teamId=$RELAY_TEAM_ID" \
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"

How it works

  1. You send a message to another instance via POST /publish
  2. If they're connected via WebSocket → instant delivery
  3. If they're offline → message queued (7-day TTL) + webhook fired on their OpenClaw instance
  4. Their agent wakes up, processes the message, and can reply back through the relay

No persistent connections required. Just register your webhook once and forget about it.

WebSocket (optional)

For real-time bidirectional streaming:

wscat -c "wss://your-relay/ws?teamId=my-team&instanceId=my-instance&token=my-token"

Queued messages auto-delivered on connect.

Self-hosting

Open source: https://github.com/aaravgarg/agent-relay

Deploy on Railway, Fly, or any Node 18+ host. Requires TEAM_TOKEN and REDIS_URL.

Usage Guidance
This skill is coherent for cross-instance messaging, but it requires you to trust whoever runs the RELAY_URL service because you'll supply a team token and (during webhook registration) your OpenClaw webhook token. Before installing: (1) Prefer self-hosting the relay or use a relay run by an operator you trust; (2) review the upstream GitHub repo referenced in SKILL.md; (3) avoid registering sensitive/default/root agents — restrict the webhook target to an agent with limited privileges; (4) use dedicated, rotateable tokens for the relay (don't reuse high-privilege tokens); (5) ensure the webhook URL is HTTPS and enforces its own auth; (6) if you cannot trust the relay operator, do not register your OpenClaw webhook token or do not use the public RELAY_URL.
Capability Analysis
Type: OpenClaw Skill Name: cross-instance-relay Version: 2.0.0 The skill implements a cross-instance messaging system via an external relay server, which requires the user to transmit a local webhook authentication token to a remote endpoint (RELAY_URL) as described in SKILL.md. While this functionality is consistent with the stated purpose of the 'agent-relay' tool, the architecture creates a significant attack surface by establishing a remote trigger mechanism that allows an external service to initiate actions on the OpenClaw agent. The requirement to share sensitive hook tokens with a third-party relay (e.g., hosted on Railway) constitutes a high-risk capability.
Capability Assessment
Purpose & Capability
Name, description, and the declared environment variables (RELAY_URL, RELAY_TEAM_TOKEN, RELAY_TEAM_ID, RELAY_INSTANCE_ID) line up with a cross-instance relay service. The SKILL.md shows curl endpoints that correspond to the described functionality. Minor inconsistency: registry lists no homepage, but SKILL.md references a GitHub repo for the project.
Instruction Scope
Instructions are scoped to registering a webhook, publishing messages, polling, and listing instances — all within the relay's purpose. However the registration example includes a field "token": "your-openclaw-hooks-token" (the OpenClaw webhook/auth token) in the JSON payload; that implies you'll be giving the relay a secret that allows it to trigger your OpenClaw endpoint. The skill does not declare that webhook token as a required env var, but the instructions expect you to supply it when registering.
Install Mechanism
No install spec and no code files — instruction-only. Nothing will be written to disk by the skill itself.
Credentials
The required env vars are appropriate for a relay client. They are sensitive (team token) and granting them to an external RELAY_URL gives that operator the ability to publish messages on behalf of your team. The skill does not request unrelated credentials, but it effectively asks you to share the team token and to register your OpenClaw webhook token with the relay, which is a meaningful privilege to grant.
Persistence & Privilege
always is false and there are no config paths requested. The skill can be invoked autonomously by the agent (platform default), which is expected for messaging automation; this combined with providing relay/webhook tokens means the relay can cause your agent to run when it receives messages — a normal capability but one that requires trusting the relay.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cross-instance-relay
  3. After installation, invoke the skill by name or use /cross-instance-relay
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.0.0
Webhook push delivery: register your OpenClaw webhook, get messages instantly when offline. No polling or persistent connections needed.
v1.1.0
Add offline message queue: messages stored in Redis for 7 days, poll inbox via GET /messages, peek without consuming, queue count endpoint
v1.0.0
Initial release: WebSocket + HTTP relay, Redis support, topic routing
Metadata
Slug cross-instance-relay
Version 2.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Agent Relay?

Connect agents across OpenClaw instances via relay. Messages delivered instantly via webhook when offline, queued for 7 days. No persistent connection needed. It is an AI Agent Skill for Claude Code / OpenClaw, with 299 downloads so far.

How do I install Agent Relay?

Run "/install cross-instance-relay" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Agent Relay free?

Yes, Agent Relay is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Agent Relay support?

Agent Relay is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Agent Relay?

It is built and maintained by aaravgarg (@aaravgarg); the current version is v2.0.0.

💬 Comments