# Maintainer policy: allow agents with verifiable receipts

**Preview: not for production or regulated use. Prepared adoption draft.**
Nothing is published or enabled by this document. Each project's maintainer
chooses whether to adopt it. This is a technical contribution policy, not legal,
licensing or compliance advice.

A maintainer who currently bans AI pull requests can choose a narrower rule:
**agent-assisted pull requests need a verifiable Enzan receipt, an accountable
submitter and ordinary project review.** “Verified agent” in this policy means
receipt checks passed under selected trust; it does not mean the agent's
identity, authorship, competence or code quality has been verified.

## Five-minute adoption

**Before the timer:** you need access to this private Action through permitted
GitHub private-Action sharing, an authorised Enzan checkout, and an
independently approved issuer key. An outside project without that access must
wait for an approved public release. No account or signing key is needed to
check a receipt. Five minutes covers installing the policy and workflow;
evaluating a PR still gets the time it needs.

1. Copy the [CONTRIBUTING snippet](examples/maintainer-policy/CONTRIBUTING.md)
   into your contribution guide. Keep the preview label and exact-head check.
2. Copy [receipt-check.yml](examples/maintainer-policy/receipt-check.yml) into
   `.github/workflows/enzan-receipt.yml`. It already uses immutable Action pins,
   Node 22.23.4, a read-only token and trusted base-branch inputs. Protect these
   paths using your normal maintainer review controls; this installs no bypass.
3. Create the `agent-assisted` label. Only a maintainer applies it after
   classification. Do not make a conditional skipped job the sole merge gate.
4. For your first declared PR, select the public files below in the trusted base
   branch, then remove and reapply the label to create a fresh event using that
   updated base. Rerunning an old run keeps its original event/base SHA. Never
   merge the proposed code merely to obtain its receipt files.
5. Open the job summary and retained artifact. Confirm the digest and manual
   exact-head association; apply ordinary project review before merging.

| File in the trusted base branch                          | Contents                                                                                                               |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `.enzan/issuer-trust.json`                               | Independently selected `issuerId` and `publicKeyPem`                                                                   |
| `.enzan/agent-prs/<PR_NUMBER>/receipt.raw`               | Exact disclosure-approved signed public-record bytes                                                                   |
| `.enzan/agent-prs/<PR_NUMBER>/expected-publication.json` | Independently selected `publicationId` and `recordRef` (`publicNamespaceId`, `kind`, `recordId`, `revision`, `digest`) |

`recordRef.kind` must be `WORK_RECEIPT`; `revision` is a number, not a string.
Include `publicNamespaceId`: a record ID and digest alone are not the complete
expected context. Copy the full independently selected publication reference; do
not reconstruct it from a candidate's own key or assertions. The trust file
contains a public key only, never an issuer private key.

Do not use the Root demo receipt as evidence of a contributor's PR. The exact
accepted receipt version and proposed head must match your manual review.

For an offline preflight in the authorised, built Enzan checkout, inspect the
actual interface with `node dist/scripts/receipt-pr-attachment-v1.js --help`.
Use the same three approved public inputs with `--receipt`, `--trust` and
`--context`, plus `--output` naming a new directory whose parent exists.
`ATTACHMENT_READY` with exit zero checks those inputs and prepares a reference;
it does not check GitHub or establish PR association. An existing output
directory refuses rather than overwriting. The consumer workflow needs no
checkout of Enzan by the maintainer: GitHub resolves the pinned Action through
approved private-Action access.

| Job result           | Maintainer decision                                                                                          |
| -------------------- | ------------------------------------------------------------------------------------------------------------ |
| Green                | Selected record integrity passed; `receiptCommitBinding: NOT_ESTABLISHED`. Check the exact PR head yourself. |
| Red / missing inputs | Hold the declared agent PR. Fix the selected receipt or independent trust/context, then rerun.               |
| Skipped / no label   | Unclassified until a maintainer explicitly records human-only or agent-assisted.                             |
| New head commit      | Repeat receipt association and ordinary review for the new head.                                             |

The Action uploads redacted references, not the raw receipt. Keep the public
inputs under your approved retention policy; the run artifacts expire in seven
days. It does not issue receipts, sign, comment on the PR or approve a merge.

## What contributors provide

Declare agent involvement in the PR. Provide the disclosure-approved receipt,
its exact digest and a link to the original public record/verification inputs,
the claimed association with this repository and exact proposed head commit, and
an accountable contact through the project's normal private process. Never
publish private paths, secrets or personal information in the receipt or PR. A
human-written PR still follows ordinary contribution rules; hiding agent
involvement is not an exemption. This policy cannot automatically detect it.

Use the receipt format supported by the existing
[PR receipt Action](examples/pr-submission-receipt/README.md): an already-issued
Enzan public-record work receipt. The copy-ready workflow is pinned to
`6872c26a901df7a26f60a7a1c7c3faa27fa7b3fc` and does not support the separate
signed-report submission format. The newer branch's `SIGNED_SUBMISSION_V1`
Action mode is a candidate awaiting review and adoption; do not add that input
to the reviewed pin or silently repin the workflow. Neither format issues
receipts or supplies a registry or signing service. A CLAIM with no independent
evaluation remains a claim. If the project requires independently evaluated
work, a CLAIM cannot meet that additional requirement. A missing or rejected
receipt means hold or decline the agent-assisted PR until a verifiable receipt
is supplied; never label it verified.

## What maintainers check before merging

1. Classify each PR as agent-assisted or human-only. Only a maintainer applies
   the `agent-assisted` label after review. Require normal maintainer approval
   for all PRs; an absent label or skipped receipt job is not proof of a human
   PR. Record the human-only decision explicitly.
2. Select the issuer public key, expected context and disclosure-approved
   receipt independently of the proposed PR. Do not trust a candidate's uploaded
   key, its own verification page or PR-edited trust/context files. Compare the
   approved issuer fingerprint/pin version through the project's independent
   channel. A website serving a receipt and matching key proves no authority.
3. Check that the receipt actually describes the proposed work, repository and
   exact PR head. **The current Action reports
   `receiptCommitBinding: NOT_ESTABLISHED`.** It does not establish authorship
   or bind the receipt to the current PR. A different receipt, copied green run,
   reused Root example or someone else's commit cannot satisfy this manual
   association check. If association cannot be established, hold or decline the
   PR; do not infer it from an Action success.
4. After that check, a trusted maintainer prepares the three public input files
   in the **base branch** at `.enzan/agent-prs/<PR_NUMBER>/receipt.raw`,
   `expected-publication.json` and `.enzan/issuer-trust.json`. The independently
   selected context must name the exact accepted receipt version. Updating
   trusted base files is an explicit maintainer operation; this example cannot
   ingest a new receipt from an untrusted fork automatically. Do not merge the
   candidate just to obtain its files. After trusted preparation, remove and
   reapply `agent-assisted` to create a fresh labelled event. The old run's
   rerun button retains the old base SHA and cannot load newly prepared inputs.
5. Use the [copy-ready workflow](examples/maintainer-policy/receipt-check.yml)
   in a fresh trusted GitHub-hosted runner with read-only contents permission,
   no signing keys and no preceding untrusted steps. Protect workflow/trust
   paths through the project's existing trusted review/CODEOWNERS controls. A PR
   can propose workflow changes: inspect the actual run's workflow and exact
   Action revision, not just a green badge or trusted checkout step. Never
   execute fork code with `pull_request_target` or privileged secrets.
6. Review the exact receipt digest, signature/context result, run attempt and
   artifacts. Retain evidence through the project's approved retention policy;
   the existing Action artifacts expire after seven days. Its runner/PR metadata
   is unsigned and runner-reported, not independently fetched or a new receipt.
7. Perform normal code, security, dependency, licensing and test review. Every
   new commit/head change invalidates the prior manual association approval;
   inspect the new head and receipt, update selected context if needed, and
   repeat the required check before merging. Receipt verification alone never
   approves a merge. No branch-protection or reviewer setting is changed here.

If the check refuses, use its bounded failure result to check the selected
inputs. Missing files require trusted-base preparation and a fresh label event;
wrong signature or context requires correcting the independently selected
inputs. An existing local preflight directory requires a different new output
name. Do not disable a check, accept a candidate-supplied key or use a green
unrelated run to get past a refusal.

The example runs on PR changes, including label addition/removal. It checks only
maintainer-labelled agent PRs, so its condition is **not an AI detector or a
complete admission gate**. Maintainer classification/review is mandatory. Do not
count a skipped check as a verified agent or rely on branch protection alone to
establish the manual association described above.

## Exactly what a receipt proves

A valid signature checks exact bytes under the selected issuer key and expected
publication context. It makes a record inspectable and tampering detectable. It
does not prove correct work, independent evaluation, human/agent identity,
current permissions/status, ownership, authorship, safety or legal compliance.
The PR Action adds a run-linked reference, not new signed proof of this PR's
execution. A signed self-report and an independently evaluated result stay
separate; repeated references do not create more verified work.

When a separate stored GitHub observation is actually successful, the wording
is:

> A successful CI run exists for this commit. Enzan has not checked who wrote it
> or what the tests cover

Do not claim even that when evidence is missing, private, mismatched,
rate-limited or unavailable: it is **unknown, never a pass**. The existing PR
receipt Action does not perform that GitHub API evidence check. Green CI may
just run `echo ok`, and citing another repository's run does not establish
contribution ownership. A stored check time is not a work date or freshness
promise. Submissions and checked CI remain separate from verified-work counts.

## Adoption status and limits

[CONTRIBUTING snippet](examples/maintainer-policy/CONTRIBUTING.md) and
[workflow](examples/maintainer-policy/receipt-check.yml) are drafts for a
maintainer to copy after approval. Replace the local label/input layout only
through reviewed project policy; never weaken trust selection for convenience.
The Action is pinned to the existing reviewed full commit, as in its existing
example. The Enzan repository/Action is private today: permitted private Action
sharing or an approved public release is required before an outside project can
use it. No hosted Action run or outside-repository admission is claimed here.
The new live issuer also needs its public signed pin file and matching released
verifier before signup opens. This policy supplies no operational key, package
release, new agent receipt or customer commitment.
