openclaw - 💡(How to fix) Fix Feature Request: Multi-Token Authentication for Team Collaboration

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…

Code Example

{
  "auth": {
    "mode": "token",
    "token": "***"
  }
}

---

{
  "auth": {
    "mode": "multi-token",
    "tokens": [
      {
        "id": "admin",
        "token": "***",
        "permissions": ["*"],
        "description": "Team leader - full permissions"
      },
      {
        "id": "partner",
        "token": "***",
        "permissions": ["agent:product-manager", "agent:designer-mirror"],
        "description": "Partner - can only access product manager and mirror Agent"
      },
      {
        "id": "readonly",
        "token": "***",
        "permissions": ["read:*"],
        "description": "Read-only user - can only view, cannot modify"
      }
    ]
  }
}

---

curl -X POST http://gateway/v1/chat/completions \
  -H "Authorization: Bearer ***" \
  -H "X-OpenClaw-User: partner" \
  -d '{"model": "openclaw/product-manager", "messages": [{"role": "user", "content": "sync design requirements"}]}'

---

// Team leader (full permissions)
const adminToken = "***";
await openclaw.deleteMemory("agent:frontend-dev", "2026-06-01"); // Success

// Partner (restricted permissions)
const partnerToken = "a1b2c3d4...";
await openclaw.deleteMemory("agent:frontend-dev", "2026-06-01", partnerToken); // Denied

// Partner accessing allowed Agents
await openclaw.chat("agent:designer-mirror", "sync design progress", partnerToken); // Success
await openclaw.chat("agent:product-manager", "ask PRD details", partnerToken); // Success
await openclaw.chat("agent:frontend-dev", "modify code", partnerToken); // Denied
RAW_BUFFERClick to expand / collapse

Background

We are a development team using OpenClaw to manage multiple AI Agents (product manager, frontend developer, backend developer, designer, etc.). Team members need cross-instance communication and collaboration, such as:

  • Colleague A's Agent needs to access Colleague B's Agent
  • External partners need limited API access
  • Team leader needs full permissions, regular members need restricted permissions

Current Problem

OpenClaw currently uses a single token architecture:

{
  "auth": {
    "mode": "token",
    "token": "***"
  }
}

This causes the following issues:

  1. No permission differentiation: Everyone shares the same token, cannot distinguish "who is calling"
  2. Security risk: If token is leaked, attacker has full permissions
  3. Cannot implement fine-grained access control: Cannot restrict a user to only access specific Agents
  4. Difficult auditing: Cannot trace specific user operations

Proposed Solutions

Solution A: Multi-Token Configuration

Allow configuring multiple tokens in openclaw.json, each with different permissions:

{
  "auth": {
    "mode": "multi-token",
    "tokens": [
      {
        "id": "admin",
        "token": "***",
        "permissions": ["*"],
        "description": "Team leader - full permissions"
      },
      {
        "id": "partner",
        "token": "***",
        "permissions": ["agent:product-manager", "agent:designer-mirror"],
        "description": "Partner - can only access product manager and mirror Agent"
      },
      {
        "id": "readonly",
        "token": "***",
        "permissions": ["read:*"],
        "description": "Read-only user - can only view, cannot modify"
      }
    ]
  }
}

Solution B: User Identity Header

Include user identity in API requests, Agent can identify message source:

curl -X POST http://gateway/v1/chat/completions \
  -H "Authorization: Bearer ***" \
  -H "X-OpenClaw-User: partner" \
  -d '{"model": "openclaw/product-manager", "messages": [{"role": "user", "content": "sync design requirements"}]}'

Agents can define rules in SOUL.md:

  • Only admin users can execute destructive operations
  • partner users can only access specific Agents
  • External user requests need to be reported to the leader

Solution C: API Key Management System

Similar to OpenAI's API Key management:

  • Add "API Keys" management page in OpenClaw Control UI
  • Can create, revoke, and view API Keys
  • Each Key has independent permission scope and usage statistics

Expected Benefits

  1. Improved security: Different users have different permissions, reducing token leak risks
  2. Smoother collaboration: External partners can safely access specific functions
  3. Traceable auditing: Every operation can be traced to specific users
  4. Better scalability: Prepare for future more users and team expansion

Implementation Suggestions

  1. Backward compatibility: Keep single token mode, multi-token as optional feature
  2. Permission model: Define clear permission levels (admin, read, write, agent-specific)
  3. UI support: Add Token management interface in Control UI
  4. Documentation update: Update configuration docs to explain multi-token usage

Use Case Example

// Team leader (full permissions)
const adminToken = "***";
await openclaw.deleteMemory("agent:frontend-dev", "2026-06-01"); // Success

// Partner (restricted permissions)
const partnerToken = "a1b2c3d4...";
await openclaw.deleteMemory("agent:frontend-dev", "2026-06-01", partnerToken); // Denied

// Partner accessing allowed Agents
await openclaw.chat("agent:designer-mirror", "sync design progress", partnerToken); // Success
await openclaw.chat("agent:product-manager", "ask PRD details", partnerToken); // Success
await openclaw.chat("agent:frontend-dev", "modify code", partnerToken); // Denied

Related Discussion

This feature is valuable for the following scenarios:

  • Enterprise teams: Multiple departments use the same OpenClaw instance but need isolation
  • SaaS platforms: Provide AI Agent services for multiple customers, each with independent token
  • Open source projects: Maintainers have full permissions, contributors have restricted permissions
  • Educational institutions: Teachers have management permissions, students only have usage permissions

Author: Laiqing Team (OpenClaw user) Date: 2026-06-02 Version: OpenClaw v2026.5.28

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