Skip to content

Security: r/morph

Security

docs/SECURITY.md

Security and privacy

Morph records agent sessions. A recorded session contains what the agent was told, what it said, and what its tools read and returned. This document says what is recorded, where it is stored, what git push and morph push carry, and how to remove something.

What is recorded

Each agent session is stored as a Run (metadata and pointers) and a Trace (the event log). A trace holds:

  • The prompts you sent, in full.
  • The agent's reply text, in full.
  • Every tool call: tool name and input. Shell commands are tool calls.
  • Every tool result: file contents the agent read, command output, search results.
  • The model id, the agent version and token counts.

Limits of the Claude Code capture (morph capture claude-code):

  • A tool input or tool result larger than 16 KiB is cut to 16 KiB. The event is marked truncated: true and records the original size. Prompts and reply text are never cut.
  • The model's thinking blocks are never recorded. Images are not recorded either.

Truncation is a size limit, not redaction. Morph does not scan for secrets and does not redact. If the agent read your .env, the first 16 KiB of it are in the trace. If a command printed a token, the token is in the trace. If you pasted production data into a prompt, it is in the trace.

A Morph commit also stores a snapshot of the file tree, the metrics attached to it, and evidence_refs: the hashes of the Runs and Traces behind it.

If something must not be recorded, do not show it to an agent that Morph is recording.

Where it is stored

your-project/
  .git/
  .morph/
    objects/            # every object, by hash
    runs/ traces/ prompts/ ...   # per-type indexes; these hold copies
    refs/               # branches, tags, remote-tracking refs
    config.json         # policy, submode, instance id
    hooks/sessions/     # capture cursors: how far each transcript was read
    hooks/logs/         # capture.log
    forgotten/          # markers left by `morph forget`
  • .morph/ is never tracked by git. morph init adds it to .git/info/exclude.
  • .morph/ is plain JSON and is not encrypted. Any process running as you can read it, and so can anyone with a backup of the directory. The agent's own transcripts have the same exposure. Use disk encryption if you need encryption at rest.
  • The Claude Code hooks are written to .claude/settings.local.json by default, which is kept out of git. --scope project writes them to .claude/settings.json, which teammates receive.

What crosses the wire

git push: code only

.morph/ is not tracked, so git push cannot carry runs, traces or prompts. A teammate's git pull gives them ordinary git commits.

morph push: opt-in, a separate remote

morph remote add team you@server:repos/project.morph
morph push team main

No Morph remote exists until you add one. morph push <remote> <branch> sends everything reachable from the branch tip:

  • the commits and their file tree snapshots (so the remote holds the code as well),
  • pipelines and eval suites,
  • every Run and Trace named in a commit's evidence_refs.

A session that no commit on the branch references is not sent. There is no filter: a session attached to a commit on the branch goes with it. To keep a trace off the remote, morph forget it before you push.

morph fetch and morph pull

morph fetch <remote> downloads every branch on the remote with the same closure. A teammate can then run morph inspect show <hash> and read your prompts, replies and tool output.

Recommended team setup

  1. Code goes through your existing git remote.
  2. Sessions go through a separate Morph remote. Give access only to people you would let read your editor history.
  3. Agree on what gets pushed. If your traces often contain customer data or credentials, do not push automatically.
  4. Protect the Morph remote at least as well as your secrets manager.

morph forget

morph forget <hash> permanently removes a Run, a Trace or a prompt Blob from the local store. Use it when a session captured a credential, a sensitive file, or data you are obliged to delete.

Forget removes one object. The text of a session is in its Trace. Forgetting only the Run leaves the Trace, and the text, in the store. morph session show <run-hash> prints the trace hash. A session recorded with morph session record also has a prompt blob that holds the prompt and response; forget that too.

What it does:

  1. Deletes the object and its copies in the per-type indexes.
  2. Writes a Tombstone object (who, when, why) and a marker in .morph/forgotten/. The bytes are gone; the record of the deletion stays.
  3. With --remote <name>, reminds you to push. The next successful morph push <name> <branch> sends the tombstone. The remote then deletes its copy, and each teammate's next morph fetch deletes theirs.

A commit whose evidence_refs names a forgotten hash stays valid. The merge gate reads that reference as "no claim" and prints a warning.

What it refuses:

  • Any other kind of object (commits, trees, file blobs, pipelines, eval suites, artifacts, trace rollups, annotations).
  • A hash named in a commit's evidence_refs, unless you pass --force. It lists the commits first.
  • A non-interactive call without --yes. Interactively you type forget to confirm. --dry-run shows the plan and deletes nothing.

What it does not do:

  • Reach copies already fetched. A teammate who fetched the trace keeps it until their next morph fetch applies the tombstone. Backups and machines that never fetch again keep it.
  • Travel over SSH. Tombstones propagate to Morph remotes addressed by filesystem path. A push to an SSH remote skips them with a warning. For an SSH remote, log in to the server and run morph forget there as well.
  • Edit a trace. Forget is whole-object. You cannot remove one line.
  • Run through MCP. It is a CLI command only.

morph gc is not a way to delete sessions. It removes unreachable commits, trees, file blobs, pipelines and artifacts, and it never deletes runs, traces, prompts or annotations.

If a secret leaked into a trace

# 1. find the session and its trace
morph session list
morph session show <run-hash> --with-trace     # prints the trace hash

# 2. forget the trace (and the run, if you want the record gone)
morph forget <trace-hash> --remote team --reason "leaked db password; rotated"
morph forget <run-hash>   --remote team --reason "leaked db password; rotated"

# 3. send the tombstones (filesystem remotes only; see above for SSH)
morph push team main

# 4. rotate the secret

Step 4 is the one that protects you. Once a credential has been shared, deleting it is not enough.

What Morph does not do

  • No redaction or secret scanning, at record time or at push time.
  • No selective fetch. morph fetch downloads full branches, traces included.
  • No encryption at rest.
  • No transport security of its own. An SSH remote has OpenSSH's; a filesystem remote has that filesystem's permissions.
  • No tombstones over SSH.

Before you share traces with a team

  1. Is the Morph remote separate from the git remote, with tighter access?
  2. Have you looked at the sessions on the commits you are about to push? morph show <commit> lists them; morph inspect show <hash> prints one.
  3. Do you accept that prompts, replies and tool output in those traces will be on every teammate's machine after morph fetch?
  4. When someone leaves the project, their fetched copy stays with them. morph forget cannot recall it.

If you cannot answer these, keep the Morph remote private to yourself.

See also

There aren't any published security advisories