> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandboxing and memory

## Sandboxing and memory

> **Is there a dedicated sandboxing doc?**
>
> Yes: [Sandboxing](https://docs2.openclaw.ai/gateway/sandboxing.md). For Docker-specific setup (full gateway in Docker or sandbox images), see [Docker](https://docs2.openclaw.ai/install/docker.md).

> **Docker feels limited - how do I enable full features?**
>
> The default image is security-first and runs as the `node` user, so it excludes system packages, Homebrew, and bundled browsers. For a fuller setup:
>
> * Persist `/home/node` with `OPENCLAW_HOME_VOLUME` so caches survive.
> * Bake system deps into the image with `OPENCLAW_IMAGE_APT_PACKAGES`.
> * Bake Playwright Chromium and its system dependencies into the image with `OPENCLAW_INSTALL_BROWSER=1`.
>
> Docs: [Docker](https://docs2.openclaw.ai/install/docker.md), [Browser](https://docs2.openclaw.ai/tools/browser.md).

> **Can I keep DMs personal but make groups public/sandboxed with one agent?**
>
> Yes, if private traffic is **DMs** and public traffic is **groups**. Set `agents.defaults.sandbox.mode: "non-main"` so group/channel sessions (non-main keys) run in the configured sandbox backend while the main DM session stays on-host. Select `backend: "docker"` for Docker or `backend: "podman"` for Podman. Restrict tools available in sandboxed sessions via `tools.sandbox.tools`.
>
> Setup walkthrough: [Groups: personal DMs + public groups](https://docs2.openclaw.ai/channels/groups.md#pattern-personal-dms-public-groups-single-agent). Key reference: [Gateway configuration](https://docs2.openclaw.ai/gateway/config-agents/sandbox.md#agentsdefaultssandbox).

> **How do I bind a host folder into the sandbox?**
>
> Set `agents.defaults.sandbox.docker.binds` to `["host:container:mode"]` (for example `"/home/user/src:/src:ro"`). Global and per-agent binds merge; per-agent binds are ignored when `scope: "shared"`. Use `:ro` for anything sensitive; binds bypass the sandbox filesystem walls.
>
> OpenClaw validates bind sources against both the normalized path and the canonical path resolved through the deepest existing ancestor, so symlink-parent escapes fail closed even when the final path segment does not exist yet.
>
> See [Sandboxing](https://docs2.openclaw.ai/gateway/sandboxing.md#multiple-folders-for-one-agent) and [Sandbox vs Tool Policy vs Elevated](https://docs2.openclaw.ai/gateway/sandbox-vs-tool-policy-vs-elevated.md#bind-mounts-security-quick-check).

> **How does memory work?**
>
> OpenClaw memory is Markdown files in the agent workspace: daily notes in `memory/YYYY-MM-DD.md`, curated long-term notes in `MEMORY.md` (main/private sessions only).
>
> OpenClaw also runs a silent **pre-compaction memory flush** before compaction summarizes the conversation, reminding the model to write durable notes first. It only runs when the workspace is writable (read-only sandboxes skip it); disable with `agents.defaults.compaction.memoryFlush.enabled: false`. See [Memory](https://docs2.openclaw.ai/concepts/memory.md).

> **Memory keeps forgetting things. How do I make it stick?**
>
> Ask the bot to **write the fact to memory**: long-term notes go in `MEMORY.md`, short-term context in `memory/YYYY-MM-DD.md`. Reminding the model to store memories usually resolves it. If it keeps forgetting, verify the Gateway uses the same workspace on every run.
>
> Docs: [Memory](https://docs2.openclaw.ai/concepts/memory.md), [Agent workspace](https://docs2.openclaw.ai/concepts/agent-workspace.md).

> **Does memory persist forever? What are the limits?**
>
> Memory files live on disk and persist until deleted; the limit is your storage, not the model. **Session context** is still limited by the model context window, so long conversations can compact or truncate - that is why memory search exists, pulling only the relevant parts back into context.
>
> Docs: [Memory](https://docs2.openclaw.ai/concepts/memory.md), [Context](https://docs2.openclaw.ai/concepts/context.md).

> **Does semantic memory search require an OpenAI API key?**
>
> Only if you use **OpenAI embeddings**, which is the default provider. Codex OAuth covers chat/completions and does **not** grant embeddings access, so signing in with Codex (OAuth or the Codex CLI login) does not enable semantic memory search. OpenAI embeddings still need a real API key (`OPENAI_API_KEY` or `models.providers.openai.apiKey`).
>
> To stay local, set `memory.search.provider: "local"` (GGUF/llama.cpp). Other supported providers: Bedrock, DeepInfra, Gemini (`GEMINI_API_KEY` or `memory.search.remote.apiKey`), GitHub Copilot, LM Studio, Mistral, Ollama, OpenAI-compatible, and Voyage. See [Memory](https://docs2.openclaw.ai/concepts/memory.md) and [Memory search](https://docs2.openclaw.ai/concepts/memory-search.md) for setup details.
