bylines
Every line has an author. Prove which ones were the agent's.
bylines verifies that work attributed to an AI agent was really produced
inside the agent's own session. Give it a repository and the session
transcripts (Muse, Claude Code, Codex, or a redacted bylines bundle) and it will:
- Replay every
write/edittool call in timestamp order, reconstructing each file exactly as the session built it. - Classify every line by first appearance. A line counts as
agent-authored only if its first appearance in the transcript is inside a
write/editpayload. 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. - Check 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.
- Emit a deterministic report (
report.json+ a human-readable summary) that anyone can re-run and re-check. Same inputs, same verdict.
Why
Maintainers and platforms are flooded with agent-produced pull requests,
contest entries and bounty submissions. A one-prompt paste and a carefully
steered, multi-hour session look identical from the outside. bylines makes
honest agent work legible — and raises the cost of faking it from zero to
substantial.
What it does not prove
bylines proves internal consistency: these transcripts reproduce this
artifact under these rules. It does not prove the transcripts are authentic, a
human was present, or the timestamps are true. Forgery is possible; it is just
no longer free. See DESIGN.md for the full threat model.
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).
Exit code: 0 pass, 1 fail, 2 input error.
Redacted bundles
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.
Hash-chain anchoring
A redacted bundle is published next to the repo it attests, so nothing
stopped anyone from editing the bundle afterwards and still passing
verification. Since v0.4, 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 0.4 have no sidecar and
still verify (the chain check reports warn); run bylines chain --sessions ./attestation to anchor them after the fact.
A 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. See DESIGN.md for the full threat model.
GitHub Action
Commit a redacted bundle with your repo and verify it in CI:
- uses: actions/checkout@v4
- uses: kaamura-ai/bylines@v0.3.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.
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.4 — 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, and a GitHub Action (see DESIGN.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.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bylines-0.4.0.tar.gz | 29.7 kB | Without provenance | Details for bylines-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bylines-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for bylines-0.4.0-py3-none-any.whl |
Total release size: 57.2 kB
Release files / bylines-0.4.0.tar.gz
| Download URL | bylines-0.4.0.tar.gz |
|---|---|
| Size | 29.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20f7cc33f9f87c7a2ef01161f01f2e7ce0d66ae99bb305d15467b7ed31709cc3
|
|
BLAKE2b-256 checksum How to use checksums |
e479563bf0637e215fc21fb177fec55f70c6154375d91512a106f2fff4d7ccc7
|
| 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.4.0-py3-none-any.whl
| Download URL | bylines-0.4.0-py3-none-any.whl |
|---|---|
| Size | 27.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8e9614963bc1afa6f9fdd53972dc7bd1576cc7993e4be28d07153757665aa5c
|
|
BLAKE2b-256 checksum How to use checksums |
fbfe2d46a02bdd2cc8ddce9d7c2e4a59fd4b10e9db60c5e49e96eb047c518e98
|
| 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.4.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.