Privacy & data captured
The SDK sends what your tools receive. It does not guess what's sensitive: there is no built-in redaction list and argument values are never scanned. You decide what leaves the browser.
Pageviews for Visitors are different: they carry no cookie and no identifier, and the server keeps neither the IP address nor the user agent. With them go counts and timings of how the page was used, to tell agents from people (agentSignals), never what was typed or clicked on. See How visitors are counted.
What is sent
| Field | Default | Limits | How to control it |
|---|---|---|---|
| Tool name, status, duration, page URL | Always | — | disabled: true turns the SDK off |
| Tool descriptors (description, schema, annotations) | Always | — | — |
| Arguments | On, as-is | Strings cut at 1,000 chars, arrays at 100 items, 6 levels deep. Over 8 KB becomes a 1,000-char preview | redactKeys, captureArgs, site setting |
| Results | Off | Stringified, cut at 2,000 chars | captureResults (true or a function), site setting |
| Error message | On, for failed calls | Cut at 1,000 chars | captureErrors (false or a function), site setting |
Error name (TypeError) | On, for failed calls | 100 chars | — |
track() props | On | Same as arguments | redactKeys |
tool_call.error webhook. If your tools take such fields, redact them with one of the options below.redactKeys
Replaces the value of any matching key with "[redacted]", at any depth, in arguments and track() props.
AgentStats.init({ key: 'al_pub_…', redactKeys: ['email', 'phone', 'password'] })
Matching is case-insensitive and by substring, so 'email' also covers user_email and billingEmail.
'token' would also redact max_tokens.captureArgs as a function
For full control per tool, pass a function. Whatever it returns is stored, and redactKeys is not applied on top. Return undefined to store nothing for that call.
AgentStats.init({
key: 'al_pub_…',
captureArgs: (tool, args) => {
if (tool === 'login') return undefined // never store
if (tool === 'checkout') return { items: args.items.length }
return args
},
})
Error messages
A failed call's message is what explains the failure, so it's kept by default. It can also carry data: a database tool's error often contains the values that failed, as in Key (email)=([email protected]) already exists. redactKeys doesn't apply to messages. Pass captureErrors: false to keep none (the call still counts as failed, with the error name), or a function to decide per call. It gets { tool, message, name, code, error } and returns the text to keep, or null for none.
AgentStats.init({
key: 'al_pub_…',
captureErrors: ({ tool, message, code }) => {
if (tool === 'run_query') return code ? `SQLSTATE ${code}` : 'Query failed'
return message
},
})
Results
Results are off by default. captureResults: true keeps them as they are; a function keeps what it returns, or nothing for undefined:
AgentStats.init({
key: 'al_pub_…',
captureResults: (tool, result) => tool === 'run_query' ? { rows: result.rows.length } : undefined,
})
A captureArgs, captureResults or captureErrors function that throws keeps nothing for that call, and never affects the tool.
Server-side switches
Project settings → General → Website tracking has three switches under WebMCP tools: Keep tool arguments, Keep error messages and Keep tool results. Turn one off and the server drops that field on arrival, whatever the SDK sends. Use them to stop storing data without redeploying.
Cookies, IPs and origins
- The browser SDK sets no cookies and doesn't fingerprint. Events carry no IP address.
- A site key only accepts events from pages on the site's domain and its subdomains. To use other hosts, such as staging or
localhost, add them under Project settings → General → Allowed websites. - The server integration can set a short-lived
_al_vcookie, but only for AI agents browsing with a real browser, never for humans. See Verification.