---
url: /reference/agent-package.md
---
# Agent package

A package is what Pandra runs: the immutable result of building an agent project with its lockfile. It holds the agent's instructions, prompt, and skills, the definitions of its MCP servers, the environment variables it expects, and a record of where each part came from. How a project, its lockfile, and a package relate, and how to build and inspect packages, is in [locking and building](/build/packages.md).

## What a package is

* **Written by tools only.** `pandra build` produces a package from `pandra.toml` and `pandra.lock`; nobody edits one by hand. To look inside, use `pandra agent inspect` on a local name, a reference, or a package file, with `--json` for the same information as JSON.
* **Self-contained.** Every component's files are copied in at build time, so running a package never resolves a source again. MCP servers are included as definitions, not as server software.
* **Identified by its digest.** The same content gives the same bytes, and so the same digest, whichever conforming tool builds it, apart from the optional Agent Plugins view described below.
* **Free of harness configuration.** A package has no field for a model, a permission mode, or other harness configuration, and it never sets an environment variable or stores a secret. Those come from the user's configuration ([settings of one agent](/configure/agent-settings.md#settings-of-one-agent)). Its instructions are added to the harness's own; only the user can configure them to replace those.
* **Tool-neutral.** The format reuses Agent Skills, the MCP Registry's `server.json` shapes, and OCI, so other tools can produce and read packages.

## The files inside

A package is a directory, stored as a tar archive. For example:

```text
agent.json                       the manifest, the only required file
instructions.md                  the instructions
prompt.md                        the prompt
skills/review/SKILL.md           one directory per skill, with its files
skills/review/scripts/check.sh
mcp/github/server.json           the MCP Registry entry of a registry server
plugin.json                      the Agent Plugins view
mcp.json                         the view's servers, when one can be written with fixed values
LICENSE                          license and notice files
LICENSES/Apache-2.0.txt          license texts named by their identifiers
```

Nothing else may appear at the top level, and `LICENSES/` holds only license texts. A consumer rejects any other entry, so a harness or Agent Plugins client that loads the directory finds no file the producer did not write, such as `.mcp.json` or `hooks/`.

Every entry is a regular file or a directory; links and devices are refused. Paths are relative, without `..`, and two paths that differ only in letter case are refused, so a package unpacks the same way on every file system. The only permission kept is whether a file is executable.

## The manifest

`agent.json` describes the agent. Trimmed and indented for reading:

```json
{
  "$schema": "https://pandra.io/schemas/agent-package/0.1.0.schema.json",
  "authors": ["Acme <oss@acme.example>"],
  "description": "Reviews pull requests for correctness and style",
  "env": {
    "GITHUB_REPOSITORY": {
      "description": "Repository to review, as owner/name",
      "isRequired": true
    }
  },
  "license": "Apache-2.0",
  "mcpServers": { "github": { "...": "see MCP servers below" } },
  "name": "reviewer",
  "namespaces": { "superpowers": ["brainstorming"] },
  "provenance": { "...": "see Provenance below" },
  "repository": "https://github.com/acme/agents",
  "skills": ["brainstorming", "review"],
  "version": "1.2.0"
}
```

| Field | Meaning |
| --- | --- |
| `$schema` | Required. The version of the format ([below](#versions-of-the-format)). |
| `name` | Required. 1 to 64 characters from `a-z`, `0-9`, and `-`, as in `pandra.toml`. |
| `version` | The agent's SemVer version, such as `1.2.0`. |
| `description`, `homepage`, `repository`, `license`, `authors` | Metadata from `pandra.toml`; `license` is an SPDX expression. |
| `skills` | The skill names, sorted, without namespaces. They match the directories under `skills/` and the `name` in each `SKILL.md`. |
| `namespaces` | The skills that came with a plugin, by the plugin's name: `{ "superpowers": ["brainstorming"] }`. A skill that is in none has no namespace. |
| `mcpServers` | The MCP servers, keyed by the name the harness sees ([below](#mcp-servers)). |
| `env` | The environment variables the agent expects ([below](#environment-variable-declarations)). |
| `provenance` | What the package was built from ([below](#provenance)). |
| `extensions` | Tool-specific data under reverse-domain keys, which other tools ignore. Pandra writes none. |

The instructions and the prompt have no field: each is present when its file exists.

The manifest is strict, so every consumer accepts and rejects the same packages. Unknown fields outside `extensions` are refused. It is written in canonical JSON (RFC 8785), with sorted keys and no whitespace, and leaves out values equal to their default, such as `isRequired` unless it is `true` and lists that are empty; an environment variable declaration with no fields is still written, as `{}`. A manifest in any other form is refused, so one content has exactly one manifest.

`pandra schema agent-package` prints the manifest's JSON Schema; some rules, such as the sort orders, are beyond what it can check.

## MCP servers

Each server lists its execution methods and the author's default, and a server from the MCP Registry also names its entry. The `github` server of an agent, trimmed:

```json
{
  "default": "remote:https://api.githubcopilot.com/mcp/",
  "methods": [
    {
      "id": "oci:ghcr.io/github/github-mcp-server",
      "package": {
        "environmentVariables": [
          {
            "description": "Your GitHub personal access token",
            "isRequired": true,
            "isSecret": true,
            "name": "GITHUB_PERSONAL_ACCESS_TOKEN"
          }
        ],
        "identifier": "ghcr.io/github/github-mcp-server",
        "registryType": "oci",
        "transport": { "type": "stdio" },
        "version": "1.4.0"
      }
    },
    {
      "id": "remote:https://api.githubcopilot.com/mcp/",
      "remote": {
        "headers": [
          {
            "description": "Authorization header with authentication token (PAT or App token)",
            "isSecret": true,
            "name": "Authorization"
          }
        ],
        "type": "streamable-http",
        "url": "https://api.githubcopilot.com/mcp/"
      }
    }
  ],
  "registry": {
    "digest": "sha256:7dac763ded82...",
    "name": "io.github.github/github-mcp-server",
    "url": "https://registry.modelcontextprotocol.io",
    "version": "1.4.0"
  },
  "required": true
}
```

The `oci` method is in the manifest and cannot be selected: a secret input in an environment variable of an `oci` package is unsupported, so only the `remote` method can be the default.

* **Methods.** A `package` method runs locally over standard input and output, with `npx` for npm, `uvx` for PyPI, or `docker` for OCI images. A `remote` method connects to a URL over `streamable-http` or `sse`. Each method's `id` is derived from it, such as `npm:@acme/review-tools` or `remote:https://mcp.example.com/mcp#sse`, and users name it to [choose another method](/mcp-servers/methods.md#choosing-another-execution-method). A consumer uses `default` unless the user selects another, and never switches by itself, even when a method fails to start.
* **Pinned versions.** A package method names an exact version: SemVer for npm, PEP 440 for PyPI, a digest or SemVer tag for OCI. This pins the definition, not what the runner downloads ([runners and what is pinned](/mcp-servers/methods.md#runners-and-what-is-pinned)).
* **Registry entries.** `mcp/<name>/server.json` stores the `server` object of the MCP Registry's entry, in canonical JSON (RFC 8785), and `registry.digest` is its digest. The methods are copied from it; the author may change only input descriptions and the defaults of inputs that are not secret, and a consumer checks the copy before running anything. That proves the package agrees with itself, not with the registry, so when Pandra fetches a package it asks the registry whether the entry is [verified](/run/trust.md#what-to-check).
* **Unsupported methods.** An MCP Registry entry may offer a method Pandra cannot run, such as one with runner options, another transport, or an environment variable its runner reads as configuration. It stays in the manifest and is listed with the reason, but cannot be selected. A server written in `pandra.toml` must have only supported methods, or the build fails.
* **Required servers.** `required: true` means the agent cannot do its job without the server, so a run with no person present fails before the prompt when it does not connect ([servers that do not connect](/reference/troubleshooting.md#an-mcp-server-did-not-connect)).

### Inputs

Inputs are the values a method needs from the user, such as the `Authorization` header above. Each has a name, a description, whether it is required or secret, and sometimes a default or a list of choices ([inputs](/mcp-servers/allowing.md#inputs)). A value refers to an input as `{name}`, and `${WORKSPACE}` in a package method's arguments and environment variables stands for the session's workspace; nothing else is expanded, shell syntax included. A secret input reaches a server only through an environment variable or a header, never an argument or a URL, and has no default. A package never stores a secret value.

## Environment variable declarations

`env` lists the environment variables the agent relies on, each with an optional `description`, `isRequired`, and `isSecret`. A declaration has no value: values come only from the user's configuration and environment variables. See [declaring them](/build/components.md#environment-variables) and [setting values](/configure/agent-settings.md#environment-variables-for-agents).

## Provenance

`provenance` records the inputs of the build:

```json
{
  "base": {
    "digest": "sha256:968964bd36f1...",
    "uri": "oci://ghcr.io/acme/reviewer"
  },
  "dependencies": [
    {
      "component": "skill",
      "digest": "sha256:9b1e...",
      "name": "test-driven-development",
      "path": "skills/test-driven-development",
      "revision": "3f1c...",
      "uri": "git+https://github.com/obra/superpowers"
    }
  ],
  "source": {
    "path": "reviewer",
    "revision": "8d2e...",
    "uri": "git+https://github.com/acme/agents"
  }
}
```

* `source` is the repository, full commit, and directory the project was built from. A build records it only when the project is in a Git repository with a usable remote, and the packaged files, `pandra.toml`, and `pandra.lock` match that commit. Inside a Git repository that does not qualify, it leaves `source` out, and `pandra push`, which publishes the package for others, says why with a `provenance_omitted` warning that names every file to commit; `pandra build`, a run, `sync`, and an editor's endpoint build the same package without the warning. Outside a Git repository it leaves `source` out without a warning.
* `base` names the package the agent was built on, with its URI (`git+` or `oci://`) and the package digest, when the base is not part of the same project. Only the direct base is recorded; a `path` base is part of the project and is not.
* `dependencies` mirrors the lockfile: one entry for each external source of a skill (for a plugin, each of its skills), an instructions file, or the prompt, with its URI, its commit for Git, its path, and the digest of its content. Local sources are not listed.

Provenance never contains the builder, timestamps, user names, absolute paths, or credentials, so the same inputs give the same package. It is informational and unsigned: it says what the package was built from, not who built it.

## The Agent Plugins view

`plugin.json` and `mcp.json` let an [Agent Plugins](https://agent-plugins.org/) 1.0.0 client load the package directory as a plugin. `plugin.json` carries the name and metadata, and `mcp.json` the servers whose default method can be written with fixed values. Such a client gets the skills and those servers, but not the instructions, the prompt, the environment variable declarations, or the other servers.

The view is optional, but when present it must be exactly what the manifest gives, so it never says anything the manifest does not. Pandra writes it in every package it builds and never reads it: consumers read only `agent.json`.

## How the digest is made

The content is an uncompressed tar archive with fixed rules: entries sorted by name, mode `0755` for directories and executable files and `0644` for the rest, and zero timestamps and owners. Identical directories therefore give identical archives, and a consumer refuses an archive with any byte the rules would not produce. Compression is left to transport and storage, because compressed bytes differ between tools.

An OCI manifest, also canonical JSON, names `agent.json` and the archive by their digests. The package digest is the SHA-256 of that OCI manifest, so it covers every byte of the agent: `sha256sum` of the manifest blob prints the digest `pandra build` showed. A producer that leaves out the optional view gets another digest for the same agent.

The lockfile's directory digests use the same archive rules, so a skill's digest in `pandra.lock` and in `provenance` covers the same bytes ([lockfile digests](/reference/lockfile.md#digests)).

## OCI artifacts

In a registry, a package is an OCI 1.1 artifact with one config blob and one layer:

| Part | Media type | Holds |
| --- | --- | --- |
| `artifactType` | `application/vnd.agentpackage.agent.v1` | Marks the artifact as an agent package. |
| `config` | `application/vnd.agentpackage.agent.config.v1+json` | The bytes of `agent.json`. |
| The one layer | `application/vnd.agentpackage.agent.content.v1.tar` | The content archive. |

Because the config blob is `agent.json` byte for byte, a registry or tool can read what an agent contains without downloading its content. The only annotations are the `org.opencontainers.image.*` title, version, description, licenses, source, and revision, taken from the package manifest and its provenance, with no `created` timestamp. `source` is the repository's URL, so registries can link the package to its repository.

The package's OCI manifest has no `subject`: signatures, attestations, and SBOMs refer to the package through the OCI referrers API. A digest proves what a package contains, not who published it, and `pandra push` attaches nothing, so sign the pushed digest with another tool if you need to ([publishing](/share/publishing.md#publishing-a-package-to-an-oci-registry)).

`pandra push DESTINATION --from AGENT` copies a package in the store to another registry with the same digest ([publishing](/share/publishing.md#publishing-a-package-to-an-oci-registry)).

## Package files

A package file, `NAME.agent.tar`, is an OCI image layout that holds one package, archived with the same tar rules:

```text
blobs/
blobs/sha256/
blobs/sha256/<hex>     the OCI manifest, agent.json, and the content archive,
blobs/sha256/<hex>     in the order of their digests
blobs/sha256/<hex>
index.json             names the OCI manifest by its digest
oci-layout             {"imageLayoutVersion":"1.0.0"}
```

The package has the same digest in a file as in a registry; a tag recorded in `index.json` (`org.opencontainers.image.ref.name`) is the only way two files of one package can differ. See [package files](/share/publishing.md#package-files) for `pandra agent save` and `pandra agent load`.

Tools that read OCI layouts can read a package file, and so can `tar` and `jq`, without unpacking it:

```sh
# the package digest
tar -xOf reviewer.agent.tar index.json | jq -r '.manifests[0].digest'
# the OCI manifest, by the hex digits of that digest
tar -xOf reviewer.agent.tar blobs/sha256/<manifest-hex> | jq .
# agent.json, which is the config blob, and the files of the layer
tar -xOf reviewer.agent.tar blobs/sha256/<config-hex> | jq .
tar -xOf reviewer.agent.tar blobs/sha256/<layer-hex> | tar -tvf -
```

## Versions of the format

`$schema` names the version of the format as a URL, such as `https://pandra.io/schemas/agent-package/0.1.0.schema.json`. A consumer recognizes it from a built-in list, never fetches it, and refuses a package whose `$schema` it does not know. Pandra reads 0.1.0 packages with the fields this page describes.

The format follows SemVer. A patch release never changes which packages are accepted or their bytes, so packages written under 0.1.1 still name 0.1.0. Before 1.0.0, a minor release may be incompatible with the previous one; from 1.0.0, minor releases only add optional fields. The format's version is independent of the agent's `version`, and of the `v1` in the media types, which changes only when the OCI representation changes incompatibly.
