---
url: /reference/lockfile.md
---
# pandra.lock

`pandra.lock` sits beside `pandra.toml` and records what every external source in the definition resolved to: the Git revision, the digest of the content, and for an MCP Registry server, the version and the entry it fetched. Builds use these pins and verify every digest, so the same project builds the same package on every machine. Commit it with `pandra.toml`; the CLI writes it, and nobody edits it by hand. How to update it is in [locking and building](/build/packages.md#the-lockfile).

## An example

A definition with a base, a plugin, a skill and instructions from Git, the prompt, and an MCP Registry server locks to:

```toml
version = 1

[base]
oci = "ghcr.io/acme/reviewer:1.3.0"
digest = "sha256:968964bd36f1..."

[[plugin]]
name = "superpowers"
version = "7.0.2"
git = "https://github.com/obra/superpowers"
tag = "v7.0.2"
ref = "refs/tags/v7.0.2"
revision = "f1df2795c385f35a2d4205985e129d49e2b645cc"
skills = [
  { name = "brainstorming", digest = "sha256:97b2acc8303e..." },
  { name = "test-driven-development", digest = "sha256:969567b17f8a..." },
]

[[skill]]
name = "lint"
git = "https://github.com/acme/skills"
path = "skills/lint"
tag = "v1"
revision = "8879afad0ea7ec84d25e9f71a2025392b7aa3171"
digest = "sha256:78b2c73e37ec..."

[[instructions]]
index = 1
git = "https://github.com/acme/shared-prompts"
path = "review-base.md"
tag = "v2.0.0"
revision = "416c0682ee87d5e9e8f3799700c43491718dd98c"
digest = "sha256:2fb177ecd936..."

[prompt]
git = "https://github.com/acme/shared-prompts"
path = "initial.md"
tag = "v2.0.0"
revision = "416c0682ee87d5e9e8f3799700c43491718dd98c"
digest = "sha256:8be8d92b0aa3..."

[[mcp-server]]
name = "github"
registry = "io.github.github/github-mcp-server"
version = "1.4.0"
registry-url = "https://registry.modelcontextprotocol.io"
digest = "sha256:7dac763ded82..."
method = "remote:https://api.githubcopilot.com/mcp/"
```

Digests are shortened here; the file holds all 64 hexadecimal digits. The entries come in this order, and `version = 1` is the version of the lockfile format, not of the agent. The instructions have `index = 1` because the first `[[instructions]]` entry of this definition is a local file, which the lockfile does not record.

## Entries

Each entry repeats the source keys of its component in `pandra.toml`, such as `git`, `path`, and `tag`, and adds what they resolved to. An entry is matched to its component as the table shows:

| Entry | Matched by | Records |
| --- | --- | --- |
| `[base]` | The single `[base]` table | The `digest` of the base's package, and for a `git` base the `revision`. A `path` base is local and has no entry. |
| `[[plugin]]` | `name`, the key of its table in `pandra.toml` | The Git `revision` and the full name of the ref it was resolved from in `ref` (`refs/heads/main` for a plugin added without a ref whose repository's default branch is `main`, none for a `rev`), the plugin's `version` when it has one (what its manifest says at that revision, shown only, it never chooses a revision), and in `skills` the name and directory digest of every skill the plugin has at that revision, those the definition excludes included. |
| `[[skill]]` | `name` | The Git `revision` and the `digest` of the skill's directory. |
| `[[instructions]]` | `index`, its position in the definition's `[[instructions]]` list, starting at 0, with its source | The Git `revision` and the `digest` of the file. |
| `[prompt]` | The single prompt | The same as instructions. |
| `[[mcp-server]]` | `name` | For an MCP Registry server: its `registry` name, `version`, `registry-url`, the `digest` of its MCP Registry entry, and the author's chosen execution `method`. |

An HTTPS source records its `url`, `path`, and `digest` and no `revision`. A local source, an inline `text`, and an MCP server that is not an MCP Registry entry have no entry.

## Digests

* A file's digest is the SHA-256 of its bytes.
* A directory's digest is the SHA-256 of its uncompressed deterministic tar archive, built as a package's archives are (see [agent package](/reference/agent-package.md#how-the-digest-is-made)).
* An MCP Registry entry's digest is the SHA-256 of the `server` object the MCP Registry returned, serialized with JSON Canonicalization (RFC 8785). The package stores that entry.

A build that finds content whose digest differs from the lockfile fails; it never falls back to newer content.

## When it is stale

The lockfile is stale when an external source in `pandra.toml` differs from its entry, or when an entry has no counterpart. Both sides are compared after normalization: defaults are filled in, such as the MCP Registry URL, short method names are expanded, and Git URLs are normalized, so spelling a source differently does not make the lockfile stale. Local files never make it stale, and neither do the `exclude-` keys of a base or a plugin, which are applied at build time.

A stale lockfile, or a missing one when the definition has external sources, fails `run`, `build`, `sync`, `push`, and `pull` of a Git project with what changed and the command that fixes it. `pandra lock --check` reports the same without changing anything or using the network, for CI.

## What it does not record

* Local sources: files and directories inside the project are read when the package is built.
* Harness versions, which are your choice when you run the agent, not part of the agent.
* Anything from your configuration.

## Commands that change it

`pandra add`, `pandra remove`, and `pandra lock` bring the whole lockfile up to date, keeping existing pins; `pandra lock --upgrade` and `--lock-update` on `run`, `build`, `sync`, and `push` are in [locking and building](/build/packages.md#the-lockfile). No other command changes it.
