# Maintainer verified

A listing shows **maintainer verified** when a GitHub Actions workflow in the upstream
project's own repository signed the listing's exact artifact digest with Sigstore
keyless signing. It is the model npm trusted publishing uses: the workflow asks GitHub
for an OIDC token, Fulcio issues a short-lived certificate naming the workflow, and the
signature is logged in Rekor. No key is stored anywhere.

The badge says who signed this digest. It says nothing about quality or popularity, and
it never changes the trust score. It covers one version: a new version shows no badge
until the workflow signs its digest too, and it comes down if the seller removes the
trusted publisher link it matched.

## What ContextFile checks

When the bundle arrives, ContextFile checks, offline against Sigstore's public-good
trusted root:

1. The certificate chains to Fulcio, carries a certificate transparency timestamp, and
   was valid when Rekor logged the entry.
2. The Rekor entry verifies and matches the signed envelope.
3. The envelope signature verifies with the certificate's key.
4. The certificate's OIDC issuer is `https://token.actions.githubusercontent.com` and
   its identity is `https://github.com/<owner>/<repo>/<workflow path>@<ref>`.
5. That repository and workflow is one of the seller's trusted publisher links (set in
   `/settings/creator`).
6. The signed in-toto statement has predicate type
   `https://contextfile.ai/maintainer-binding/v1` and names the listing's current
   artifact digest as a subject.

Bundles from GitHub's private Sigstore instance (private repositories) are refused.

## Before you start

- The seller account that owns the listing links the upstream repository and workflow
  as a trusted publisher in `/settings/creator`.
- Find the listing's current artifact digest: `artifacts_get` answers it as
  `current_version.artifact_digest`, or `GET https://mcp.contextfile.ai/v1/artifacts/<artifact_id>`.
- Add a ContextFile token for the seller account as the repository secret
  `CONTEXTFILE_TOKEN` (scope `write:doc`).

## The workflow

Copy this into the upstream repository as `.github/workflows/contextfile-maintainer.yml`,
the path you linked. Run it by hand with the listing id and the digest.

```yaml
name: ContextFile maintainer signature
on:
  workflow_dispatch:
    inputs:
      listing_id:
        description: ContextFile listing id
        required: true
      artifact_digest:
        description: The listing's current artifact digest (sha256:...)
        required: true

permissions:
  contents: read
  id-token: write # lets cosign ask GitHub for the OIDC token Fulcio needs

jobs:
  sign:
    runs-on: ubuntu-latest
    steps:
      - uses: sigstore/cosign-installer@v3
      - name: Write the statement
        env:
          LISTING_ID: ${{ inputs.listing_id }}
          DIGEST: ${{ inputs.artifact_digest }}
        run: |
          hex="${DIGEST#sha256:}"
          jq -n --arg hex "$hex" --arg listing "$LISTING_ID" '{
            _type: "https://in-toto.io/Statement/v1",
            subject: [{ name: ("contextfile.ai/listings/" + $listing), digest: { sha256: $hex } }],
            predicateType: "https://contextfile.ai/maintainer-binding/v1",
            predicate: { listing: ("https://contextfile.ai/listings/" + $listing) }
          }' > statement.json
      - name: Sign keyless
        run: cosign attest-blob --statement statement.json --bundle maintainer.sigstore.json --yes
      - name: Send the bundle to ContextFile
        env:
          CONTEXTFILE_TOKEN: ${{ secrets.CONTEXTFILE_TOKEN }}
          LISTING_ID: ${{ inputs.listing_id }}
        run: |
          jq -n --slurpfile b maintainer.sigstore.json '{ bundle: $b[0] }' |
            curl -sS --fail-with-body -X POST \
              -H "Authorization: Bearer $CONTEXTFILE_TOKEN" \
              -H "Content-Type: application/json" \
              --data @- "https://mcp.contextfile.ai/v1/listings/$LISTING_ID/maintainer"
```

The bundle must be in the Sigstore bundle v0.3 format, which cosign 3 writes by
default; with cosign 2, add `--new-bundle-format` to the sign step.

GitHub's own `actions/attest` action makes the same kind of bundle. In place of the
cosign steps:

```yaml
      - uses: actions/attest@v2
        id: attest
        with:
          subject-name: contextfile.ai/listings/${{ inputs.listing_id }}
          subject-digest: ${{ inputs.artifact_digest }}
          predicate-type: https://contextfile.ai/maintainer-binding/v1
          predicate: '{"listing":"https://contextfile.ai/listings/${{ inputs.listing_id }}"}'
```

then send `${{ steps.attest.outputs.bundle-path }}` the same way. It needs
`attestations: write` in `permissions` as well.

An agent can send the bundle with the MCP tool `maintainer_verify` (`listing_id`,
`bundle`) instead of the REST call.

## Reading the badge

`trust_get` with `artifact:<id>` or `listing:<id>` answers a `maintainer` field beside
the score: the repository, workflow, ref, certificate identity, signed time, the Rekor
log index and a link to the entry. It is null when no binding covers the current
version. Anyone can check the Rekor entry at `search.sigstore.dev` without asking
ContextFile.

## Official listings

A vendor whose listing is maintainer verified can also mark it **official** from the
listing's health page (`/settings/listings/<id>/health`), with the official listing plan
on its org's ContextFile entitlement. The family products' own orgs are in a pilot and
may mark their own listings official without it.

An official listing's seller sees agent usage per UTC day on the same page, and agents
read it with `world_get` view `usage` or `GET /v1/listings/<id>/usage`: reads
(`artifacts_get`), installs (`cf install`), downloads (`artifacts_download`) and
searches that returned the listing. These are aggregate counts. ContextFile stores no
buyer, agent or account with them, so no one can learn from them who used the listing.

## Refusals

| Code in the message | Means |
| --- | --- |
| `untrusted` | The certificate chain, Rekor entry or signature did not verify against the public-good root. |
| `wrong_issuer` | The certificate was not issued for GitHub Actions. |
| `wrong_identity` | The certificate identity is not a GitHub Actions workflow. |
| `no_link` | The signing repository and workflow is not one of the seller's trusted publisher links. |
| `wrong_predicate_type` | The statement's predicate type is not `https://contextfile.ai/maintainer-binding/v1`. |
| `digest_mismatch` | The statement does not name the listing's current artifact digest. |
| `malformed` | Not a keyless Sigstore bundle with a DSSE in-toto statement, or larger than 64 KB. |



Version 1, updated 2026-11-19.
