Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:7onez Cti expert Collect One

From Leeroopedia
Knowledge Sources
Domains OSINT, Web_Collection
Last Updated 2026-10-28 14:00 GMT

Overview

Concrete tool for collecting one host end-to-end through the shared collect_core pipeline with cache-reuse, enrichment, evidence capture, and manifest, provided by the cti-expert harness.

Description

The collect_one function in harness/tools.py is the harness wrapper around collect_core.collect_host — the SAME routine the deterministic pipeline uses. It collects one host end-to-end: cache-reuse check, live fetch + enrichment (WHOIS, recon APIs, TLS probe), evidence capture (DOM, screenshots, Wayback), and the manifest. The wrapper only supplies the harness's config (env knobs, the WebPivot-shim collector, the evidence-manifest callback). It is sync and safe to fan out across threads via collect_many.

The free_only / allow_spend flags enforce per-host consent: free-only on a no-spend case holds metered engines; allow_spend permits spending on the analyst's own typed seeds and an approved enrich host.

Usage

Import this when you need to:

  • Collect a single host from the LLM-driven harness loop.
  • Fan out collection across multiple hosts concurrently (via collect_many).
  • Enforce per-host spend consent (free_only / allow_spend).
  • Shrink the target footprint (no_assets, no_well_known, assets_max, no_docmeta).

Code Reference

Source Location

  • Repository: cti-expert
  • File: intel_engine/harness/tools.py
  • Lines: L407-469

Signature

def collect_one(url: str, case: str, *, hostile: bool = False, passive: bool = False,
                proxy: str | None = None, force: bool = False, no_assets: bool = False,
                no_well_known: bool = False, assets_max: int | None = None,
                no_docmeta: bool = False, docmeta_max: int | None = None,
                free_only: bool = False, allow_spend: bool = False) -> dict[str, Any]:
    """Collect ONE host end-to-end (cache-reuse → live fetch + enrichment → evidence capture →
    manifest) via the shared, single-sourced collect_core.collect_host. Returns a summary dict,
    never raises."""

Import

from harness.tools import collect_one, collect_many

I/O Contract

Inputs

Name Type Required Description
url str Yes Target URL/domain
case str Yes Case ID
hostile bool No Deny direct egress (default False)
passive bool No No direct fetch (default False)
proxy str None Egress proxy
force bool No Re-collect even if cached (default False)
free_only bool No Skip metered engines (default False)
allow_spend bool No Permit spending on this host (default False)
no_assets bool No Turn off JS-bundle asset layer
no_well_known bool No Turn off well-known file probe
assets_max int None Cap assets to collect
no_docmeta bool No Turn off document-metadata layer
docmeta_max int None Cap document metadata

Outputs

Name Type Description
summary dict {host, n_pivots, note, dom, raw_path, skipped, ...} — never raises

Usage Examples

Basic Collection

from harness.tools import collect_one

result = collect_one("https://example.com", "CASE-0001")
print(result["host"], result["n_pivots"])
# Writes cases/CASE-0001/raw/example.com.json

Free-Only Collection on No-Spend Case

# Metered engines (WhoisXML reverse, FOFA, urlscan) are held
result = collect_one(
    "https://example.com", "CASE-0001",
    free_only=True,      # hold metered engines
    passive=True,        # no direct fetch — use cached/archive only
)

Fan-Out via collect_many

from harness.tools import collect_many

# Concurrent fan-out across seeds (mechanical, no LLM)
results = collect_many(
    ["https://a.example", "https://b.example", "https://c.example"],
    "CASE-0001",
    hostile=False,
    max_workers=8,
)

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment