Skip to content
Cascading Labs QScrape VoidCrawl Yosoi

Policy

Yosoi policy is the control plane for how a scrape, search, or crawl runs. It covers model selection, fetch behavior, web-search defaults, discovery, output, downloads, crawl limits, telemetry, and trust gates.

A policy is a frozen Pydantic object in Python and a JSON/YAML document on disk. The same shape works in both places.

atom_reads: false
trust_tier: strict
scrape:
fetcher_type: auto
search:
backend: google,bing,brave
region: us-en
safesearch: "moderate"
max_results: 10
output:
formats: [json]
flat_files: false
page:
timeout_seconds: 30

Why policy exists

Yosoi has many knobs, but they are not all contract fields. A contract defines what data means. Policy defines how Yosoi is allowed to get it.

Use policy for:

  • model and provider settings
  • cache and trust gates
  • fetcher and page acquisition behavior
  • web-search provider and regional defaults
  • crawl limits and safety controls
  • output shape and debug artifacts
  • download permissions
  • observability settings

Policy surfaces

SurfaceUse it for
Python ys.Policy(...)Library code, tests, per-call overrides.
Policy.from_env()Legacy env compatibility and secrets.
JSON/YAML policy filesGlobal/project defaults and repeatable CLI runs.
CLI flagsNarrow call-site overrides.

Main sections

SectionPurpose
modelProvider, model name, temperature, token cap, credential reference.
scrapeReplay/discovery behavior for one scrape run.
searchWeb-search provider, backend, region, safesearch, page, and result limit.
pageGeneric page acquisition settings shared by scrape and crawl.
crawlCrawl budget, scheduler, safety, escalation, and targets.
outputTerminal/file output, debug HTML, logs, flat files.
downloadDefault-deny file download side effects.
discoverySelector discovery backend and concurrency.
telemetryLangfuse references and host.
fingerprintOff-path fingerprint signal lane.

Quick commands

uvx yosoi policy init --local
uvx yosoi policy validate .yosoi/policy.yaml
uvx yosoi policy inspect .yosoi/policy.yaml --format yaml
uvx yosoi policy effective --format yaml
uvx yosoi scrape https://example.com --policy .yosoi/policy/20-page.yaml
uvx yosoi search "cascading labs yosoi" --policy .yosoi/policy/search.yaml

Start with Policy Files and Layering & Precedence, then use the section reference pages for individual options.