---
id: "web-functions"
type: "guide"
title: "Web Functions (FuncX + AI Profiles)"
summary: "Connect approved FuncX bindings and AI Profile profile/choice slots to research packets, evidence, and diffs without owning the FuncX or model catalogs."
why: "Add grounded answers, comparisons, and audits while keeping Web-Agentic ownership boundaries clear."
audiences: ["developers"]
related: ["research-packet", "search-then-fetch"]
confirmationRequired: false
updatedAt: "2026-08-02T21:27:32.047Z"
---
# Web Functions (FuncX + AI Profiles)

# Web Functions (FuncX + AI Profiles)

Use approved FuncX bindings to analyze sources, synthesize grounded answers, compare subjects, interpret diffs, and audit research — without turning Web-Agentic into a function or model catalog.

## Ownership

- **Web-Agentic** owns evidence, packets, diffs, bindings validation, and surfaces.
- **FuncX** owns function definitions and execution.
- **AI Profiles** owns `profile/choice` resolution, routing, and pricing.
- **Runx** owns arbitrary composition and side effects (rejected as Web-Agentic bindings).

## Binding catalog

Set `WEB_AGENTIC_FUNCTION_BINDINGS` to a JSON file (see `packages/functions/fixtures/example-bindings.json`).

Stored model config must be canonical `profile/choice` strings (for example `research/default`). Never store concrete provider/model ids in bindings.

## Research hooks

`ResearchRequest.functions` may select approved binding ids. The SDK injects hooks only when FuncX mode is not `disabled`:

| Field | Role | Behavior |
|---|---|---|
| `queryPlanBindingId` | `query-plan` | Additive queries; original question preserved; search policy still applies |
| `candidateEvaluateBindingId` | `candidate-evaluate` | Advisory; deterministic selector retains URL/domain/budget control |
| `sourceAnalyzeBindingId` | `source-analyze` | Attaches `source.analysis` |
| `recordEnrichBindingId` | `record-enrich` | Attaches `enriched` without silently overwriting `parsed` |
| `evidenceRankBindingId` | `evidence-rank` | Reorders existing blocks only |

## Surfaces

| Surface | Entry |
|---|---|
| SDK | `client.analyze` / `answer` / `compare` / `analyzeChanges` / `auditResearch` / `listWebFunctions` / `listWebAIProfiles` / `previewWebAIProfile` |
| REST | `POST /analyze`, `/answer`, `/compare`, `/changes/analyze`, `/research/audit`; `GET /web-functions`, `/ai-profiles`; `POST /ai-profiles/preview` |
| CLI | `webagent analyze\|answer\|compare\|audit\|functions list\|profiles list\|profiles preview` |
| MCP | `analyze_web_source`, `answer_from_web`, `compare_web_subjects`, `list_web_functions`, … |
| Playground | FuncX intelligence endpoint group |

## Configuration

| Env | Default | Purpose |
|---|---|---|
| `WEB_AGENTIC_FUNCX_MODE` | `disabled` | `disabled` \| `in-process` \| `rest` |
| `WEB_AGENTIC_FUNCX_BASE_URL` | `http://localhost:6120` | FuncX REST |
| `WEB_AGENTIC_FUNCTION_BINDINGS` | — | Binding catalog path |
| `WEB_AGENTIC_FUNCX_TIMEOUT_MS` | `60000` | Default timeout |
| `WEB_AGENTIC_MAX_FUNCTION_INPUT_BYTES` | `512000` | Hard input cap |
| `WEB_AGENTIC_MAX_FUNCTION_OUTPUT_BYTES` | `512000` | Hard output cap |
| `WEB_AGENTIC_AI_PROFILES_SOURCE` | `auto` | Registry source |
| `PREFER_OPENROUTER` | — | Routing preference |
| `WEB_AGENTIC_AI_ALLOWED_PROVIDERS` | — | Optional allowlist |
| `WEB_AGENTIC_AI_COST_TIER` | — | Optional cost tier |
| `WEB_AGENTIC_AI_COST_CAP_PER_1M` | — | Optional price cap |

## Untrusted web content

Every function envelope sets `untrustedWebContent: true`. Web text lives in data fields only and must not select bindings, models, tools, or policies.