kingfisher / python
AGENTS.md1.3k starsChanged 10 days agoApache-2.0View on GitHub
Guidance for extending and maintaining the Python SDK. - Applies to python/, including the public package, tests, and examples. Follow the repository guidance and any deeper instructions as well. - The native bindings guidance incorporates these principles for the Rust bridge. Consult this guide when shared Rust changes affect Python behavior; shared crates retain their own instructions. - Keep the SDK composable, predictable, and suitable for embedding. Users should be able to supply their own inputs and choose capabilities independently.…
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about mongodb/kingfisher
- A Hacker News story“Show HN: Kingfisher, a fast OSS secret scanner with validation and blast radius”Hacker News · Jan 6, 2026 · 3 points
- oxsecurity/megalinter“Consider adding Kingfisher support”GitHub · Oct 6, 2025 · 1 reactions
- NixOS/nixpkgs“kingfisher: 2.14.0 -> 2.16.0”GitHub · Nov 4, 2026
- hevnsnt/CVEngine“Plan: exposed secrets with Kingfisher (1.4)”GitHub · Nov 1, 2026
- Homebrew/homebrew-core“kingfisher 2.15.0”GitHub · Oct 28, 2026
The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 51
Talked about on GitHub and Hacker News (51 times).
On GitHub · 50
- Oct 6, 2025Consider adding Kingfisher support — oxsecurity/megalinter1 reaction · 7 comments
- Nov 4, 2026kingfisher: 2.14.0 -> 2.16.0 — NixOS/nixpkgs0 reactions
- Nov 1, 2026Plan: exposed secrets with Kingfisher (1.4) — hevnsnt/CVEngine0 reactions
- Oct 28, 2026kingfisher 2.15.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 23, 2026kingfisher: 2.8.0 -> 2.14.0 — NixOS/nixpkgs0 reactions
45 more on GitHub
- Oct 22, 2026[Request]: Kingfisher — ScoopInstaller/Main0 reactions
- Oct 8, 2026kingfisher 2.11.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 6, 2026kingfisher 2.11.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/scripts0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/openshift0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/website0 reactions · 1 comment
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/wllegal0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/weblate_schemas0 reactions · 1 comment
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/weblate0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/wlc0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/munin0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/translation-finder0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/unicode-segmentation-rs0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/language-data0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/siphashc0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/fail2ban0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/meta0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/hosted0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/kotlin-sdk0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/helm0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/docker-base0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/docker-compose0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/graphics0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/fonts0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/docker-dev0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/customize-example0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/docker0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/arsc-writer0 reactions
- Oct 5, 2026[pre-commit.ci] pre-commit autoupdate — WeblateOrg/.github0 reactions
- Oct 4, 2026kingfisher 2.10.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 2, 2026kingfisher 2.9.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 1, 2026kingfisher: 1.113.0 -> 2.8.0 — NixOS/nixpkgs0 reactions · 1 comment
- Sep 29, 2026kingfisher 2.8.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 24, 2026kingfisher 2.7.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 23, 2026kingfisher 2.6.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 18, 2026kingfisher 2.5.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 17, 2026kingfisher 2.4.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 16, 2026kingfisher 2.3.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 9, 2026kingfisher 2.2.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 30, 2026kingfisher 2.1.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 18, 2026Add mongodb/kingfisher as an hk builtin (and decide whether its live-verification network calls belong in a pre-commit hook) — ray-manaloto/knowledge-base0 reactions
- Aug 8, 2026kingfisher 1.112.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 3, 2026[Evaluate] Secret Scanner — JJediny/LocalObserve0 reactions · 1 comment
- Jun 5, 2026[REVIEW] secrets-management: add brokered agent credential and canary-token gates — UnitOneAI/SecuritySkills0 reactions · 3 comments
- Apr 15, 2026Add MongoDB Atlas and connection string detection rules — gitleaks/gitleaks0 reactions
On Hacker News · 1
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- crates/kingfisher-python/AGENTS.mdAGENTS.md
- crates/kingfisher-rules/AGENTS.mdAGENTS.md
- crates/kingfisher-rules/data/AGENTS.mdAGENTS.md
- crates/kingfisher-scanner/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- docs/benchmark/AGENTS.mdAGENTS.md
- docs-site/docs/features/agents.mdAGENTS.md
- docs/viewer/AGENTS.mdAGENTS.md
- javascript/AGENTS.mdAGENTS.md
- src/access_map/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs-site/docs/llms.txtllms.txt
- llms.txtllms.txt
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
21 rules. About 1 is common, 18 are distinctive, and 2 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Keep the SDK composable, predictable, and suitable for embedding.
- Distinctive: line 37
Put Python ergonomics, argument checks, iterator adapters, and composition in the Python package.
- Distinctive: line 47
Prefer small typed functions and configuration objects.
- Distinctive: line 50
Keep convenience classes as thin facades over the same engine and policy configuration.
- Distinctive: line 60
Keep existing behavior as the default.
- Very specific: line 66
Treat exports in kingfisher_sdk.__all__, result objects, iterator behavior, redaction, deduplication state, and reset behavior as …
- Distinctive: line 73
Keep scanning offline. Source acquisition and provider operations must remain explicit.
- Distinctive: line 85
Document the coordinate system for offsets after extraction or normalization.
- Distinctive: line 89
Keep complete per-input findings, including invisible component helpers, together until dependent operations finish.
- Distinctive: line 116
Keep reusable optional capabilities feature-gated in the shared Rust crates.
- Distinctive: line 119
Use private temporary storage and close handles before cleanup.
- Distinctive: line 124
Test externally observable contracts and failure boundaries, including preserved defaults and signatures when relevant.
- Distinctive: line 127
Add focused coverage for new scope semantics, provenance through composition, controls, errors/fallback, grouping, redaction, and state …
- Common: line 131
Keep tests deterministic and portable across supported Python versions, Windows x64/ARM64, macOS, and Linux.
- Very specific: line 134
Use Path/PathBuf and subprocess argument arrays.
- Distinctive: line 148
Run affected shared Rust and CLI regressions when canonical behavior moves or changes.
- Distinctive: line 150
Follow the repository's Windows verification policy for filesystem, Git, and subprocess changes.
- Distinctive: line 155
Every new public capability needs a commented runnable example showing how it composes with existing APIs.
- Distinctive: line 158
Update the SDK guide, package README, capability comparisons, and changelog for user-facing changes.
- Distinctive: line 165
Verify that new modules, native sources, and runnable examples are included in the relevant wheel/source distribution when packaging …
- Distinctive: line 167
Follow publishing guidance for independent SDK/crate versions and compatibility checks.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Guidance for extending and maintaining the Python SDK.
Scope and Purpose
- Applies to
python/, including the public package, tests, and examples. Follow the repository guidance and any deeper instructions as well. - The native bindings guidance incorporates these principles for the Rust bridge. Consult this guide when shared Rust changes affect Python behavior; shared crates retain their own instructions.
- Keep the SDK composable, predictable, and suitable for embedding. Users should be able to supply their own inputs and choose capabilities independently.
- The distribution is
kingfisher-secret-scanner; the public import iskingfisher_sdk. Treat_nativeas the implementation bridge.
Architecture and Ownership
Keep responsibilities separate:
enumeration -> content transforms -> detection -> validation -> reportingRule loading and inspection configure these stages. Revocation is a separate, explicit action; enumeration, detection, and validation must not invoke it.
| Responsibility | Extension point |
| Rules and capability inspection | Public rule APIs backed by the shared rule catalog and loader |
| Input enumeration | Iterators yielding ScanInput or compatible provenance-bearing inputs |
| Content extraction or normalization | Explicit transforms consuming and yielding inputs |
| Detection and detection policies | The shared native scanner and narrowly scoped policy configuration |
| Validation and revocation | Dedicated APIs backed by shared native implementations |
| Reporting | Consumers of finding/result objects and their serialization APIs |
- Put Python ergonomics, argument checks, iterator adapters, and composition in the Python package. Keep the PyO3 bridge focused on conversion, ownership, execution controls, and exposing native capabilities.
- Implement reusable detection, rule loading, extraction, validation, and revocation behavior in the shared Rust crates. Reuse the CLI implementation when the interfaces promise equivalent semantics; keep one canonical engine and catalog rather than independent Python implementations.
- New sources should feed the existing input contract. New transforms should compose with existing enumerators and scanners. Keep acquisition policy, extraction policy, detection policy, and report filtering independently usable.
- Prefer small typed functions and configuration objects. Introduce builders, protocols, registries, or plugin discovery when a concrete extension requires them; do not build a framework around hypothetical providers.
- Keep convenience classes as thin facades over the same engine and policy configuration. Avoid a scanner subclass for every source, format, or capability combination. As policy options grow, consolidate them in a policy object through an additive entry point, preserving existing convenience APIs.
Compatibility and Public Contracts
- Preserve existing public signatures, import paths, positional/keyword behavior, defaults, return types, serialization shapes, and documented exception behavior. Constructor and dataclass fields are part of the public contract.
- Keep existing behavior as the default. Expose new behavior through explicit transforms, methods, configuration entry points, or opt-in facades. An additive feature must not silently widen a source scope or add extraction/network work.
- Existing YAML/TOML rules must work without edits. HTTP fallback execution defaults to off, both primary-reuse booleans default to false, and revocation reuse requires its own explicit opt-in and replacement URL(s). Never fail over mutation targets.
- Treat exports in
kingfisher_sdk.__all__, result objects, iterator behavior, redaction, deduplication state, and reset behavior as user-facing APIs. - Define ordering, grouping, laziness, ownership, and lifetime guarantees. Preserve documented unspecified ordering rather than accidentally promising a new order.
- Preserve the distinction between detection policy and report filtering. Explain whether an option changes native work, removes candidate findings, or filters already-produced results; do not give these operations interchangeable names.
- Keep scanning offline. Source acquisition and provider operations must remain explicit. Preserve the existing revocation confirmation contract and retry semantics; do not add automatic revocation or infer authorization from findings.
Inputs, Results, and Provenance
- Preserve logical source paths for path-aware rules. Keep source metadata with
each result group;
Findingalone does not identify its filename. - Transforms must retain original repository, object, commit, and other provenance while assigning meaningful member paths. Preserve specialized input metadata when replacing or expanding an input; do not reconstruct only base fields.
- Distinguish original container/object identity from scanned content identity. Document the coordinate system for offsets after extraction or normalization.
- Describe the meaning of metadata precisely: a selected occurrence, a target snapshot, or an unknown origin must not imply first introduction or complete history. Use explicit absence/unknown values instead of invented provenance.
- Keep complete per-input findings, including invisible component helpers, together until dependent operations finish. Apply visibility filtering when reporting. Context filters must run before component resolution, catalog deduplication, and redaction when they affect which candidates can participate.
- Exclude payloads, secrets, captures, and potentially secret-bearing messages from default representations. Preserve redaction by default in reporting APIs and examples; opt-in raw serialization must remain explicit.
Resources, Errors, and Concurrency
- Specify the scope of each limit: per operation, per input, per archive root, across nested layers, or over an iterator's lifetime. State when work is eager and when payloads are read lazily.
- Preserve timeout and cancellation behavior across stages. Check controls around expensive native work, release the GIL for native work where appropriate, and document operations that cannot be preempted.
- Propagate cancellation, timeouts, and budget errors. Do not convert them into empty successes or raw-content fallback. Preserve completed groups already yielded, and do not return partial findings for a failed scan.
- Distinguish malformed-input fallback, unsupported formats, best-effort extraction, and strict error propagation. Document internal truncation or skipped entries; a successful extraction is not necessarily complete coverage.
- Preserve scanner reuse and thread safety. Failed/interrupted work must not poison scanner pools or commit successful-scan deduplication state.
- Reuse compiled rules and native execution resources. Avoid repeated payload copies and whole-source materialization unless a capability requires it; bound memory growth and document unavoidable descriptor/metadata preparation.
- Keep reusable optional capabilities feature-gated in the shared Rust crates. The Python distribution may enable them without changing byte-only Rust defaults.
- Source reads and extraction should not mutate caller repositories or files. Use private temporary storage and close handles before cleanup. Parse bytecode and content without executing untrusted source code or archive members.
Tests and Verification
- Test externally observable contracts and failure boundaries, including preserved defaults and signatures when relevant. Start with the narrowest affected tests; documentation-only edits do not require rebuilding native code.
- Add focused coverage for new scope semantics, provenance through composition, controls, errors/fallback, grouping, redaction, and state reuse as applicable. Where parity is promised, compare equivalent inputs and configuration against the shared implementation; do not rely on total finding counts alone.
- Keep tests deterministic and portable across supported Python versions, Windows x64/ARM64, macOS, and Linux. Use local fixtures and mock provider services rather than live credentials, accounts, or network services.
- Use
Path/PathBufand subprocess argument arrays. Account for file locking, separators, line endings, bare/shallow repositories, and Git availability in caller-owned adapters. Native Git APIs should not acquire a Git subprocess dependency implicitly. For binding changes, rebuild the extension before running Python tests. Relevant commands from the repository root include:
uv run maturin develop --locked --profile dev uv run --no-sync pytest python/tests cargo check --locked -p kingfisher-python cargo clippy --locked -p kingfisher-python --all-targets -- -D warnings- Run affected shared Rust and CLI regressions when canonical behavior moves or changes. Check shared-crate default and relevant optional-feature builds.
- Follow the repository's Windows verification policy for filesystem, Git, and subprocess changes. Report unavailable checks and pending platforms explicitly.
Documentation, Examples, and Releases
- Every new public capability needs a commented runnable example showing how it composes with existing APIs. Explain source selection, controls, provenance, limits, and result handling where relevant; keep sample output redacted.
- Update the SDK guide, package README, capability comparisons, and changelog for user-facing changes. Document differences from CLI behavior and existing APIs, including fallback semantics.
- Synchronize affected documentation-site sources using prepare-docs.py, verify local links, and rebuild MkDocs when practical. Update shared-crate/library documentation for exposed Rust APIs as required by their own instructions.
- Verify that new modules, native sources, and runnable examples are included in the relevant wheel/source distribution when packaging changes.
- Follow publishing guidance for independent SDK/crate versions and compatibility checks. Follow the root provenance-regeneration requirements if dependency or manifest changes affect catalog provenance.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

