{
  "title": "Update only one agent's containers",
  "content": "openclaw sandbox recreate --agent alfred\njsonc theme={null}\n{\n  \"agents\": {\n    \"defaults\": {\n      \"sandbox\": {\n        \"mode\": \"all\", // off, non-main, all\n        \"scope\": \"agent\", // session, agent, shared\n        \"docker\": {\n          \"image\": \"openclaw-sandbox:bookworm-slim\",\n          \"containerPrefix\": \"openclaw-sbx-\",\n          // ... more Docker options\n        },\n        \"prune\": {\n          \"idleHours\": 24, // Auto-prune after 24h idle\n          \"maxAgeDays\": 7, // Auto-prune after 7 days\n        },\n      },\n    },\n  },\n}\n```\n\n* [Sandbox Documentation](/gateway/sandboxing)\n* [Agent Configuration](/concepts/agent-workspace)\n* [Doctor Command](/gateway/doctor) - Check sandbox setup",
  "code_samples": [
    {
      "code": "## Why is this needed?\n\n**Problem:** When you update sandbox Docker images or configuration:\n\n* Existing containers continue running with old settings\n* Containers are only pruned after 24h of inactivity\n* Regularly-used agents keep old containers running indefinitely\n\n**Solution:** Use `openclaw sandbox recreate` to force removal of old containers. They'll be recreated automatically with current settings when next needed.\n\nTip: prefer `openclaw sandbox recreate` over manual `docker rm`. It uses the\nGateway’s container naming and avoids mismatches when scope/session keys change.\n\n## Configuration\n\nSandbox settings live in `~/.openclaw/openclaw.json` under `agents.defaults.sandbox` (per-agent overrides go in `agents.list[].sandbox`):",
      "language": "unknown"
    }
  ],
  "headings": [
    {
      "level": "h2",
      "text": "Why is this needed?",
      "id": "why-is-this-needed?"
    },
    {
      "level": "h2",
      "text": "Configuration",
      "id": "configuration"
    },
    {
      "level": "h2",
      "text": "See Also",
      "id": "see-also"
    }
  ],
  "url": "llms-txt#update-only-one-agent's-containers",
  "links": []
}