AI Assistant
Use the AI Command Builder to create and refine slash commands and code snippets with context-aware suggestions.
Last updated: February 2, 2026
The AI Assistant helps you create slash commands and code snippets using natural language. Describe what you need, and it generates a complete, ready-to-save result — including the right fields, variables, URL structure, or code.
How It Works
Open the AI side panel from the Manage page (available on both the Commands and Snippets tabs). Type a plain-language description of what you want to build:
- "Create a command that searches incidents by short description and assignment group"
- "Write a GlideAggregate snippet that counts open incidents by category"
- "Make a command that opens the UI Builder page for a given experience"
The AI reads your prompt together with whatever you've already typed into the command or snippet editor — so partially filled fields act as context — and generates a complete result. Review the output, adjust if needed, and save it directly.
When your request relates to an SN Utils feature, the assistant automatically pulls in the relevant sections of this documentation, so answers about slash commands, switches, or extension behavior are grounded in how SN Utils actually works.
Choosing a Model
A model dropdown above the chat input lets you pick which AI model handles your requests. Auto (the default) uses whatever the server currently recommends, so a new model can roll out without an extension update. The list currently includes:
- Auto (server default, currently Gemini 3.7 Flash)
- Gemini 3.7 Flash
- Claude Sonnet 5.0
- GPT-5.6
Your choice is remembered across sessions. Generated output is capped at 12,000 tokens per request.
Fast Entry from the Slash Palette
You don't have to open the Manage page first. Two slash commands jump you straight into the AI Builder with your prompt already submitted:
/newcmd <description>— opens the Commands tab, starts the AI on your prompt with the current page (table, view) as context. Example:/newcmd open the caller's user record in a new tab. If you give it a finished artifact instead (a URL, script, fields list, or encoded query), it skips the AI and drops the input into the matching editor field directly — see Custom Commands for the routing table./newsnip <description>— opens the Snippets tab and runs the AI on your prompt. Example:/newsnip GlideAggregate counting incidents by category.
Both commands also work without a description — they just open the editor in the "new" state and let you author from there. On the Free plan the description is prefilled into the editor instead of running the AI, so the same keyboard path still gets you to a useful starting state.
Creating Commands with AI
When building a slash command, the AI generates:
- Command name — A short, descriptive, cloud-syncable trigger
- URL — With the right table, query parameters, and variables
- Hint — A description shown when browsing commands
- Fields — The fields to display in inline results
- Overwrite URL — If the command should open a different page than the list
You can refine the result by providing follow-up instructions, like "add a scope switch" or "include the assignment group in the fields".
Creating Snippets with AI
When building a code snippet, the AI generates:
- Name — A descriptive name for search
- Prefix — A shorthand trigger for quick access
- Category — Script, Client, Server, or Other
- Context — Where the snippet should appear
- Code — Working code with descriptive placeholders
The generated code follows ServiceNow best practices and uses the appropriate API for your chosen context (client-side or server-side).
Tips
- Be specific — The more detail you provide, the better the result. Mention table names, field names, and the behavior you expect.
- Iterate — Use follow-up messages to refine the generated result without starting over.
- Review before saving — Always check the generated code or URL to make sure it matches your intent.
Your Data & Privacy
We know this matters — especially in regulated environments — so here is exactly what leaves your browser when you click Generate in the AI Command Builder.
What is sent
- Your chat prompt — the text you typed in the AI side panel.
- What you have already typed into the editor form on the Manage page, if anything:
- Commands: command name, hint, description, URL/script, fields, overwrite URL, inline-only flag.
- Snippets: prefix, name, description, category, context, and the code in the editor.
- Recent turns of the current chat (up to the last 10 messages) so follow-ups keep context.
- Table field schema (command generation only) — when your command targets a specific table, the builder reads that table's field names, labels, and types from your instance (under your own permissions) so the AI suggests real field names. Schema only — never record values. It is cached locally for 24 hours.
- Your Pro access token, to authenticate the request and count tokens for billing.
Long fields (script, snippet body) are truncated before sending, and the whole prompt is capped at ~3,900 characters.
What is NOT sent
- No ServiceNow record data — no GlideRecord values, no field values from any record.
- No instance URL or user identity from ServiceNow.
- No cookies, session tokens, or authentication from your ServiceNow session — the session token used to read field schema stays between your browser and your own instance.
- No page DOM or browsing history. Tab suggestions in the panel are generated locally in your browser; only the one you explicitly click becomes part of your prompt.
- Nothing is sent passively. A request is made only when you click Generate.
Where it goes
Requests go to snutils.com/api/extension/ai/generate over HTTPS, authenticated with your Pro access token. From there the prompt is forwarded to our LLM provider to produce the response. Processing, retention, and sub-processor details are covered in the Privacy Agreement.
Related
- Custom Commands — Create commands manually
- Creating Snippets — Create snippets manually
- Variables & Helper Methods — URL variables for commands
- Sidekick AI — In-page AI assistant (separate feature, different data flow)
- AI Integration & Data Handling — Integration design and sample payloads for security reviews
- Privacy Agreement — How we handle your data