AI Integration & Data Handling
Integration design and exact data payloads for SN Utils AI features — written for security reviews and vendor onboarding.
Last updated: June 19, 2026
This page is the integration design reference for the AI features in SN Utils. It is written for security reviewers, procurement, and vendor-onboarding teams who need to know exactly how the extension talks to a Large Language Model (LLM) and what data is included in each request. It complements the high-level Security & Privacy overview and the Privacy & Data Processing Agreement.
Architecture at a Glance
There are two user-facing AI features:
| Feature | Where it runs | What it's for |
|---|---|---|
| Sidekick AI | In-page assistant (Picture-in-Picture) on a ServiceNow tab | Scripting help and platform questions, aware of the current page |
| AI Command Builder | The SN Utils Manage page (an extension page) | Generating slash commands and code snippets from natural language |
Both follow the same integration principle:
ServiceNow tab / Manage page
│ (user clicks Send / Generate)
▼
SN Utils extension ──HTTPS + Bearer token──▶ https://snutils.com/api/extension/ai/*
│
▼
LLM provider (OpenAI / Anthropic / Google)
The extension's Content Security Policy restricts outbound connections to https://*.service-now.com (the user's own instance) and https://snutils.com. There is no LLM-provider host in the allow-list, which makes a direct call impossible by design.
AI Endpoints
| Endpoint | Method | Used by |
|---|---|---|
https://snutils.com/api/extension/ai/sidekick | POST | Sidekick AI |
https://snutils.com/api/extension/ai/generate | POST | AI Command Builder |
Both require a valid Authorization: Bearer <token> header, are served over TLS, stream their responses as Server-Sent Events, and are rate-limited to 50 requests per hour per user.
Sidekick AI — Data Sent
When Sidekick AI is enabled (it is opt-in, off by default), each request contains the chat messages plus a small metadata-only context object describing the current page. No field values or record data are included.
The context object can contain:
- Page type —
form,list,flow,script_editor,workspace,record, orunknown. - Table name — e.g.
incident, when detectable from the page. - Field names — up to 50 field names from the current form or list. System fields (
sys_*,sysparm_*) are filtered out. Names only, never values. - Form view — the view name (e.g.
Default). - URL path — the page path (
location.pathname), so the assistant knows which page you're on. - Instance subdomain — the first label of the hostname (e.g.
dev12345fromdev12345.service-now.com), so the assistant can distinguish between instances. The full hostname is not sent.
Sample Sidekick AI request payload
{
"messages": [
{
"role": "user",
"content": "Write a GlideRecord query for open incidents assigned to me"
}
],
"context": {
"pageType": "form",
"tableName": "incident",
"fieldNames": [
"number",
"short_description",
"state",
"assigned_to",
"priority"
],
"formView": "Default",
"urlPath": "/incident.do",
"hostname": "dev12345",
"tier": "metadata"
},
"model": "claude-sonnet-5"
}
The
hostnamefield carries only the instance subdomain label, not the fully qualified domain. Thetieris fixed tometadatain the current product; a future opt-in "full context" tier would be disabled by default and require explicit consent.
AI Command Builder — Data Sent
The AI Command Builder generates slash commands and snippets. A request contains:
- Your chat prompt — the text typed in the AI panel.
- The contents of the editor form, if you have started filling it in — for commands: name, hint, description, URL/script, fields, overwrite URL, inline-only flag; for snippets: prefix, name, description, category, context, and the code in the editor. Long fields (script / snippet body) are truncated before sending.
- Recent chat turns (up to the last 10 messages) so follow-ups keep context.
- Table field schema (command generation only — see below).
The full prompt is capped at ~3,900 characters client-side.
Table field schema enrichment (command generation)
When you generate a command whose URL targets a detectable table, the builder asks the LLM to use real field names. To do that it reads the table's field dictionary from an open ServiceNow tab — using your existing session and permissions — and includes a compact schema block in the prompt:
- It queries
sys_dictionaryfor the table and its ancestors and sends field name, label, internal type, and the display flag — never any record values. - The lookup runs under the logged-in user's own rights (no elevated access) and the result is cached locally per instance for 24 hours.
- If no ServiceNow tab is available, or the lookup is slow, it is skipped — generation continues without it.
Sample AI Command Builder request payload
{
"prompt": "TABLE METADATA — incident (live from instance)\nDisplay field: number\nAvailable fields (name [type] label):\n- number [string] Number *display*\n- short_description [string] Short description\n- state [integer] State\n- assignment_group [reference] Assignment group\nWhen generating \"fields\", use ONLY names from the list above.\n\nCURRENT COMMAND IN FORM:\n{\n \"command\": \"\",\n \"hint\": \"\",\n \"description\": \"Search incidents by assignment group\",\n \"script\": \"\",\n \"fields\": \"number,short_description\",\n \"overwrite_url\": \"\",\n \"inline_only\": false\n}\n\nUSER REQUEST: search incidents by assignment group and show priority",
"type": "command",
"stream": true,
"messages": [
{
"role": "user",
"content": "Create a command to search incidents by assignment group"
}
],
"model": ""
}
The schema block lists field names, labels, and types only. An empty
modelmeans the server picks the default model.
What Is Never Sent
Across both features, the following never leaves the browser as part of an AI request:
- ServiceNow record data — no
GlideRecordvalues or field values from any record. - Cookies, session tokens, or credentials from your ServiceNow session. (The session token used to read field schema for command generation stays between your browser and your own instance — it is never sent to SN Utils.)
- Attachments or file contents.
- Page DOM beyond the metadata listed above.
- Anything passive — a request is made only when you click Send / Generate.
If you want the AI to reason about a specific value, script, or error message, you paste it into the chat yourself — keeping you in control of exactly what is shared.
Authentication & Transport
- All requests use HTTPS / TLS.
- Requests are authenticated with the user's Pro access token as a
Bearertoken. Tokens live in the browser's extension storage and are never exposed to the ServiceNow page context. - The backend validates the token and the request origin before forwarding anything to a provider.
LLM Providers & Sub-Processors
The backend routes each request to an LLM provider based on the selected model. Providers currently include OpenAI, Anthropic, and Google. Users may pick a model (or leave it on Auto, the recommended default). The list is served by snutils.com, so it can change without an extension update. Current options:
- Auto (server default, currently Gemini 3.7 Flash)
- Gemini 3.7 Flash (Google)
- Claude Sonnet 5.0 (Anthropic)
- GPT-5.6 (OpenAI)
The authoritative list of sub-processors, along with their processing locations and retention terms, is maintained in the Privacy & Data Processing Agreement.
Retention & Logging
- Conversations are not retained as user content. Sidekick chat history lives only in the browser tab's session storage and is cleared when the tab closes; the AI Command Builder chat is kept in memory and cleared when you switch away.
- For operational and abuse-prevention purposes the backend keeps a short request log (feature, model, outcome, duration, token counts, and a truncated prompt snippet). It does not store full conversations.
- The table field-schema cache (names/labels/types only) lives in the browser's local extension storage with a 24-hour expiry.
Turning AI Off (Organization & Per-User Controls)
Account owners and admins can disable AI features centrally from the team Settings page, without touching any other functionality. This lets a team keep SN Utils Pro while switching off the LLM-backed features to satisfy a security or procurement requirement.
- Organization default — one toggle turns AI off (or on) for everyone on the account. This is the default that applies to every licensed user.
- Per-user override — each licensed user can be set to Default (follow the organization setting), On, or Off, so you can allow or block individual people regardless of the organization default.
The setting is delivered to the extension on its regular license heartbeat, so a change takes effect the next time the extension checks in. AI is enabled by default — accounts that never set a policy behave exactly as before.
Controls Summary
| Control | Behavior |
|---|---|
| Availability | Pro only; AI code is stripped from the free build |
| Organization AI switch | Admins can disable AI for the whole account from the team Settings page |
| Per-user AI override | Admins can set individual users to Default / On / Off |
| Enforcement | Server-side (endpoints reject blocked requests); extension also hides the entry points |
| Sidekick AI | Opt-in, off by default |
| Trigger | Explicit user action only — nothing sent in the background |
| Direct LLM access from extension | None — all traffic proxied through snutils.com |
| Record data to LLM | Never |
| Rate limit | 50 requests/hour/user |
Related
- Security & Privacy — High-level security overview
- Privacy & Data Processing Agreement — Sub-processors, retention, legal terms
- AI Assistant — Using the AI Command Builder
- Sidekick AI — Using the in-page assistant