Codumentor logo Codumentor Enterprise

Web Retrieve

Gives the agent a web_retrieve tool to fetch web pages (and some documents) and, optionally, analyze them.

HTML is converted to text; PDF, DOCX, and XLSX are extracted when possible. Only http/https URLs are allowed.

Configuration

plugins:
  - module: codumentor.plugins.webretrieve
    class: WebRetrievePlugin
    args:
      enabled: true
      timeout: 30
      max_urls: 5
      max_chars_per_url: 30000
      max_content_length: 500000
      target_agents: "main"
      js_rendering_mode: "default"
ParameterDefaultDescription
enabledtrueEnable the plugin.
timeout30Request timeout in seconds.
max_urls5Maximum URLs per call.
max_chars_per_url30000Maximum characters returned per URL.
max_content_length500000Maximum raw response size per URL, in bytes.
max_subagent_iterations15Iteration cap for the subagent that answers a prompt. It does not inherit agent.max_iterations.
target_agents"main""main", "subagent", or "all".
js_rendering_mode"default"How JavaScript-rendered pages are handled (see below).
enable_js_rendering—Deprecated. true → optional, false → disabled.

Destination policy (all editions)

Both web_retrieve and its fetch_urls follow-up tool only connect to public
unicast destinations by default. Loopback, private, link-local, shared address
space, multicast and other non-public addresses are blocked, including embedded
IPv4 in IPv6 and ambiguous numeric host spellings. DNS results are checked at
connection time and pinned to the socket; every redirect is checked again, with
a maximum of five hops. These checks also cover binary-document HEAD probes and
rendered pages' frames, workers and subresources. Chrome cannot open network
connections itself; HTTP(S) requests are fulfilled by the checked server client.

Intranets require explicit top-level operator configuration, not plugin args
or a tool argument:

web:
  egress:
    allow_private: []  # default; e.g. ["10.20.0.0/16", "fd12:3456::/48"]

Entries must be canonical CIDRs. Use narrow ranges: allowing a loopback range also
allows services on that range, including debugging endpoints. Untrusted discovered
project overlays cannot set this section. The policy is read per fetch, supports
configuration hot reload, and scopes cached results, so removing an exception does
not reuse content cached under the broader policy. Proxy environment variables,
URL credentials and cookies are not forwarded. Rendered pages do not support
service workers or direct WebSocket connections.

URL provenance and approval

Both web_retrieve and the research subagents' fetch_urls declare a non-shell
web_fetch permission request. After operator/user deny rules and Plan mode,
fetches need no prompt when each exact scheme/host/path/query URL comes from:

Adding or changing a query makes a new URL. Query-bearing page/workspace links
are not trusted, and their query-less variants are not invented. URLs in tool
arguments, arbitrary assistant prose, search queries/snippets, and synthetic
subagent tasks do not establish provenance. Evidence lasts for the conversation,
is reconstructed from stored human turns and harness-written tool metadata, and
is shared with that conversation's research subagents, never other conversations.
All URLs in a batch must qualify; a deny rule for any one URL denies the batch.

A novel URL is denied with feedback in Auto, without a judge call; **Accept
edits and Ask prompt**. Bypass retains its explicit bypass behavior below deny
floors. A conversation-wide Always allow grant does not cover future novel URLs;
use a deliberate prefix or WebFetch(...) approval rule instead. Sealed shell
allowances never apply to these server-side requests. Destination filtering still
runs after permission approval, including cached-result policy separation.

Operator prefix example (a deliberate exception that can carry queries):

web:
  egress:
    allow: ["https://docs.python.org/", "https://registry.npmjs.org/"]

Personal prefixes use the authenticated user's settings record
plugin_settings.web.egress.allow, for example a settings update body of
{"plugin_settings": {"web": {"egress": {"allow": ["https://docs.example/"]}}}}.
Prefixes must be absolute HTTP(S) URLs and cannot match another authority such
as docs.example.evil. Personal prefixes never override operator/user deny rules
or destination restrictions. There is no dedicated prefix editor yet.

JavaScript rendering

Needs a Chromium-family browser on the host (Chrome, Edge, or Chromium). If the mode is not disabled and no browser is found, the plugin logs install instructions and falls back to disabled. Set CODUMENTOR_CHROME_PATH if the browser is not on the usual path.

ModeBehavior
defaultRender JS unless the agent sets render_js=false.
optionalStatic fetch unless the agent sets render_js=true. Incomplete-looking pages get a hint to retry with JS.
disabledNever render JS; no render_js argument.

Users can override the mode (and turn the plugin off) in Settings → Extensions → Web Retrieve. A personal setting wins over YAML.

Tool: web_retrieve

ArgumentRequiredDescription
urlsyesOne URL or a list (capped by max_urls).
promptnoIf set, run agentic analysis of the pages.
render_jsnoPresent when mode is default or optional.

Truncated simple-mode results suggest calling again with a prompt. Successful fetches are cached for 5 minutes so repeated hits on the same URL stay consistent.

Notes