Memory and workspace
Memory
Luna keeps memory at three layers, selected by configuration:
| Backend | What it is | When to use it |
|---|---|---|
file | Human-readable files with fsync’d tmp→rename writes and an in-lock dirty-set overlay | Small, inspectable memory; air-gap |
vector | Embedding-backed semantic retrieval | Large corpora, semantic search |
hybrid | File + vector with union/tombstone semantics | Best recall with durable files |
Memory is scoped by principal and namespace. Plugin memory is scoped plugin:<Plugin>:<UserUuid>:<Key>. A source tag and untrusted-content fences are applied before extracted memory is reused, and injection scans run on the way in.
What to know
Vector timeouts are bounded (not 5000 seconds); a slow embedding provider cannot wedge the worker.
The JSON/file backends take a lock and re-read before write; a torn tail is healed with a checked rename.
A corrupt blob becomes a typed placeholder, never an error that kills the agent.
Memory decay emits a real event; retention is documented per backend.
Workspace
The workspace is the only filesystem surface a task may touch by default.
Server-derived scope. The dispatcher strips client-supplied workspace_root and tenant_id, then roots the task at <workspace_root>/users/<server-scope>/. The scope is derived from the authenticated user_uuid, not a request field.
HTTP workspace API uses the same rule: a non-admin caller is rooted at its own subtree; an admin may cross.
Symlink escape refusal. Paths are canonicalized; a symlink that escapes the root is refused.
Read/write caps. A workspace read is size-capped (10 MB), and writes are gated by the workspace:write class.
.luna secrets are denied to the sandbox except for the explicit secret subset; the deny is anchored and tested.
Next
Sessions and chat Permissions and sandbox Memory API Workspace API