> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Query and update ServiceNow records from Guild agents

> Connect Guild agents to ServiceNow to query, create, update, and delete records across tables, CMDB, Service Catalog, and attachments.

Integrations · ServiceNow

Guild agents read and write ServiceNow records, browse the Service Catalog, inspect CMDB configuration items, and run aggregate queries across any table. Credentials are injected server-side so agent code never sees the API key. Credential policies let you limit each agent to specific operations, and every request passes through Guild's audit trail.

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use ServiceNow.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect ServiceNow to your first agent.

## What the ServiceNow integration exposes

The tools cover table records (get, list, create, update, delete), aggregate queries (count, sum, average, min, max), attachments (list and get metadata), Service Catalog (search items, get item variables, place orders), and CMDB (list and get configuration items with attributes and relationships). Tools are named with the `servicenow_` prefix. Use [pick()](https://docs.guild.ai/sdk/tools.md#selecting-specific-tools) to include only the tools your agent needs.

## How it works

**1. Open credentials in Guild**

Go to **Access & setup > Credentials** in Guild and click **Connect**. Search for and select **servicenow**.

**2. Paste your API key**

Enter your ServiceNow REST API key into the **API Key** field. Guild stores it and sends it as the `x-sn-apikey` header on every request.

**3. Scope the credential**

Choose whether the credential serves the whole account, one workspace, yourself only, or a single agent. See [Credentials](https://docs.guild.ai/platform/credentials.md) for the full scoping options.

## Why ServiceNow access needs governing

ServiceNow holds incident records, change requests, user data, CMDB assets, and catalog orders. An agent with an unrestricted credential can create, update, or delete records in any table. [Credential policies](https://docs.guild.ai/platform/credential-policies.md) let you write ALLOW and DENY rules that Guild's proxy enforces before any request reaches ServiceNow, limiting agents by operation name or wildcard pattern. You can scope each rule to a specific agent or workspace, so one agent gets read-only access to incidents while another can place catalog orders.

Guild injects the credential server-side after the policy check passes. Agent code, containers, prompts, and state never see the key. You can connect separate credentials at account, workspace, member, or agent scope, and the [security architecture](https://docs.guild.ai/platform/security-architecture.md) records every proxied call, giving you a full audit trail of what each agent did.

## About the ServiceNow integration

Agents can read and write records in any ServiceNow table, including incidents, changes, requests, and users. They can browse and order Service Catalog items, inspect CMDB configuration items and their relationships, and manage attachments. Aggregate queries allow agents to count or summarise records across tables. The integration is `guildai~servicenow`.

## Authentication

* **Type:** API key
* **Header:** Guild sends the key as `x-sn-apikey: <key>`

### Setup

**1. Connect ServiceNow**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **servicenow**, and paste the key into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { ServicenowTools } from "@guildai-services/guildai~servicenow"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You work with ServiceNow.",
  tools: { ...ServicenowTools },
})
```

### Selecting specific tools

Tools are named with the `servicenow_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~servicenow`:

| Tool | What it does |
| - | - |
| `servicenow_aggregate_records` | Count, sum, average, min or max records, optionally grouped. |
| `servicenow_create_record` | Create a record in a table. |
| `servicenow_delete_record` | Delete one record. |
| `servicenow_get_attachment` | Get one attachment's metadata, including its download link. |
| `servicenow_get_catalog_item` | Get a catalog item with its variables (the questions to answer when ordering). |
| `servicenow_get_cmdb_item` | Get a configuration item with its attributes and relationships. |
| `servicenow_get_record` | Get one record by sys\_id. |
| `servicenow_list_attachments` | List attachment metadata, e.g. sysparm\_query=table\_name=incident^table\_sys\_id=. |
| `servicenow_list_catalog_items` | Search Service Catalog items. |
| `servicenow_list_cmdb_items` | List configuration items of a CMDB class. |
| `servicenow_list_records` | Query records in any table with an encoded query. |
| `servicenow_order_catalog_item` | Order a catalog item now. |
| `servicenow_update_record` | Update fields of one record. |

## Frequently asked questions

> [accordion] Can an agent order a Service Catalog item and then track the resulting request record?
>
> Yes. The agent uses `servicenow_order_catalog_item` to place the order and `servicenow_get_record` or `servicenow_list_records` to query the request table for the resulting record by sys\_id or encoded query.

> [accordion] Does the integration support webhook events from ServiceNow?
>
> No. The catalog entry lists no webhook events for this integration, so agents cannot receive push notifications from ServiceNow.

> [accordion] How do I stop an agent from deleting records it should only read?
>
> Add a DENY rule for `servicenow_delete_record` in the credential's [credential policy](https://docs.guild.ai/platform/credential-policies.md). DENY rules take precedence over any ALLOW rule, so the agent cannot delete records even if a broader ALLOW pattern would otherwise match.

> [accordion] Can I give one agent a different ServiceNow account than the rest of my workspace?
>
> Yes. Connect a credential scoped to that agent alone using the **Dedicated to this agent** option on the installed agent's page. Guild picks that credential ahead of any workspace or account credential when that agent runs.

## Put a governed agent on ServiceNow this week

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use ServiceNow.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect ServiceNow to your first agent.

## Related

**Also runs on Guild:** [Asana](https://docs.guild.ai/integrations/asana.md) · [ClickUp](https://docs.guild.ai/integrations/clickup.md) · [Google Calendar](https://docs.guild.ai/integrations/google-calendar.md) · [Jira](https://docs.guild.ai/integrations/jira.md)

**Read:** Docs: [Credential policies](https://docs.guild.ai/platform/credential-policies.md) · [Credentials](https://docs.guild.ai/platform/credentials.md) · [Tools in agents](https://docs.guild.ai/sdk/tools.md)
