Capabilities
Authentication
The API is gated byGATEWAY_AUTH_TOKEN — a pre-shared secret between the UI and gateway. Generate it with openssl rand -hex 32.
Safety
- Path traversal is rejected via
safe_join()— requests can’t escape the agent’s worktree. - After a successful write, the UI automatically enqueues an
updatecommand so OpenClaw reloads the agent with the changed files.
Source connector endpoints
The files API also serves as the bridge for source connector operations. The UI proxies these requests to the gateway so that provider-specific API calls (validate credentials, browse content) happen on the gateway side, keeping credentials local.
The validate endpoint accepts raw credentials (they haven’t been stored yet at validation time). The browse endpoint takes a
connection_id — the gateway resolves credentials from its encrypted secrets .env file, which is more secure than passing decrypted credentials over the network.
Both endpoints use the connector registry (gateway/connectors/registry.py) to dynamically load the appropriate provider connector.

