Agent notes
Draft config from race-helpers (not safe as it stands: the census line patterns accept arbitrary text in the second field). Start the follow-up from here.
# gitleaks' default rules, less the values this repository commits on
# purpose. `make gitleaks` (.amadan/ci.d/80-gitleaks) scans the working
# tree's tracked files with it; the Makefile says why not the history.
#
# Every allowance names its values, anchored, so a value that merely
# contains one is still found; only the source digests go by their shape:
# the whole line must be a digest entry, in the files that hold them. Where a value only belongs in some files,
# the allowance is scoped to them (condition AND: a path and a value), so
# the same value anywhere else still fails the gate. Nothing is allowed by
# fingerprint in .gitleaksignore: a fingerprint names a commit, and this
# scan reads no commits.
#
# AN ALLOWANCE WITH `paths` MUST NAME `targetRules`. In `gitleaks dir`
# (v8.30.1), a global allowance's paths skip the whole file before it is
# read, whatever its condition says: an AND of a path and a value allowed
# every secret in every file the path matched. One with targetRules is
# moved onto those rules, where the AND holds and the rest of the file is
# still scanned.
#
# A new finding is fixed, not allowed, unless it is a value that has to be
# committed. Then add it here, in the group that fits, with its reason.
[extend]
useDefault = true
# sha256 digests the census pins: of a function's source, in
# internal/provision's *_census_test.go layers. A hash of code that is
# itself in this repository; generic-api-key matches it because the field
# before it names a record key. Matched against the whole line, so only a
# complete census entry passes: a hex credential on any other line of these
# files, an `api_key = "..."` above all, is still found.
#
# The second pattern is the same entry cut short. gitleaks reads a big file
# in chunks, and in plan9_b8_census_test.go one boundary falls inside a
# digest. For a finding on a chunk's unterminated last line, gitleaks hands
# over the whole chunk as the "line", so this pattern holds only the chunk's
# last line to the entry's shape. Older layers are frozen, so that boundary
# does not move.
[[allowlists]]
description = "census entries' source digests"
targetRules = ["generic-api-key"]
condition = "AND"
regexTarget = "line"
paths = ['''^internal/provision/[^/]+_census_test\.go$''']
regexes = [
'''^\s*(?:censusEntry)?\{"[A-Za-z0-9_./-]+\.go", "[^"\n]+", "[a-z-]+", "(?:key|sel):[A-Za-z]+(?:,(?:key|sel):[A-Za-z]+)*", "[0-9a-f]{64}"\},\s*$''',
'''\n[ \t]*(?:censusEntry)?\{"[A-Za-z0-9_./-]+\.go", "[^"\n]+", "[a-z-]+", "(?:key|sel):[A-Za-z]+(?:,(?:key|sel):[A-Za-z]+)*", "[0-9a-f]{10,63}$''',
]
# The same digests in a design checklist's source_hashes: a Go file's path,
# then the sha256 of that file. Whole line again, for the same reason.
[[allowlists]]
description = "design checklist's source digests"
targetRules = ["generic-api-key"]
condition = "AND"
regexTarget = "line"
paths = ['''^implementation/always-awake-consumers\.json$''']
regexes = ['''^\s*"[A-Za-z0-9_./-]+\.go": "[0-9a-f]{64}",?\s*$''']
# Fake credentials typed into tests, each recognisable as one: a counting
# run (0123456789abcdef), a word (SecretValue, SENTINEL, nope), a test's
# own label. The Stripe keys exist to test that the console tells a live
# key from a test key and a restricted key from a secret one, so they must
# keep Stripe's prefixes. Three are 64-hex values: 9f86d081... is
# sha256("test"), fd61a03a... a second stand-in for an HMAC, and
# c7aff5eb... the callback signature key derived from the golden vector's
# fixed master, "master-fixed-for-the-vector". Test files only: the same
# value in production code is still found.
[[allowlists]]
description = "fake credentials in tests"
targetRules = ["generic-api-key", "stripe-access-token"]
condition = "AND"
paths = ['''_test\.go$''']
regexes = [
'''^rk_test_51SecretValue$''',
'''^rk_live_51SecretValue$''',
'''^sk_test_51SecretValue$''',
'''^rk_live_51AbCdEfGhIjKlMnOpQrStUv$''',
'''^tok-flagship-2$''',
'''^tok-second-64hex$''',
'''^tok_SECRET_123$''',
'''^tok-0123456789abcdef0123456789abcdef$''',
'''^SES_SECRET=s3kr1t$''',
'''^SECRET-SENTINEL-7f3a$''',
'''^cdk1\.bab\.titogo\.0123456789abcdef\.$''',
'''^cdk1\.bae\.titogo\.nope$''',
'''^carlos-0123456789abcdef0123456789abcdef-1$''',
'''^0123456789abcdef0123456789abcdef$''',
'''^0123456789abcdefghij0123456789abcdefghijkl$''',
'''^3f9a0c1d2e4b5a6978877665544332211$''',
'''^AbCd12_EfGh34_IjKl56_MnOp78$''',
'''^ba9876543210$''',
'''^PLAN14_E45_CONTAINED$''',
'''^apps/bab/other/instances/$''',
'''^9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08$''',
'''^fd61a03af4f77d870fc21e05e7e80678095c92d808cfb3b5c279ee04c74aca13$''',
'''^c7aff5eb65835639b68c63a226767768ac2049fe0b57ab83844691ae5cca1d17$''',
]
# The fake instance key the instance-key tests and their plans share
# (note its tail, ...bC6dF5gH0iJ1kA=: typed, not generated). Allowed in
# tests and docs alike, because the plans quote the tests.
[[allowlists]]
description = "fake instance key shared by tests and plans"
regexes = ['''^q\+/Zk3vJ0aW1Yx9sR7tUe2oPl4mN8bC6dF5gH0iJ1kA=$''']
# RFC 6455's sample Sec-WebSocket-Key ("the sample nonce", base64), the
# one every WebSocket handshake test and its spec quotes. A nonce is not a
# secret even when it is not the RFC's.
[[allowlists]]
description = "RFC 6455 sample WebSocket key"
regexes = ['''^dGhlIHNhbXBsZSBub25jZQ==$''']
# Committed fixtures. configseal_vectors.json is the cross-language
# vector set sealed by configseal.js and opened by Go; its key is a
# throwaway minted for the vectors and protects nothing (the file says so,
# in the key's own name). lookup.json is a recorded registrar response
# with its domain auth code replaced by a counting run. Each value in its
# own file only.
[[allowlists]]
description = "configseal test-only vector key"
targetRules = ["generic-api-key"]
condition = "AND"
paths = ['''^internal/console/testdata/configseal_vectors\.json$''']
regexes = ['''^xKbVxY32zPtWRkhfwugpfIdsamLLebvaWKnV9WLWQ48=$''']
[[allowlists]]
description = "registrar fixture's placeholder auth code"
targetRules = ["generic-api-key"]
condition = "AND"
paths = ['''^internal/registrar/openprovider/testdata/lookup\.json$''']
regexes = ['''^1a2b3c4d5e6f$''']
# The password 30-minio-contract gives a user of the MinIO it starts on
# loopback for one job and then deletes; the plan that wrote the step
# quotes it.
[[allowlists]]
description = "throwaway MinIO user in the contract step"
targetRules = ["generic-api-key"]
condition = "AND"
paths = [
'''^\.amadan/ci\.d/30-minio-contract$''',
'''^docs/superpowers/plans/2026-10-22-db-region-forward-plan-2-query\.md$''',
]
regexes = ['''^dbfukboxsecret1$''']
# Not values at all: generic-api-key matching the word after "key" in code
# comments and prose (a function name, a header, a review's heading, a
# CLI flag in a list of flags, an env line in a README), and a bucket name
# whose number is an AWS account ID, which identifies and does not
# authenticate.
[[allowlists]]
description = "prose and code the generic rule reads as a key"
regexes = [
'''^ed25519\.Verify$''',
'''^if-none-match=$''',
'''^retry/duplicate$''',
'''^CARLOS_REGION=ie$''',
'''^--enable-primary-ipv6$''',
'''^carlos-flagship-271376211898$''',
]