Reference
CI publish tokensBeta
A CI job can create a public, expiring post-mortem link for a recent session without anyone clicking Share. Beta: the console side is live since v0.7.0 and the contract can still change. The PR action can use it from v2.1.0.
The link shows the session as it was shipped. Redaction by sensitivity happens in your shipper, which is Lodestar OSS. Machinaut does not re-classify anything: it records the ceiling each ship declared and refuses to publish a session above the token's.
The credential
Publishing uses its own credential, the CI publish token. A project key or API token still cannot make a public link.
| Property | Rule |
|---|---|
| Format | mp_ plus 32 URL-safe characters, sent only as Authorization: Bearer mp_…. It is not accepted as x-api-key or a cookie. |
| Who mints | An org owner, from a browser session: Settings → API Tokens → CI publish tokens. Members cannot. |
| Scope | Pinned to exactly one project. There is no tenant-wide publish token. |
| Power | Mint-only. It can create a share on POST /v1/publish/shares and nothing else: it cannot list or read sessions, shares or projects, cannot ingest, relay approvals, post attestations or mint tokens. Every other route answers it 401. |
| Storage | Only a SHA-256 hash is stored. The secret is shown once, at mint. |
| Separate from your other keys | A leaked ingest key or API token cannot publish. A leaked publish token cannot ingest or read. |
| Offboarding | It is a service credential: it keeps working after the owner who minted it leaves. |
| Quota | It counts toward the free-tier token cap together with API tokens (402 quota_exceeded). |
Mint a link
subject is optional and never shown publicly: it is a replacement key, so a new session under the same subject (for example a pull request) replaces the token's earlier link. label is also optional, but it appears as the public page title, so leave it out unless you want it public.
POST /v1/publish/shares
Authorization: Bearer mp_…
Content-Type: application/json
{ "project_id": "…", "session_id": "…", "subject": "github.com/o/r/pull/42" }201 { "beta": true,
"share": { "id": "…", "token": "…", "path": "/s/<token>", "project_id": "…", "session_id": "…",
"subject": "github.com/o/r/pull/42" | null,
"expires_at": "…", "ceiling": "public" | "internal" },
"reused": false,
"replaced_share_id": "…" } // only when it replaced this token's earlier link for the subject
200 the same body with "reused": true // this token already has a live link for the session| Status | When |
|---|---|
| 400 bad_request | Malformed body. |
| 401 invalid_publish_token | Missing, unknown or revoked token, or any credential that is not an mp_ bearer. |
| 402 quota_exceeded | The org’s live-share cap is reached. A reuse or a replacement is never refused. |
| 403 project_scope_conflict | project_id is not the token’s pinned project. |
| 404 not_found | No such session in the pinned project. |
| 409 not_publishable | The gate refused. The body carries a reason and a message that names the fix. |
| 429 rate_limited | The org’s publish bucket is empty. Retry-After says when to retry. |
The publish gate
Every ship declares a sensitivity ceiling, and Machinaut records it on each row that ship stored. Sensitivity ceilings are a Lodestar feature; the publish gate that reads them is Machinaut's. The order is public, internal, confidential, secret. The token's ceiling is public by default; an owner may choose internal after confirming that internal-labelled content becomes public.
| Refusal (409) | Refused when | Fix |
|---|---|---|
ceiling_above_token | Any stored row of the session was shipped with a declared ceiling above the token’s. | Ship new sessions at public, or have an owner mint an internal token. confidential and secret are never published by CI. |
ceiling_unknown | Some row has no recorded ceiling: rows shipped before v0.7.0, or the sample project. | Ship new sessions, or publish this one by hand from the console. |
session_too_old | A new link for a session first ingested longer ago than the token’s freshness window. | Publish it by hand. |
lodestar ship defaults to internal, so a session shipped with defaults is refused by a default token. That is deliberate. To publish, ship at public, or have an owner allow internal:
lodestar ship --sensitivity-ceiling publicThe ceiling check runs on every call, including a reuse. A link also stops working if rows above the token's ceiling, or rows with no recorded ceiling, are stored for its session later: it answers the same 404 as a revoked link and is revoked, with the reason in the org audit log.
What the gate does not cover
The ceiling governs payloads, not the envelope structure. Actor ids, event types, timestamps, causal links and payload hashes are public on every link at every ceiling. A record that was mislabelled ships at its own label, and labelling happens in your writer. Pin the token to a project that only CI ships into, and do not mint one for a project whose agent or tool names are sensitive.
Reuse, replacement and expiry
- A live link made by the same token for the same session comes back with 200 and
reused: true. Nothing new is created. - There is at most one live link per token and
subject. A new session under the same subject revokes the earlier link and returnsreplaced_share_id. - A CI link expires after the token's link expiry: 30 days by default, 1 to 90. An expired link answers 404. The freshness window (72 hours by default, 1 to 720) applies only when a new link would be created, so a re-run keeps its link.
- Revoking the token, from the console, also revokes its live links unless the owner ticks planned rotation.
- Minting has its own per-org rate limit, separate from ingest, so a CI loop cannot starve shipping.
What a link shows
The public page shows the chain and the report, which are Lodestar OSS, and a line saying the link was published automatically by the project's CI (Beta), with its expiry and the session's recorded ceiling. It does not show the token, its label, who minted it, the subject or your org. Owners see CI links in the session's share panel with a CI chip, and mints and revocations are in the org audit log (the owner-only Admin activity tab). The mint form asks for a confirmation when nothing has shipped to the project id yet.
The PR action
Beta. From action v2.1.0 (the floating @v2 tag), the machinaut-publish-token input mints or reuses a public link and leads the sticky comment with it. Store the token as a repo secret. Keep the trigger on pull_request, and use the concurrency group so two runs on one PR cannot race on the comment. The step's publish output reports published, reused or skipped:<reason>.
name: Machinaut evidence
on:
pull_request: # keep this; not pull_request_target
permissions:
contents: read
pull-requests: write # post and update the sticky comment
concurrency:
group: machinaut-evidence-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
jobs:
evidence:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: ship # your agent runs, then ships at the public ceiling
run: echo "session-id=$SESSION_ID" >> "$GITHUB_OUTPUT"
- uses: machinise/machinaut-pr-action@v2
with:
machinaut-api-key: ${{ secrets.MACHINAUT_API_KEY }}
machinaut-publish-token: ${{ secrets.MACHINAUT_PUBLISH_TOKEN }}
project-id: your-project-id
session-id: ${{ steps.ship.outputs.session-id }}- Ship the session with
--sensitivity-ceiling public.lodestar shipdefaults tointernal, which a default token refuses. - The action never publishes for a pull request from a fork.
- Do not use
pull_request_targetwith a checkout of the fork's code, and do not publish from aworkflow_runthat reads a session id from a fork's artifact. - A publish problem never fails the step: the comment falls back to the sign-in link to your console, with a one-line reason.
Planned
- GitHub OIDC trusted publishing instead of a stored secret.
- A command-line way to mint publish tokens.
Related