Skip to main content

bylines

CI

A receipt for agent work.

An AI agent did the work. Can it prove it? bylines replays the agent's session transcripts, reconstructs the repository exactly as the session built it, and classifies every line by first appearance — so honest agent work comes with a receipt the author can hand over, and anyone can check. Not a policing tool: a piece of paper that makes agent labour legible, and tradeable.

For authors: prove your work

You steered an agent through a real session — hours of iteration, not a one-prompt paste. From the outside, the two look identical. bylines lets you attach the proof:

# 1. Verify your own work before you hand it over
bylines verify --repo ./myrepo --sessions ~/.claude/projects/-myrepo \
  --harness claude-code --policy policy.toml \
  --out report.json --md report.md

# 2. Redact the transcripts into a shareable bundle
#    (prompts and tool outputs removed; the verdict survives)
bylines redact --sessions ~/.claude/projects/-myrepo \
  --harness claude-code --anchor myrepo --out ./attestation

# 3. The bundle is hash-chained at redaction time, so nobody can edit
#    it afterwards without breaking verification (see below)

# 4. Render the badge and paste the snippet into your PR or README
bylines badge --report report.json --out badge.svg

Commit attestation/ and badge.svg next to the code. A reviewer can re-run the verification and get the same verdict — deterministically, offline, with no account and no trust in you required.

What bylines does not prove

Read this before you rely on a verdict, in either direction.

bylines proves internal consistency: these transcripts reproduce this artifact under these rules. It does not prove:

  • that the transcripts are authentic — a determined forger can fabricate a transcript; bylines makes forgery costly, not impossible;
  • that a human was present, or supervised anything;
  • that the timestamps are true — they are self-reported clocks.

The hash chain proves a bundle is unchanged since redaction. It does not prove the redaction itself was honest: a forger can redact a doctored transcript and chain that. The full threat model is in DESIGN.md. bylines' position: raise the cost of faking from zero to substantial, and make honest work readable. That is all, and it is enough to be useful.

For reviewers: check a receipt

Given a repository and its transcripts (raw, or a redacted bundle), bylines:

  1. Replays every write/edit tool call in timestamp order, reconstructing each file exactly as the session built it.
  2. Classifies every line by first appearance. A line counts as agent-authored only if its first appearance in the transcript is inside a write/edit payload. Lines that first surfaced in a tool result, a file read, a shell output, or a pasted blob stay external forever — later edits cannot launder them into authored lines.
  3. Checks the rules a reviewer actually cares about:
    • reproduces — enough of the final code was agent-authored, little enough came from nowhere;
    • in_window — the work happened inside the allowed time window;
    • revised — files reached their final content through real iteration, not a single paste;
    • coverage — every file in the repo is accounted for: authored, declared (vendored / binary / generated, with hashes), or flagged unexplained;
    • chain — a redacted bundle's hash chain is intact: no record was edited, deleted, inserted, or reordered after redaction.
  4. Emits a deterministic report (report.json + a human-readable Markdown summary). Same inputs, same verdict — re-run it yourself.

Exit code: 0 pass, 1 fail, 2 input error.

Install

pipx install bylines

(or pip install bylines.)

Python 3.11+, standard library only. No network, no API keys, fully offline.

Quickstart

bylines verify \
  --repo ./my-entry \
  --sessions ./bundle/sessions \
  --harness claude-code \
  --policy policy.toml \
  --out report.json --md report.md

--harness selects the transcript format: muse (Muse session JSONL, the default), claude-code (~/.claude/projects/**/*.jsonl, subagent transcripts included), codex (~/.codex/sessions/**/rollout-*.jsonl, including apply_patch writes), or events (redacted bylines bundles, below).

Redacted bundles and hash chains

Raw transcripts contain your prompts and everything your tools printed — not something you publish. bylines redact converts them into a shareable bylines event file:

bylines redact --sessions ~/.claude/projects/-home-dev-myrepo \
  --harness claude-code --anchor myrepo --out ./attestation
bylines verify --repo ./myrepo --sessions ./attestation --harness events

Redaction keeps timestamps, tool-call structure and the write/edit payloads (those lines are the artifact itself — the repo already publishes them), and removes all conversation text and tool outputs. Outputs survive only as per-line SHA-256 hashes, which is exactly what verification needs: a line first sighted in an output is still classified external, so a pasted file still fails — the verdict on a redacted bundle is the verdict on the raw transcript.

bylines redact also writes a <stem>.chain.json sidecar: every record is hashed together with the hash of the record before it, so any edit, deletion, insertion or reorder in the bundle breaks the chain. bylines verify --harness events recomputes the chain and fails the chain check on any mismatch, naming the first broken record. Bundles made before v0.4 have no sidecar and still verify (the chain check reports warn); run bylines chain --sessions ./attestation to anchor them after the fact.

The badge

bylines badge --report report.json --out badge.svg renders a static, self-contained SVG badge — verdict and authored percentage — and prints the Markdown snippet to paste next to it:

![bylines: verified · authored 77.4%](badge.svg)

No badge service, no tracking pixel, no network: the SVG is generated locally from your report and lives in your repo like any other file.

GitHub Action

Commit a redacted bundle with your repo and verify it in CI:

- uses: actions/checkout@v4
- uses: kaamura-ai/bylines@v0.5.0
  with:
    sessions: ./attestation
    harness: events
    policy: ./policy.toml

The action fails the job on a fail verdict and uploads report.json / report.md as artifacts.

On pull_request events it also posts the verdict summary as a PR comment (updated in place on re-runs, not spammed). That requires the workflow token to be allowed to comment:

permissions:
  pull-requests: write

Set comment: "false" in the action inputs to disable the comment.

Policy (TOML)

[window]
opens  = "2026-12-01T00:00:00Z"
closes = "2026-12-07T00:00:00Z"

[counted]
include = ["**/*.py", "**/*.md"]
exclude = ["vendor/**", "*.min.js"]

[reproduces]
authored_min   = 0.30
unwritten_max  = 0.40

[revised]
min_files = 1
min_ops   = 2

[coverage]
unexplained = "fail"   # or "warn"

Status

v0.5 — Muse, Claude Code and Codex transcript adapters, replay engine, the five checks (reproduces / in_window / revised / coverage / chain), JSON/Markdown reports, redacted bundles (bylines redact) with hash-chain anchoring, a verified badge (bylines badge), and a GitHub Action that can join the PR conversation (see DESIGN.md, ROADMAP.md).

Validated against a production corpus: a real contest submission verified by a platform's own (closed) checker reproduces the same verdict under bylines, from both the raw and the redacted transcript.

See examples/self-verification/ for bylines verifying its own development session — bundle, policy and report included, warts and all.

License

MIT

Metadata

Release files for bylines 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bylines 0.5.0
File Size Uploaded Provenance Actions
bylines-0.5.0.tar.gz 44.1 kB Without provenance Details for bylines-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bylines 0.5.0
File Interpreter ABI Platform Actions
bylines-0.5.0-py3-none-any.whl Python 3 none any Details for bylines-0.5.0-py3-none-any.whl

Total release size: 74.1 kB

Release files / bylines-0.5.0.tar.gz

Download URL bylines-0.5.0.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
804f6e54b958d5c0e0278f28553f1264dbaa0448468034f169af08d903b3cf85
BLAKE2b-256 checksum
How to use checksums
67248328f61ad9cda68df795d602173f9ba605cbd821529a190f15f2443b249d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / bylines-0.5.0-py3-none-any.whl

Download URL bylines-0.5.0-py3-none-any.whl
Size 30.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8cf052904e995a40bd20415e6b1bb3651e8e24616f2609b1d20cd6395cf5e4b
BLAKE2b-256 checksum
How to use checksums
6f028a18d9d5ff7aae4a685308665fa43a37cb4cd784dbc54c57cf4f8cda7e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for bylines 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page