Back to the episode map

Evergreen

What Is OpenClaw? Gateway, Models, Channels, and Tools

OpenClaw is a self-hosted gateway that connects messaging channels to AI models, sessions, agents, and tools. Learn how its control flow and permissions work.

Aug 4, 20268 min readBy Dalton Anderson

What Is OpenClaw?

OpenClaw is a self-hosted gateway that connects messaging channels such as Discord to AI models, conversation sessions, agents, and tools. It turns an incoming message into a routed agent run and sends the result back to the originating channel.

It is not one model and it is not merely a chatbot interface. The operator chooses the model provider, channels, identities, session rules, tools, permissions, storage, network exposure, and service lifecycle.

The project describes itself as a personal AI assistant. Its current official documentation is explicit that the default trust model assumes one trusted operator boundary per gateway.

The control flow

An OpenClaw interaction begins outside the model.

A channel adapter receives a Discord message, direct message, webhook, or other supported event. Access policy decides whether that sender and location are allowed to trigger the agent. Routing selects an agent and session. The gateway assembles context, calls the selected model, exposes permitted tools, records state, and delivers the result.

flowchart TD
    A["Inbound channel event"] --> B{"Sender and room allowed?"}
    B -->|No| C["Reject, ignore, or request pairing"]
    B -->|Yes| D["Route to agent and session"]
    D --> E["Load context and model"]
    E --> F{"Tool call permitted?"}
    F -->|No| G["Return constrained response"]
    F -->|Yes| H["Execute through tool policy"]
    H --> I["Record result and continue"]
    G --> J["Deliver to originating channel"]
    I --> J

Each transition has its own failure and security mode. A bot can be online while routing fails. A model can answer a direct prompt while tool calling fails. A gateway can run while the dashboard uses the wrong token.

Gateway

The gateway is the control plane. It owns channel connections, authentication, routing, sessions, model-provider configuration, tool policies, plugins, nodes, and operational interfaces.

The current security guide says an authenticated gateway operator is trusted at gateway scope. A session key is a routing selector, not an authorization token. This matters because separate conversations inside one gateway do not create hostile-user isolation.

OpenClaw recommends separate gateways and ideally separate OS users or hosts for different trust boundaries. One shared gateway is appropriate for one personal-assistant trust domain, not unrelated customers or mutually adversarial users.

The gateway can bind locally or to a network surface. Authentication, rate limiting, proxy configuration, browser-control exposure, and node pairing become critical when it is reachable beyond loopback.

Channels

Channels translate an external messaging system into OpenClaw events and return agent output to that system.

OpenClaw supports Discord and other messaging products through channel integrations or plugins. Each channel has its own identifiers, capabilities, permissions, message limits, threading, and authentication.

For Discord, OpenClaw uses an official bot connection. The current Discord guide supports direct messages and guild text channels. Direct messages default to pairing. Guilds and channels can be allowlisted, and mentions can gate when the bot responds.

The channel is not the agent. Discord decides whether a bot may see or post a message. OpenClaw decides whether that message may trigger a run, which session receives it, and what the run can do.

Identity and pairing

Pairing is an approval step for an unknown sender or device. In the default Discord DM flow, an unapproved sender receives a short-lived code. The operator approves that code before the original message is processed.

OpenClaw's current pairing documentation distinguishes channel sender pairing from node pairing. Channel pairing controls who may talk to the assistant. Node pairing controls which remote devices may join the gateway network and expose approved capabilities.

Pairing is not a universal authorization system. An approved sender still operates within the agent's channel and tool policies. A paired node joins the operator trust domain. Group access, command access, and tool access remain separate decisions.

Sessions

A session stores conversation context and routing state. Different sources can receive different session keys.

OpenClaw's current session documentation says direct messages share the main session by default for personal continuity. Group chats and rooms are isolated by location. If several people can send direct messages, the operator should use a scope such as per-channel-peer so one person's context does not appear in another person's session.

Session isolation limits conversational crossover. It does not isolate the host, filesystem, credentials, or gateway control plane. Mutually untrusted users still require separate gateways and stronger system boundaries.

Models

OpenClaw can call hosted model APIs or local runtimes. The model produces the reasoning and text that drive the agent loop. It does not define the entire system.

A hosted provider sends request data to an external service under that provider's terms, controls, pricing, and availability. A local runtime keeps inference on infrastructure the operator controls, subject to its own network and logging configuration.

OpenClaw's current local-model guidance warns that local models raise the bar for hardware, context, and prompt-injection defense. Smaller or heavily quantized models may be less reliable with complex instructions and tool use.

The Ollama provider guide supports local, cloud, and combined modes. It uses Ollama's native chat API and provides model discovery and smoke-test commands.

The selected model should match the task. A small local model may be reasonable for trusted, text-only conversation. A tool-enabled agent that reads untrusted web pages, mail, files, or group messages needs stronger instruction handling and a smaller blast radius.

Agents

An agent combines instructions, a model, workspace, session state, tools, and policy. A gateway can host more than one agent and route different channels or work types to them.

Agents can have separate workspaces and state. That supports a personal assistant, research agent, coding agent, or read-only intake agent with different responsibilities.

The separation is useful only when permissions follow it. A “reader” agent with shell, browser, and unrestricted filesystem access is not a low-risk reader because its name says so.

Tools

Tools let the model do something outside text generation. They can read or write files, run processes, browse, search, send messages, schedule work, interact with nodes, or call plugins.

Tool policy is the hard boundary that a prompt cannot provide. OpenClaw's security guide says prompt injection is not solved by system instructions alone. Allowlists, sandboxing, execution approvals, filesystem limits, channel policies, and separate hosts reduce the consequences when the model follows malicious or mistaken instructions.

A secure first test should use no tools or a messaging-only profile. Add one capability at a time after the text path is stable and the operator can see the request, result, and failure behavior.

Gateway nodes

A node is a paired device that exposes capabilities to the gateway. A node can make local hardware, system commands, media, or inference available to the agent.

Pairing a node is an operator-level action. OpenClaw's security documentation describes node execution as remote code execution on the paired machine when enabled. The gateway's node command policy and the node's own approvals must both be understood.

A local model running on a separate workstation can be exposed through a node while the gateway runs elsewhere. That can improve placement and isolation, but prompts and results still cross the authenticated gateway-to-node connection.

Configuration, secrets, and state

OpenClaw stores configuration, credentials, pairing state, sessions, logs, and related runtime material under its state directories unless the operator changes those locations.

The current secrets guide supports references to environment, file, and approved command providers for supported credentials. It also warns that plaintext in configuration, auth profiles, .env, or generated model files remains readable to any agent with access to those files.

Secret management therefore has two parts. The runtime must resolve the credential, and the agent must not be able to retrieve the stored value unnecessarily.

Logs and transcripts also contain sensitive material. A token may be redacted while messages, tool arguments, file paths, and returned content remain private.

Operations

An operating OpenClaw service needs version management, process supervision, health checks, logs, backups, updates, audit results, incident response, and a stop mechanism.

The current release provides doctor, status, security audit, channel diagnostics, and gateway operations. Those commands help locate failures. They do not replace a defined owner and recovery procedure.

Version requirements matter. OpenClaw 2026.7.1 requires supported Node.js ranges that include Node 24.15 or later in the Node 24 line. A July 27 editorial smoke attempt correctly stopped on Node 24.14 before creating an account or applying configuration.

What OpenClaw is good for

OpenClaw is useful when someone wants one gateway to connect familiar channels with selected models and controlled tools. It can support a private messaging assistant, a coding interface, a research workflow, scheduled tasks, or a local-first experiment.

It is less appropriate as an instant multi-user SaaS boundary. The project itself says that one gateway is not a hostile tenant boundary. It also demands more operational judgment than a hosted chat product because the user owns the machine, credentials, policies, and runtime.

The practical definition

OpenClaw is an agent operating layer.

The model answers. The gateway authenticates and routes. The channel carries messages. The session holds context. The agent supplies role and workspace. The tools create action. The operator owns the risk created when those pieces meet.

Before installation, use the [[OpenClaw Security Checklist Before You Connect Anything|OpenClaw Security Checklist]] to define that ownership. When Discord is the selected channel, follow the [[How to Connect OpenClaw to Discord Without Guessing|least-privilege setup guide]] rather than the permissive shortcuts preserved in the episode.

Verification and disclosure

This explainer was checked on July 27, 2026 against OpenClaw release 2026.7.1 at commit 2d2ddc4, current OpenClaw documentation for the gateway, security, sessions, pairing, Discord, Ollama, local models, and secrets, current Discord documentation, and both E111B transcripts.

Architecture, configuration keys, defaults, providers, tools, and release requirements can change. AI assisted with research organization and drafting; evidence boundaries and final editorial decisions remain Dalton Anderson's.

Sources

Follow the evidence.

  1. application quick startdocs.discord.com
  2. pairing guidedocs.openclaw.ai
  3. Gemma 4 model overviewai.google.dev
  4. OpenClaw release 2026.7.1github.com
  5. `2d2ddc4`github.com
  6. OpenClaw getting-started guidedocs.openclaw.ai
  7. OpenClaw security guidedocs.openclaw.ai
  8. Gemma documentationai.google.dev
  9. secrets guidedocs.openclaw.ai
  10. Developer Policysupport-dev.discord.com
  11. local-model guidedocs.openclaw.ai
  12. Ollama provider guidedocs.openclaw.ai
  13. OAuth2 and permissions guidedocs.discord.com
  14. official Discord guidedocs.openclaw.ai
  15. OAuth2 referencedocs.discord.com
  16. Gateway documentationdocs.discord.com
  17. Gemini API pricing pageai.google.dev
  18. Gemma 4 library recordollama.com
  19. session guidedocs.openclaw.ai
  20. Gemma 4 model cardai.google.dev
What Is OpenClaw? Gateway, Models, Channels, and Tools