HiClaw Security Model

Security is not an afterthought in HiClaw — it's a foundational design principle. Every Worker operates with minimal privileges, all credentials are centrally managed, and the human admin maintains full visibility and control.

Security Principles

Least Privilege

Workers only receive the minimum access needed. Consumer tokens replace real API keys.

Centralized Credentials

All sensitive secrets live in the Higress Gateway, never in agent containers.

Full Transparency

Every agent action is visible in Matrix rooms. The human admin can audit everything in real-time.

Defense in Depth

Multiple layers: token isolation, MCP permissions, gateway routing, and container sandboxing.

Credential Isolation

The core of HiClaw's security model is strict credential isolation between the Manager, Workers, and external services:

Credential TypeStored InWorker Access
LLM API Keys (OpenAI, Bailian, etc.)Higress GatewayConsumer bearer token
GitHub Personal Access TokenHigress GatewayProxied through gateway
MCP Server CredentialsHigress GatewayPermission-gated access
Matrix Admin TokenManager onlyNo access
MinIO Access KeysManager onlyRead/write via file-sync skill
Key security guarantee: Even if a Worker container is compromised, the attacker only obtains a consumer bearer token — not your actual LLM API keys, GitHub tokens, or other sensitive credentials.

Consumer Token System

When the HiClaw Manager creates a new Worker, it registers a consumer in the Higress Gateway:

  1. Manager calls the higress-gateway-management skill to create a consumer
  2. Higress issues a unique bearer token for the consumer
  3. The token is passed to the Worker container as an environment variable
  4. The Worker uses this token for all LLM and MCP requests
  5. Higress maps the consumer token to the real API keys internally

This means the Worker can make LLM calls and access tools without ever knowing the actual credentials. The Manager can revoke a consumer token at any time to immediately cut off a Worker's access.

MCP Server Permissions

HiClaw implements granular permission control for MCP (Model Context Protocol) Server access:

Permission Flow

Worker calls MCP tool
    → Request hits Higress Gateway
    → Gateway checks consumer permissions
    → If allowed: forwards to MCP Server
    → If denied: returns permission error
    → Result returned to Worker

Communication Security

All inter-agent communication in HiClaw flows through the Matrix protocol:

Security Best Practices