Skip to content

Write a 'writing a custom detector' contributor guide #3

Closed

Description

@bamdadd

Context

taintline detectors implement a tiny Detector Protocol (name + a pure run(trace) -> list[Finding]). Everything needed to write one is in the code, but there is no contributor-facing guide walking through it. This is the single highest-leverage doc for attracting agent-safety contributors.

What to do

Add docs/writing-a-detector.md covering:

  • the Detector Protocol and the purity/determinism contract (no LLM, no network, no clock, no RNG);
  • the Trace/Span/Finding/Verdict types a detector works with;
  • a minimal worked example (e.g. flag any tool span with status == "ERROR"), including how to register it in ALL and add a seeded fixture + test;
  • how --fail-on gates the exit code vs. what always runs.

Link it from the README and CONTRIBUTING.md.

Acceptance criteria

  • docs/writing-a-detector.md exists and a reader can implement + register a new detector from it alone.
  • The worked example is real, runnable code (copy-pasteable).
  • README and CONTRIBUTING.md link to it.

Pointers

  • src/taintline/model.py:90 — the Detector Protocol; Finding/Verdict above it
  • src/taintline/detectors/reliability.py:123 — SwallowedErrorDetector, a compact example to model the guide on
  • src/taintline/detectors/__init__.py — registration in ALL
  • docs/CONTRACT.md — the frozen type contract to reference

Activity

  1. IronLad123 commented on Aug 4, 2026

    @IronLad123
    Contributor

    Hi @bamdadd! I'd love to write this contributor guide. Having recently worked on taintline (PR #14, #15, #16), I will create docs/writing-a-detector.md covering the Detector protocol, type contract, a copy-pasteable worked example (e.g. error status detector with registration & seeded tests), and --fail-on gating details. I'll also link it cleanly from README.md and CONTRIBUTING.md. Will submit a PR shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions