
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@cafitac/ai-crawler
Advanced tools
AI-driven network-first crawler compiler for authorized workflows.
ai-crawler turns captured network evidence into reusable crawler recipes. The browser is used as a short-lived probe for API discovery, not as the crawling engine. Bulk collection runs through deterministic HTTP replay with curl-cffi.
Browser is not the crawler. Browser is the probe.
AI is not the request loop. AI is the planner/debugger/recipe author.
ai-crawler is an early-stage Python OSS library and CLI for building crawler recipes from network evidence.
It focuses on:
git clone https://github.com/cafitac/ai-crawler.git
cd ai-crawler
uv sync --extra dev --extra http --extra mcp
If you are already inside a local checkout:
uv sync --extra dev --extra http --extra mcp
For npm-first onboarding, the repo also ships a thin Node wrapper that delegates to the Python core:
npx @cafitac/ai-crawler --help
npx @cafitac/ai-crawler auto evidence.json --json
npx @cafitac/ai-crawler mcp
Wrapper behavior:
uv run --project <repo> ai-crawler ...gitHead, otherwise falls back to uvx --from "git+https://github.com/cafitac/ai-crawler.git[all]" ai-crawler ...AI_CRAWLER_PYTHON_SPECAI_CRAWLER_UVX_PYTHONThe one-command path from URL to crawler artifacts is:
uv sync --extra browser --extra http
uv run --extra browser --extra http ai-crawler compile https://example.com/products --goal "collect products" --json
compile opens the page briefly, records normalized network response events into evidence.json, generates a recipe, tests it, repairs extraction when possible, retests, and writes final JSONL output. The browser is only used for discovery; the generated recipe and final crawl use deterministic HTTP replay. By default, probe evidence keeps replay-friendly fetch/xhr 2xx/3xx responses and drops static assets, failed responses, and other browser noise.
If you want to inspect or edit evidence before compiling, split the flow:
uv run --extra browser ai-crawler probe https://example.com/products --goal "collect products"
uv run --extra browser ai-crawler probe https://example.com/products --goal "collect products" --wait-ms 2500 --max-events 50 --include-resource-type fetch,xhr,document
uv run --extra http ai-crawler auto evidence.json --json
If you already have an evidence file, the main AI-harness command is:
ai-crawler auto evidence.json --json
With a local checkout:
uv run --extra http ai-crawler auto evidence.json --json
This writes default artifacts:
evidence.json # browser probe evidence, if generated by probe
recipe.yaml # initial generated recipe
repaired.recipe.yaml # repaired/final recipe
test.jsonl # initial diagnostic crawl output
crawl.jsonl # final crawl output
auto.report.json # stable machine-readable report
The JSON report includes:
command_type (compile or auto)failure_phase for quick triage (probe, generate, final_test, or empty on success)phase_diagnostics for probe -> generate -> initial_test -> repair -> final_testsuccess, extraction_failed, http_error, no_response, challenge_detected, probe_failed, and no_endpoint_candidatesIn --json mode, stdout is reserved for one machine-readable JSON object. Human-readable failures are written to stderr. Exit code 2 still writes auto.report.json so agents can inspect the failure.
Create evidence with a short browser probe:
uv run --extra browser ai-crawler probe https://example.com/products --goal "collect products" --output evidence.json
The probe tuning options are available on both probe and compile:
--wait-ms: browser settle time after network idle (default: 1000)--max-events: maximum replay candidates retained after filtering (default: 200)--include-resource-type: comma-separated Playwright resource types to retain (default: fetch,xhr)Minimal evidence JSON:
{
"target_url": "https://example.com/products",
"goal": "collect products",
"events": [
{
"method": "GET",
"url": "https://example.com/api/products?page=1",
"status_code": 200,
"resource_type": "fetch"
}
]
}
Generate and run manually:
uv run --extra browser --extra http ai-crawler compile https://example.com/products --goal "collect products" --json
Or run each artifact step yourself:
uv run --extra http ai-crawler generate-recipe evidence.json
uv run --extra http ai-crawler test-recipe recipe.yaml
uv run --extra http ai-crawler repair-recipe recipe.yaml
uv run --extra http ai-crawler test-recipe repaired.recipe.yaml --output crawl.jsonl
Generate client config snippets for local uv-project usage. For copy-paste examples across CLI/MCP/SDK flows, also see docs/harness-examples.md.
uv run ai-crawler mcp-config --client hermes --project /path/to/ai-crawler
uv run ai-crawler mcp-config --client claude-code --project /path/to/ai-crawler
uv run ai-crawler mcp-config --client codex --project /path/to/ai-crawler
Generate npm-first snippets for the published wrapper:
uv run ai-crawler mcp-config --client hermes --launcher npm
Run as a stdio MCP server:
uv run --extra mcp --extra http ai-crawler mcp
Exposed tools:
compile_urlauto_compilegenerate_recipetest_reciperepair_recipeIf you prefer npm-first installation for agent tooling, the wrapper can also launch the MCP server:
npx @cafitac/ai-crawler mcp
Hermes development snippet shape:
mcp_servers:
ai-crawler:
command: "uv"
args: ["run", "--project", "/path/to/ai-crawler", "--extra", "mcp", "--extra", "http", "ai-crawler", "mcp"]
timeout: 300
connect_timeout: 60
Hermes npm-first snippet shape:
mcp_servers:
ai-crawler:
command: "npx"
args: ["-y", "@cafitac/ai-crawler", "mcp"]
timeout: 300
connect_timeout: 60
The Python SDK remains the stable embedded/programmatic surface. The npm package is only a launcher wrapper around this Python core. See docs/harness-examples.md for copy-paste SDK, MCP, and published-wrapper examples.
npm publishing is automated with .github/workflows/npm-publish.yml.
npm-v0.1.2workflow_dispatchpackage.json, pyproject.toml, and src/ai_crawler/__init__.py agree on the release version before publishnpm-v<package.json version>docs/release-runbook.md for the full version bump, tagging, and post-publish smoke checklistExample tag flow:
git tag npm-v0.1.2
git push origin npm-v0.1.2
from ai_crawler import AICrawler
crawler = AICrawler()
result = crawler.auto("evidence.json")
print(result.ok)
print(result.exit_code)
print(result.report)
compile_result = crawler.compile_url("https://example.com/products", goal="collect products")
print(compile_result.report["command_type"])
For tests or embedded usage, inject a fake fetcher:
crawler = AICrawler(fetcher=my_fake_fetcher)
Fast local lint/type checks while iterating:
bash scripts/check-python.sh
Full project verification:
bash scripts/verify-ai-harness.sh
MCP auto_compile fixture smoke test:
uv run --extra http python scripts/smoke-mcp-auto-compile.py
This starts a local fixture HTTP site and verifies generate -> test -> repair -> retest without external internet, a real browser, or a real LLM.
ai-crawler is intended for authorized crawling, internal QA/testing, research, owned or allowed web property monitoring, and data portability workflows.
It does not implement:
Challenge-like responses are classified and surfaced as requiring human/manual handoff where appropriate.
Sensitive values in diagnostic reports are redacted, including common bearer tokens, cookies, session IDs, API keys, and JSON-embedded token fields.
Development docs live under .dev/:
.dev/README.md.dev/03-ai/auto-harness-contract.md.dev/04-mcp/server.md.dev/08-operations/security-and-compliance.md.dev/08-operations/challenge-handling-policy.mdAlpha. The deterministic recipe compiler, one-command compile flow, browser probe CLI, CLI, SDK facade, MCP server, redaction, failure classification, and fixture smoke tests are implemented. Real LLM provider integrations are intentionally optional/future layers behind adapter boundaries.
MIT
FAQs
npm delivery wrapper for the ai-crawler Python CLI
We found that @cafitac/ai-crawler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.