Skip to content

Improve Python API agent documentation#1555

Merged
maurosoria merged 4 commits into
masterfrom
python-api-agent-docs
May 29, 2026
Merged

Improve Python API agent documentation#1555
maurosoria merged 4 commits into
masterfrom
python-api-agent-docs

Conversation

@maurosoria
Copy link
Copy Markdown
Owner

@maurosoria maurosoria commented May 29, 2026

Summary

Improve the Python API for agent-controlled scans, expand the Python API documentation into a practical guide, and align CI/package metadata around Python 3.11+.

Changes

  • Expanded docs/python-api.md with agent-oriented examples for custom wordlists, template generation, category-backed templates, callbacks, authenticated sessions, custom match predicates, scan recipes, and limits versus the CLI.
  • Added prompt injection safety guidance for agents handling untrusted response headers, redirects, bodies, JavaScript, and extracted text, including a numbered-line data-boundary pattern.
  • Added public helpers for template/wordlist workflows: WordlistTemplate.from_file(), WordlistTemplate.from_builtin(), Wordlist.from_template(..., max_entries=...), and public WordlistLimitError export.
  • Added FuzzerConfig extension points for advanced library scans: result_predicate, session_factory, and raise_on_error.
  • Raised the supported Python minimum to 3.11 across package metadata, docs, CI, and the PyInstaller build script.
  • Cleaned up existing lint/codespell blockers so the Inspection workflow can run through the Python 3.11/3.14 matrix.
  • Updated README to point users to the full Python API guide.
  • Added regression coverage for the new API helpers and hooks.

Validation

  • Installed-package Python API smoke from outside the checkout, covering public imports, Wordlist, Wordlist.from_file(), template files, built-in templates, category templates, max_entries, callbacks, response fields, redirects, POST/data, result_predicate, session_factory, session closing, and raise_on_error.
  • .venv/bin/python -m unittest tests.core.test_importable_api tests.core.test_dictionary_templates
  • .venv/bin/python testing.py
  • .venv/bin/flake8 $(git ls-files '*.py')
  • .venv/bin/codespell -S CONTRIBUTORS.md,./db/categories/*
  • .venv/bin/python -m pip install .
  • .venv/bin/python tests/check_packaged_install.py && .venv/bin/dirsearch --version
  • .venv/bin/python dirsearch.py -u https://example.com -w tests/static/wordlist.txt -q
  • bash -n pyinstaller/build.sh
  • git diff --check
  • GitHub Actions: Inspection passes on Python 3.11/3.14 across Ubuntu and Windows; Docker, CodeQL, and Semgrep also pass.

@maurosoria maurosoria marked this pull request as ready for review May 29, 2026 12:50
@maurosoria maurosoria merged commit adf993a into master May 29, 2026
13 checks passed
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.

1 participant