This runbook is for the current working setup in this repository:
- AuthSec SSO in front of OpenClaw
- OpenClaw gateway running in Docker
- browser access through the proxy at
http://localhost:8080 - optional Discord plugin
- Windows local-machine access through a paired OpenClaw node
It is written for Windows + PowerShell because that is the environment this repo is currently using.
The local stack is:
proxy: AuthSec login, session handling, user identity injection, OpenClaw HTTP and WebSocket proxyingopenclaw: OpenClaw gateway in Dockerrun-openclaw-node.ps1: helper to connect your Windows machine as a node
The gateway is exposed only on loopback for node pairing:
- proxy UI:
http://localhost:8080 - gateway loopback:
ws://127.0.0.1:18789
- Docker Desktop
- PowerShell
- Node.js + npm
- An AuthSec application and working AuthSec credentials
- At least one LLM provider key for OpenClaw
Optional:
- Discord bot token
- Brave Search API key if you want the search tool instead of just browser automation
Open deploy/docker-compose/.env and set the values for your environment.
Minimum fields to review:
OPENCLAW_GATEWAY_TOKEN=<random-token>
PROXY_PUBLIC_BASE_URL=http://localhost:8080
SESSION_HMAC_SECRET=<random-secret>
SESSION_SECURE_COOKIE=false
AUTHSEC_MODE=authsec
AUTHSEC_ISSUER_URL=https://oauth.prod.authsec.ai
AUTHSEC_CLIENT_ID=<your-authsec-client-id>
AUTHSEC_CLIENT_SECRET=<your-authsec-client-secret>
AUTHSEC_ADMIN_EMAIL=<your-email>
AUTHSEC_JWT_SECRET=<native-authsec-secret>
AUTHSEC_BASE_URL=https://prod.api.authsec.ai
AUTHSEC_LOGIN_URL=https://oauth.prod.authsec.ai/oauth2/auth
OPENAI_API_KEY=<optional>
ANTHROPIC_API_KEY=<optional>
OPENCLAW_MODEL=openai/gpt-4oNotes:
PROXY_PUBLIC_BASE_URLshould stayhttp://localhost:8080for the local flow.SESSION_SECURE_COOKIE=falseis correct for local HTTP.- Keep real secrets out of Git.
The active OpenClaw config is deploy/docker-compose/openclaw-config/openclaw.json.
Important current behavior:
- gateway auth mode is
token - local Control UI is allowed on
http://localhost - device auth is relaxed for localhost development
tools.execdefaults to the Windows node namedRitamKrKundu
If you want Discord enabled, set the bot token in channels.discord.token.
If you want a different default node name for local exec, update:
"tools": {
"exec": {
"host": "node",
"node": "RitamKrKundu"
}
}From deploy/docker-compose:
docker compose up -d --buildIf you only need to refresh the two main services later:
docker compose up -d --build --force-recreate openclaw proxyCheck logs:
docker compose logs -f openclaw proxyOpen:
http://localhost:8080
Then:
- Sign in with AuthSec.
- Wait for the OpenClaw Control UI to load.
- Ask
who am I?
Expected result:
- OpenClaw should answer with your authenticated email and user ID.
That identity comes from the proxy writing user context into the shared workspace before the request reaches OpenClaw.
The Docker gateway can proxy chat by itself, but it cannot launch Windows apps like Notepad, Teams, or Explorer directly. For that, your Windows machine must be connected as an OpenClaw node.
Install the OpenClaw CLI once:
npm install -g openclaw@latestFrom the repo root, start the node host:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode runIf this is the first time, it may print pairing required.
If pairing is required, use another terminal and approve it from the gateway container.
List pending requests:
docker exec openclaw-gateway sh -lc "node /app/openclaw.mjs devices list --json"Approve the request:
docker exec openclaw-gateway sh -lc "node /app/openclaw.mjs devices approve <request-id> --json"Then rerun:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode runKeep that terminal open. The node must stay running to keep Windows local-machine access available.
Check node status:
openclaw.cmd nodes statusExpected result:
Known: 1Paired: 1Connected: 1
Even after the node connects, OpenClaw may still deny Windows commands until the node-side exec approvals are opened up for this single-user setup.
From the repo root:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode unlock
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode statusThe helper:
- writes a permissive local
~/.openclaw/exec-approvals.json - pushes the same policy live to the connected node
- sets
security=full - sets
ask=off - sets
askFallback=full
If you still see SYSTEM_RUN_DENIED: approval required, run -Mode unlock again while the node is connected.
Once AuthSec login, node connection, and unlock are all done, these are good tests:
Identity:
who am I?
Windows apps:
Open Notepad on node RitamKrKunduOpen my Downloads folder on node RitamKrKunduOpen the file C:\Users\<you>\Downloads\test.txt on node RitamKrKundu
Browser:
Use the browser on node RitamKrKundu and open https://authsec.ai
Discord:
Read the last 5 messages from #generalSend a message to channel:123456789012345678
The Discord plugin can be enabled in deploy/docker-compose/openclaw-config/openclaw.json.
Important:
- a connected Discord bot is not enough by itself
- OpenClaw needs a real target for reads and sends
- a server or guild name alone is not a valid read target
Use:
#channel-namechannel:<channel-id>user:<user-id>
Do not expect:
- only the guild name, for example
Ritam Server
Browser automation:
- can work through the OpenClaw browser tool or the connected node/browser capability
- does not require a search API key
Search tool:
- is different from browser automation
- needs a configured provider such as Brave Search
If you want Brave Search too, configure the appropriate key in OpenClaw's web tool settings.
Check:
- AuthSec login completed successfully
- proxy logs show
user context written - the proxy was rebuilt after the identity changes
Useful command:
docker compose logs -f proxyYour Windows node is not connected right now.
Run:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode run
openclaw.cmd nodes statusThe node is connected, but its exec approvals are still restrictive.
Run:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode unlockThis usually means one of these:
- the node process is not currently running
- the node was connected but got stuck
- the command tried to launch through the wrong host before defaults refreshed
Try:
openclaw.cmd nodes status
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode run
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode unlockUse a channel or user target:
#generalchannel:<id>user:<id>
Remember:
- Docker cannot launch Windows GUI apps by itself
/host-homeis only a mounted folder- real GUI app launch must go through the connected Windows node
From deploy/docker-compose:
docker compose up -d --build --force-recreate openclaw proxy
docker compose logs -f openclaw proxy
docker compose downFrom the repo root:
go test ./internal/proxy ./internal/authThe current local setup is intentionally relaxed so http://localhost:8080 works during development:
- insecure localhost Control UI auth is enabled
- device auth is disabled for localhost
- node exec is opened up for a single trusted operator
That is fine for local testing on your own machine.
Before exposing this publicly over HTTPS, you should:
- re-enable normal device auth
- remove insecure localhost-only shortcuts
- review token and provider-key handling
- rethink whether unrestricted node exec belongs on the same gateway
本操作手册适用于本仓库当前正常运行的配置:
- AuthSec SSO 位于 OpenClaw 前面
- OpenClaw 网关在 Docker 中运行
- 通过代理在
http://localhost:8080进行浏览器访问 - 可选的 Discord 插件
- 通过已配对的 OpenClaw 节点进行 Windows 本机访问
本文档为 Windows + PowerShell 环境编写,因为这是本仓库当前使用的环境。
本地栈包含:
proxy:AuthSec 登录、会话处理、用户身份注入、OpenClaw HTTP 和 WebSocket 代理openclaw:Docker 中的 OpenClaw 网关run-openclaw-node.ps1:将你的 Windows 机器作为节点连接的辅助脚本
网关仅在回环地址上暴露,用于节点配对:
- 代理 UI:
http://localhost:8080 - 网关回环:
ws://127.0.0.1:18789
- Docker Desktop
- PowerShell
- Node.js + npm
- 一个 AuthSec 应用程序和有效的 AuthSec 凭据
- 至少一个用于 OpenClaw 的 LLM 提供商密钥
可选:
- Discord 机器人令牌
- 如果你想使用搜索工具而非仅浏览器自动化,需要 Brave Search API 密钥
打开 deploy/docker-compose/.env 并为你的环境设置相应的值。
至少需要检查以下字段:
OPENCLAW_GATEWAY_TOKEN=<random-token>
PROXY_PUBLIC_BASE_URL=http://localhost:8080
SESSION_HMAC_SECRET=<random-secret>
SESSION_SECURE_COOKIE=false
AUTHSEC_MODE=authsec
AUTHSEC_ISSUER_URL=https://oauth.prod.authsec.ai
AUTHSEC_CLIENT_ID=<your-authsec-client-id>
AUTHSEC_CLIENT_SECRET=<your-authsec-client-secret>
AUTHSEC_ADMIN_EMAIL=<your-email>
AUTHSEC_JWT_SECRET=<native-authsec-secret>
AUTHSEC_BASE_URL=https://prod.api.authsec.ai
AUTHSEC_LOGIN_URL=https://oauth.prod.authsec.ai/oauth2/auth
OPENAI_API_KEY=<optional>
ANTHROPIC_API_KEY=<optional>
OPENCLAW_MODEL=openai/gpt-4o说明:
- 本地流程中
PROXY_PUBLIC_BASE_URL应保持为http://localhost:8080。 SESSION_SECURE_COOKIE=false对于本地 HTTP 是正确的。- 不要将真实密钥提交到 Git。
当前生效的 OpenClaw 配置位于 deploy/docker-compose/openclaw-config/openclaw.json。
当前重要行为:
- 网关认证模式为
token - 本地 Control UI 允许在
http://localhost上访问 - 设备认证对 localhost 开发已放宽
tools.exec默认使用名为RitamKrKundu的 Windows 节点
如需启用 Discord,在 channels.discord.token 中设置机器人令牌。
如需更改本地执行的默认节点名称,请更新:
"tools": {
"exec": {
"host": "node",
"node": "RitamKrKundu"
}
}在 deploy/docker-compose 目录下:
docker compose up -d --build如果之后只需刷新两个主要服务:
docker compose up -d --build --force-recreate openclaw proxy查看日志:
docker compose logs -f openclaw proxy打开:
http://localhost:8080
然后:
- 使用 AuthSec 登录。
- 等待 OpenClaw Control UI 加载完成。
- 询问
who am I?
预期结果:
- OpenClaw 应回答你已认证的邮箱和用户 ID。
该身份来自代理在请求到达 OpenClaw 之前将用户上下文写入共享工作区。
Docker 网关本身可以代理聊天,但无法直接启动 Notepad、Teams 或 Explorer 等 Windows 应用。为此,你的 Windows 机器必须作为 OpenClaw 节点连接。
安装一次 OpenClaw CLI:
npm install -g openclaw@latest在仓库根目录启动节点主机:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode run如果是第一次运行,可能会打印 pairing required。
如果需要配对,使用另一个终端从网关容器中批准。
列出待处理的请求:
docker exec openclaw-gateway sh -lc "node /app/openclaw.mjs devices list --json"批准请求:
docker exec openclaw-gateway sh -lc "node /app/openclaw.mjs devices approve <request-id> --json"然后重新运行:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode run保持该终端处于打开状态。节点必须持续运行才能保持 Windows 本机访问可用。
检查节点状态:
openclaw.cmd nodes status预期结果:
Known: 1Paired: 1Connected: 1
即使节点连接成功,OpenClaw 仍可能拒绝 Windows 命令,直到为这个单用户设置打开节点端的执行审批。
在仓库根目录执行:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode unlock
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode status该辅助脚本会:
- 写入一个宽松的本地
~/.openclaw/exec-approvals.json - 将相同策略实时推送到已连接的节点
- 设置
security=full - 设置
ask=off - 设置
askFallback=full
如果仍然看到 SYSTEM_RUN_DENIED: approval required,请在节点已连接时再次运行 -Mode unlock。
完成 AuthSec 登录、节点连接和解锁后,以下是一些好的测试:
身份验证:
who am I?
Windows 应用:
Open Notepad on node RitamKrKunduOpen my Downloads folder on node RitamKrKunduOpen the file C:\Users\<you>\Downloads\test.txt on node RitamKrKundu
浏览器:
Use the browser on node RitamKrKundu and open https://authsec.ai
Discord:
Read the last 5 messages from #generalSend a message to channel:123456789012345678
Discord 插件可以在 deploy/docker-compose/openclaw-config/openclaw.json 中启用。
重要说明:
- 仅仅连接 Discord 机器人本身是不够的
- OpenClaw 需要一个真实的读取和发送目标
- 单独的服务器或公会名称不是有效的读取目标
使用:
#channel-namechannel:<channel-id>user:<user-id>
不要期望:
- 仅使用公会名称,例如
Ritam Server
浏览器自动化:
- 可以通过 OpenClaw 浏览器工具或已连接的节点/浏览器能力实现
- 不需要搜索 API 密钥
搜索工具:
- 与浏览器自动化不同
- 需要配置 Brave Search 等提供商
如果还需要 Brave Search,请在 OpenClaw 的网络工具设置中配置相应的密钥。
检查:
- AuthSec 登录是否成功完成
- 代理日志中是否显示
user context written - 身份更改后代理是否已重新构建
有用的命令:
docker compose logs -f proxy你的 Windows 节点当前未连接。
运行:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode run
openclaw.cmd nodes status节点已连接,但其执行审批仍然受限。
运行:
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode unlock这通常意味着以下情况之一:
- 节点进程当前未在运行
- 节点已连接但卡住了
- 命令在默认值刷新前尝试通过错误的主机启动
尝试:
openclaw.cmd nodes status
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode run
powershell -ExecutionPolicy Bypass -File deploy/docker-compose/run-openclaw-node.ps1 -Mode unlock使用频道或用户目标:
#generalchannel:<id>user:<id>
请记住:
- Docker 本身无法启动 Windows GUI 应用
/host-home只是一个挂载的文件夹- 真正的 GUI 应用启动必须通过已连接的 Windows 节点进行
在 deploy/docker-compose 目录下:
docker compose up -d --build --force-recreate openclaw proxy
docker compose logs -f openclaw proxy
docker compose down在仓库根目录下:
go test ./internal/proxy ./internal/auth当前本地设置有意放宽,以便在开发期间 http://localhost:8080 能够正常工作:
- 已启用不安全的 localhost Control UI 认证
- localhost 的设备认证已禁用
- 为单个受信任的操作员开放了节点执行权限
这对于在你自己机器上进行本地测试来说是可以的。
在通过 HTTPS 公开暴露之前,你应该:
- 重新启用正常的设备认证
- 删除不安全的仅 localhost 快捷方式
- 检查令牌和提供商密钥的处理方式
- 重新考虑是否应在同一网关上保留不受限制的节点执行权限