examples/integrations/docker-sandbox-kit. Clone it (or copy the cognee-memory/ directory) and point --kit at it.
Verified end-to-end with sbx v0.39.0 under a
deny-all network policy. The kit does not declare a minimum sbx version.What the kit does
cognee-memory/spec.yaml is a stackable mixin kit (schemaVersion: "2", kind: mixin) that:
- installs the CLI with
uv tool install cogneeat sandbox creation — this assumesuvis present in the base image, which Docker’s default sandbox images ship; - pins all memory state to
/home/agent/.cognee(DATA_ROOT_DIRECTORY=/home/agent/.cognee/data,SYSTEM_ROOT_DIRECTORY=/home/agent/.cognee/system), so memory survives sandbox restarts and is easy to inspect or back up; - defaults to
LLM_MODEL=openai/gpt-5-miniand setsTELEMETRY_DISABLED=1; - pins
ENABLE_BACKEND_ACCESS_CONTROL=true— cognee’s default, made explicit so the kit’s multi-agent behavior is unambiguous: multi-tenant ACLs and per-user+dataset database isolation; - declares a proxy-managed OpenAI credential so the real key never enters the sandbox VM;
- allowlists only the domains cognee actually needs under
deny-all; - appends usage instructions to the agent’s memory file (
kits-memory/cognee-memory.md): recall at task start → work → remember durable learnings, plus the multi-agent handover pattern.
claude, shell, opencode, and so on.
Prerequisites
Install and startsbx, then set the baseline policy and the OpenAI secret. The install line below is macOS/Homebrew; use whatever install path sbx documents for your platform.
set-custom prints a placeholder (sbx-cs-…, retrievable later with sbx secret ls). Sandboxes only ever see the placeholder; the proxy substitutes the real key on requests to api.openai.com.
The cognee-openai credential
The kit declares its credential service as cognee-openai, not openai:
shell, claude, …) already declare the common LLM services, and composition fails when two kits define the same service. required: false means sandbox creation is never blocked when no key is bound.
There are two ways to supply the key, both proxy-side:
- Bind the service — interactively at run time, or via
~/.config/sbx/credentials.yaml. The agent seesLLM_API_KEY=proxy-managedand theinjectrule rewrites theAuthorizationheader forapi.openai.com. - Headless —
sbx secret set-custom --host api.openai.com --env LLM_API_KEY --value <key>, as in the prerequisites above.
Network allowlist
Underdeny-all, the kit’s allowlist is the sandbox’s only egress. Each domain was discovered by running under the deny-all policy and reading sbx policy log — the recommended way to derive a kit allowlist:
Single-agent usage
The first
remember builds a knowledge graph with a few LLM calls, so it takes noticeably longer than a plain key-value write; recall then answers from the graph.
To use a provider other than OpenAI, edit environment.variables, the credentials and permissions.network blocks, and the stored secret to match — see LLM providers.
Multi-agent demo: supervisor to worker handover
demo/handover.sh runs a round-trip memory handover between two real sandboxes, cognee-supervisor and cognee-worker, both created from this kit and sharing the demo/ directory as their workspace. The supervisor and worker are separate cognee users, so ACLs gate what each one can read and write.
1
brief — supervisor sandbox
Stores a private note (dataset The creator automatically holds
supervisor_private) and a handover briefing (dataset handover) in its own datasets, grants the worker read and write on the briefing, and writes a handover token to demo/handover-out/handover_token.json carrying the briefing’s dataset UUID.share, so no extra grant is needed to hand access over.2
work — worker sandbox
Redeems the token by UUID, proves the two boundaries, then writes its completion report back into the shared dataset:Negative checks: recalling the supervisor’s private dataset raises
PermissionDeniedError, and recalling the shared dataset by name (datasets=["handover"]) fails to resolve.3
review — supervisor sandbox
Recalls the worker’s report from the shared dataset.
Share by UUID, never by name. Dataset names are namespaced per user — a name maps to
uuid5(name + user.id + tenant_id) — so a name never crosses a user boundary. The dataset UUID is the only cross-user address, for reads and for cross-owner writes alike.cognee-cli has no user or permission commands, so the multi-agent pattern requires the SDK (create_user, get_datasets, authorized_give_permission_on_datasets). On a fresh install, call create_db_and_tables() before touching users or ACLs — the CLI does this implicitly, the raw SDK path does not.
The payload, demo/supervisor_worker_handover.py, is self-contained: drop it into any repository with cognee installed and run python supervisor_worker_handover.py to execute all phases in one process, or --phase brief|work|review to split them across environments.
Clean up with:
How the memory snapshot moves
Embedded LanceDB cannot operate on the shared virtiofs workspace mount. The demo works around this by running cognee state on each VM’s local disk during a phase and handing it between sandboxes as a snapshot withsbx cp — the host keeps the canonical copy in demo/cognee-state/ between phases:
chown step is required because sbx cp preserves the host uid. Phases run sequentially — the snapshot moves, it is never shared live.
Backends that support user permissioning
Permissions areread / write / delete / share per dataset. The kit’s defaults — Ladybug/Kuzu for the graph, LanceDB for vectors — support per-user+dataset database isolation, as do Neo4j (including the neo4j_community container-per-dataset handler), Postgres (demo), Turso, and PGVector. Neptune, Neptune Analytics, ladybug-remote, and community vector adapters that do not register a dataset-database handler are not supported — see the permissions system for how users, datasets, and ACLs fit together.
Inspecting memory and security
demo/cognee-state/system/databases/cognee_db, SQLite) holds users, datasets, and the ACL rows. After the demo, the worker holds exactly two grants — read and write — on the shared dataset, and nothing on the private one.
Kit source
spec.yaml, the handover demo, and the READMEDocker Sandboxes kits
Docker’s documentation for authoring kits