Plugin packaging and release
Guard turns one AI-agent plugin source into runtime-specific packages and a release record that can be checked by users and the HOL listing. The release path checks what the plugin can load, records its runtime support and access surface, creates optional package inventory evidence, and binds the result to the exact source commit and GitHub provenance.
Packaging model
The Plugin Kit is the local packaging boundary. It detects a plugin from its supported manifests, checks the source before writing output, and emits only the runtime formats that can carry the plugin's supported parts. The package can include manifests, skills, MCP settings, and runtime-specific files. Unsupported parts are reported instead of being silently treated as portable.
The package is reproducible for the same source and Kit version. Its hol.provenance.json records the generator, plugin identity, source digest, selected runtimes, and the digest of each generated file. The output is kept separate from source files so a later package run does not read an earlier package as input.
See Plugin Kit validation, installation, and telemetry for the user-facing Kit workflows that discover, validate, install, and measure plugins.
References: rust/…/lib.rs• L243-327 rust/…/emit.rs• L84-117 rust/…/emit.rs• L190-309
Runtime package selection
Runtime selection maps the plugin's declared capabilities to the agent runtimes that can use them. A caller can request runtimes explicitly, or the Kit can use hol.json; an explicit unsupported runtime is an error, while a configured runtime is best effort. This keeps a shared source package useful across ecosystems without claiming support where the output would lose required behavior.
| Package target | Main product surface |
|---|---|
| Claude Code and Codex | Skills and MCP servers, with Claude-specific commands, agents, and hooks where supported |
| Gemini CLI | MCP servers and the extension context file |
| Cursor, VS Code, and opencode | MCP servers in each runtime's configuration format |
| MCP Registry | A registry server description |
| Agent skills | Portable skill folders |
| Agent Plugins | Skills, MCP servers, and plugin files in the Agent Plugins layout |
Environment names and header references are translated into each runtime's syntax. Literal secret values are not copied into generated packages. Components that a target cannot express are left out and surfaced by the check report.
References: rust/…/lib.rs• L289-327 rust/…/emit.rs• L36-117 rust/…/emit.rs• L129-187
Release evidence
The trusted release action combines scanner results with the Plugin Kit check to describe one release at one commit. The evidence includes the repository, commit, ref, workflow run, Guard version, scan result, check result, supported runtimes, component counts, hooks, and a reduced MCP server surface. The surface shows transport, safe command or package names, remote host names, and environment variable names. It does not include source content, findings, local paths, credentials, prompts, header values, or variable values.
This record supports release comparison rather than a broad security promise. The claim says that the commit was scanned and checked under the recorded versions and that the evidence has GitHub-signed provenance. It does not claim that the plugin is vulnerability-free or that packaged runtimes were run successfully.
References: src/…/plugin_release_evidence.py• L1-14 src/…/plugin_release_evidence.py• L64-94 src/…/plugin_release_evidence.py• L181-289
Package inventory
When a plugin declares third-party packages, the release also creates a CycloneDX 1.6 software bill of materials (SBOM). The SBOM draws from shipped lockfiles and exact requirement pins, then adds packages launched by known MCP package runners. It excludes development requirements, local sources, symbolic links, unreadable files, and nested folders outside the plugin root.
The SBOM has no run-time timestamp. Its digest and component count are stored in the release evidence, so the attestation covers the exact inventory file. If there are no usable packages, or the inventory is too large to represent safely, the release omits the SBOM instead of publishing a partial one.
References: src/…/plugin_release_sbom.py• L1-14 src/…/plugin_release_sbom.py• L269-301 src/…/plugin_release_sbom.py• L320-359 src/…/plugin_release_runner.py• L48-95
Attested release flow
The release flow moves from source checks to an immutable evidence file, then to provenance and optional HOL registration. The final gates run after attestation, which preserves a record even when the release job fails because of a scan severity or Plugin Kit error.
This diagram shows how the source commit becomes a checked and publishable release record.
flowchart LR
A[Plugin source at release commit] --> B[HOL Guard scan]
A --> C[Plugin Kit check]
B --> D[Release evidence]
C --> D
A --> E[Package inventory]
E --> D
D --> F[GitHub provenance attestation]
F --> G[HOL registration]
F --> H[Release summary and gates]
G --> I[HOL release listing]
The reusable workflow is the trust boundary for publication. Plugin repositories call .github/…/plugin-release.yml from their release workflow and pin it by commit SHA. The reusable workflow pins the composite action by commit SHA, grants only the permissions needed for checkout, OIDC, attestation, artifact metadata, and optional SARIF upload, and sends successful evidence to the HOL release endpoint by default.
The composite action installs a verified Guard wheel before it scans or checks the plugin. Stable wheels use PyPI provenance. Alpha wheels use a GitHub release and must be attested by the Guard publish workflow on main; both paths also require the pinned SHA-256. This preserves the identity of the tool that produced the release record.
References: .github/…/plugin-release.yml• L1-122 plugin-release/action.yml• L82-173 docs/…/plugin-release-attestation.md• L20-49
Release identity
The evidence file is canonical JSON with sorted keys, stable indentation, ASCII escapes, and a trailing newline. Guard hashes those exact bytes, uses the digest as the attestation subject, and binds the same digest into the GitHub OIDC audience. HOL can therefore recompute the digest and reject a token or evidence file that was made for a different release record.
HOL accepts registration only from the trusted reusable workflow. Its verifier checks the OIDC workflow reference and commit pin. A direct caller of the composite action can still create a local attestation, but it cannot use that path to submit a release as trusted HOL evidence.
References: src/…/plugin_release_evidence.py• L292-305 src/…/plugin_release_registration.py• L12-48 docs/…/plugin-release-attestation.md• L20-22
Publication outcomes
Registration is separate from attestation. The action can attest without sending evidence to HOL, while an enabled registration may be unavailable without invalidating the already-created attestation. When HOL records a release, it can attach the result to the matching plugin listing and report changes from the previous checked version.
| Outcome | Meaning |
|---|---|
| Attested | GitHub signed the exact evidence file; this remains true even if a later gate fails. |
| Registered | HOL accepted the evidence from the trusted workflow and may show it on the matching listing. |
| Disabled | The workflow kept the evidence local and did not send it to HOL. |
| Unavailable | Registration failed or returned an invalid result; the attested record still exists. |
The release summary highlights new servers, hosts, environment variables, launched packages, hooks, higher scan severity, and a newly failing Kit check. These change notices help a reviewer assess an upgrade. They do not themselves fail the job.
References: src/…/plugin_release_runner.py• L100-132 src/…/plugin_release_runner.py• L139-159 src/…/plugin_release_runner.py• L257-294 docs/…/plugin-release-attestation.md• L75-81
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the reusable workflow's full commit pin aligned with the workflow identity that HOL verifies. A direct or moving reference can break trusted registration.
- Keep the Guard version pin, wheel digest, and provenance source aligned. A mismatch blocks the release before scanning.
- Preserve the order in which evidence, attestation, registration, and release gates run. Moving a gate before attestation removes evidence for failed releases.
- Update the evidence contract and its consumers together when adding a release field. The canonical bytes and OIDC audience must still describe the same record.
- Keep SBOM inputs and evidence digest fields synchronized. A published SBOM without its evidence digest is not bound to the attested release.
- Keep runtime support and emitted package formats aligned. A runtime reported as supported must be able to carry the required plugin surface.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
Plugin Kit check reports errors and fail_on_check_errors is enabled | The job fails after an attested record is created | Run the Kit check before release and inspect its diagnostics |
| Scan reaches the configured severity threshold | The job fails after attestation | Review findings or set a deliberate release threshold |
| Requested runtime cannot load the plugin | Packaging stops instead of producing an incomplete target package | Use the supported-runtime result or remove the unsupported request |
| Evidence contains more than the allowed MCP server surface | Evidence creation stops rather than publishing a partial access record | Split or reduce the declared server surface |
| Pinned Guard wheel has the wrong digest or provenance | The release cannot run the scanner or Kit check | Update the version, digest, and matching provenance source together |
| Registration endpoint or trusted workflow check fails | HOL does not record the release, but the GitHub attestation remains | Check the reusable workflow pin and treat registration as a separate outcome |
| Package output overlaps source files or uses a symlink path | Packaging is refused to prevent source contamination or unsafe writes | Use a separate repository-relative output directory |
Key files
| File | Why to read it |
|---|---|
| .github/…/plugin-release.yml | Defines the trusted reusable workflow and the publication contract for plugin repositories. |
| plugin-release/action.yml | Shows the end-to-end scan, Kit check, evidence, attestation, registration, and gate sequence. |
| rust/…/lib.rs | Defines the Kit's package request, runtime selection, check gate, and provenance plan. |
| rust/…/emit.rs | Explains the runtime package targets, carried components, dropped components, and source digest. |
| rust/…/output.rs | Defines safe output placement, replacement behavior, and rollback on write failure. |
| src/…/plugin_release_evidence.py | Defines the release identity, safe plugin surface, and canonical evidence record. |
| src/…/plugin_release_sbom.py | Defines package inventory collection and deterministic CycloneDX output. |
| src/…/plugin_release_registration.py | Binds HOL registration to the evidence digest through GitHub OIDC. |
| src/…/plugin_release_runner.py | Coordinates evidence creation, optional publication, change summaries, and final gates. |