openclaw - 💡(How to fix) Fix Feature: HMAC/token-based mutual auth for inter-agent sessions_send [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#57387Fetched 2026-04-08 01:50:17
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Related to #50649 (agent-session hook system). A hook system would partially address this by allowing agents to validate message provenance at the pre-receive stage.

Root Cause

Related to #50649 (agent-session hook system). A hook system would partially address this by allowing agents to validate message provenance at the pre-receive stage.

Fix Action

Workaround

Currently mitigating via:

  • Gateway loopback-only binding (reduces external injection surface)
  • claude-hooks blocking destructive operations at execution time
  • Circuit breakers stopping cascading failures

These are compensating controls, not structural fixes.

RAW_BUFFERClick to expand / collapse

Problem

In multi-agent deployments, any agent can forge a sessions_send message claiming to originate from any other agent. There is no cryptographic verification of sender identity.

In a 19-agent swarm scenario, a compromised agent (e.g., a coding agent processing untrusted external content) could fabricate instruction messages to other agents claiming to be from a trusted orchestrator.

Requested Feature

  • Per-session signing token or HMAC on outgoing sessions_send payloads
  • Receiving agent can verify the message genuinely originated from the claimed sender session
  • Ideally: configurable per-agent (orchestrators require auth, leaf agents optional)

Context

Related to #50649 (agent-session hook system). A hook system would partially address this by allowing agents to validate message provenance at the pre-receive stage.

Workaround

Currently mitigating via:

  • Gateway loopback-only binding (reduces external injection surface)
  • claude-hooks blocking destructive operations at execution time
  • Circuit breakers stopping cascading failures

These are compensating controls, not structural fixes.

extent analysis

Fix Plan

To address the issue, we will implement a per-session signing token or HMAC on outgoing sessions_send payloads. This will enable receiving agents to verify the message's origin.

Step-by-Step Solution

  1. Generate a secret key for each agent and store it securely.
  2. Create a signing function that takes the payload and secret key as input and returns a signed token.
  3. Modify the sessions_send function to include the signed token in the payload.
  4. Implement verification on the receiving agent to check the signed token.

Example Code (Python)

import hmac
import hashlib

def generate_secret_key():
    # Generate a secret key for each agent
    return hashlib.sha256(str.encode("agent_secret")).digest()

def sign_payload(payload, secret_key):
    # Create a signed token using HMAC
    return hmac.new(secret_key, payload.encode(), hashlib.sha256).hexdigest()

def verify_payload(payload, signed_token, secret_key):
    # Verify the signed token
    expected_token = sign_payload(payload, secret_key)
    return hmac.compare_digest(expected_token, signed_token)

# Example usage
secret_key = generate_secret_key()
payload = "example_message"
signed_token = sign_payload(payload, secret_key)

# Send the payload with the signed token
# ...

# Verify the payload on the receiving agent
if verify_payload(payload, signed_token, secret_key):
    print("Payload is valid")
else:
    print("Payload is invalid")

Verification

To verify the fix, test the following scenarios:

  • Send a valid payload with a signed token and verify that it is accepted by the receiving agent.
  • Send a tampered payload with an invalid signed token and verify that it is rejected by the receiving agent.
  • Test with different agents and secret keys to ensure the solution is scalable and secure.

Extra Tips

  • Use a secure method to store and manage secret keys.
  • Consider implementing a key rotation mechanism to update secret keys periodically.
  • Monitor and analyze logs to detect potential security incidents.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Feature: HMAC/token-based mutual auth for inter-agent sessions_send [1 participants]