Skip to content

AGENTS.md: fix the options section and refresh stale module examples - #3420

Open
repins267 wants to merge 2 commits into
blacklanternsecurity:devfrom
repins267:docs/agents-md-refresh
Open

AGENTS.md: fix the options section and refresh stale module examples#3420
repins267 wants to merge 2 commits into
blacklanternsecurity:devfrom
repins267:docs/agents-md-refresh

Conversation

@repins267

@repins267 repins267 commented Sep 5, 2026

Copy link
Copy Markdown

AGENTS.md: fix the options section and refresh stale module examples

Summary

Two docs-only commits to AGENTS.md. The first fixes a section that sends contributors into a
module that won't load; the second repoints example snippets at modules that still have the
attributes being illustrated.

1. The Options section documents a form BBOT 3.0 rejects

AGENTS.md §Options documented options / options_desc dicts. BBOT 3.0+ refuses to load a module
that declares them. Dropping a module with a legacy dict into bbot/modules/ and running bbot -l:

[CRIT] Module "ztest_legacy" (/path/bbot/modules/ztest_legacy.py:9) declares a legacy `options` dict,
       which is no longer supported in BBOT 3.0+.

Since AGENTS.md is the file you hand contributors — and explicitly tell them to feed to their LLM —
before they write a module, this is the one doc bug that reliably produces a broken first module.

Replaced with the pydantic form actually in use. robots.py is quoted from its current source (it
was already the example in this section), plus a shodan_dns.py example showing sensitive /
mandatory on an API key.

For scale: on dev today, 118 modules use class Config and 6 use the legacy dicts — and those
6 are bbot/modules/templates/* + base.py, where the dicts appear vestigial (concrete modules like
shodan_dns declare their own Config, and their options surface correctly in
--list-module-options). I left those alone — happy to open a separate issue if you'd like them
cleaned up, but that's a code change and your call.

2. sslcert examples no longer match the module

sslcert was reworked in 3.0: it watches HTTP_RESPONSE rather than OPEN_TCP_PORT, and no longer
declares options, _module_threads, filter_event, deps_pip, or deps_apt. AGENTS.md still
cited it for each of those, so those snippets describe attributes the module doesn't have.

Each is repointed to a module that currently has the attribute, keeping the same teaching point:

Section was now
watched_events (OPEN_TCP_PORT) sslcert fingerprintx
_module_threads sslcert (25) iis_shortnames (4)
deps_pip sslcert badsecrets
deps_apt sslcert git_clone
filter_event (False, "reason") sslcert apkpure

Also corrected sslcert's own flags example: it carries safe (which the section immediately above
requires: "Must also include safe, loud, or invasive"), and it reads certs from responses the
scan already fetched rather than connecting to ports itself.

The sslcert citations that are still accurateproduced_events, scope_distance_modifier = 1,
_priority = 2 — are unchanged. Every replacement was verified against the module source on dev.

Notes

  • Docs only; no code, no behavior change.
  • Split into two commits so you can take just the first if you prefer — they're independent.
  • Happy to adjust which modules are used as examples if you'd rather showcase different ones.

AI Use Disclosure

Model: Claude Opus. I hit the options guidance while writing a module, the module wouldn't load, and I used Claude to trace why and to check how widely the doc had drifted from the code. It drafted the edits; I confirmed each one against the source on dev and reproduced the load failure myself before filing.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

The Options section documented `options` / `options_desc` dicts, but BBOT
3.0+ refuses to load a module that declares them:

    [CRIT] Module "..." declares a legacy `options` dict, which is no
    longer supported in BBOT 3.0+.

Since AGENTS.md is what we hand contributors (and their LLMs) before they
write a module, this sent them straight into a module that won't load.

Replaced with the pydantic `class Config(BaseModuleConfig)` form actually
in use -- the robots.py example is that module's current code, plus a
shodan_dns example showing `sensitive` / `mandatory` on an API key.
sslcert was reworked in 3.0 -- it now watches HTTP_RESPONSE instead of
OPEN_TCP_PORT and no longer declares options, _module_threads,
filter_event, deps_pip or deps_apt. AGENTS.md still cited it for all of
those, so several examples described attributes the module doesn't have.

Repointed each to a module that currently has the attribute, keeping the
same teaching point:

  watched_events OPEN_TCP_PORT  sslcert  -> fingerprintx
  _module_threads               sslcert  -> iis_shortnames (4)
  deps_pip                      sslcert  -> badsecrets
  deps_apt                      sslcert  -> git_clone
  filter_event (False, reason)  sslcert  -> apkpure

Also corrected sslcert's own flags example: it carries `safe`, which the
section above requires, and it reads certs from already-fetched responses
rather than connecting to ports itself.

The sslcert citations that are still accurate (produced_events,
scope_distance_modifier, _priority) are unchanged.
@repins267
repins267 force-pushed the docs/agents-md-refresh branch from 464531a to 407d913 Compare September 5, 2026 16:28
@repins267

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

bls-cla-bot Bot added a commit to blacklanternsecurity/CLA that referenced this pull request Sep 5, 2026
@repins267

Copy link
Copy Markdown
Author

recheck

@singlerider
singlerider self-requested a review September 9, 2026 01:44
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90%. Comparing base (dcd7a7a) to head (407d913).

Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #3420   +/-   ##
=====================================
+ Coverage     90%     90%   +1%     
=====================================
  Files        454     454           
  Lines      47081   47081           
=====================================
+ Hits       42316   42322    +6     
+ Misses      4765    4759    -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@singlerider singlerider left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome, and thanks. I checked every claim against dev rather than trusting the description. All of it holds.

The rejection is real: modules.py:800-812 raises, preload() catches at 421 and exits CRITICAL. Leaving the 6 template dicts alone was right, file_filter() at 340-345 means they never reach the rejection. Every example swap matches source, and the sslcert citations you kept are still true.

Nothing blocking. Ship it.

🟢 The Options rewrite fixes the highest-cost doc bug in the file

We hand this file to contributors and tell them to feed it to their LLM, so a wrong example here gets amplified.

Comment thread AGENTS.md
# sslcert.py - connects directly to target ports
flags = ["affiliates", "subdomain-enum", "email-enum", "active", "web"]
# sslcert.py - reads certs from responses the scan already fetched
flags = ["safe", "affiliates", "subdomain-enum", "email-enum", "active", "web"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Catching the missing safe flag was sharp; the section above requires it and the module has it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants