Connect a ServiceNow Instance
In this guide, you will connect a ServiceNow instance to Turbot Guardrails. The connection enables bi-directional sync between your ServiceNow CMDB and the Guardrails platform. You can import ServiceNow resources into Guardrails and push cloud resource data back into ServiceNow.
Connecting a ServiceNow instance involves two phases: preparing your ServiceNow environment with the required credentials, then importing the instance through the Guardrails Create Connection wizard.
Prerequisites
Turbot/OwnerorTurbot/Adminpermissions in the Guardrails workspace.- Administrator access to your ServiceNow instance.
- The
@turbot/servicenowmod installed in your Guardrails workspace. See Install a Mod.
Step 1: Create a ServiceNow Application
Guardrails uses an application scope in ServiceNow to isolate Guardrails-related configuration (Business Rules, System Properties, etc.) from your other applications. You can use an existing application or create a new one.
To create a new application:
- Log into your ServiceNow instance as an administrator.
- Navigate to System Applications > Custom Applications (or search for "Custom Applications" in the All menu).
- Click New to create a new application.

- Enter a name for the application (e.g.,
Guardrails). Leave the Scope field empty. ServiceNow auto-generates it on save. - Click Submit.

- Note the Scope value (e.g.,
x_1553127_guardrai). You will need this when connecting the instance in Guardrails.
Step 2: Create a Service Account
Guardrails authenticates to ServiceNow using a dedicated service account. Creating a separate account provides clear audit trails and scoped permissions.
- Navigate to User Administration > Users (or search for "Users" in the All menu).
- Click New to create a new user.
- Fill in the fields:
| Field | Value |
|---|---|
| User ID | guardrails_svc (or a name that fits your naming convention) |
| First name | Guardrails |
| Last name | Service Account |
| Active | Checked |

- Click Submit to create the user.
- Open the newly created user record and click Set Password. Generate or set a strong password and save it securely. You will need it when connecting in Guardrails.
- Click the Roles tab and click Edit. Add the
adminrole and click Save.
[!NOTE] We recommend the
adminrole for initial setup to avoid access constraints. Your team can evaluate more restrictive roles once the integration is working.
Step 3: Create an OAuth Application
Guardrails uses OAuth 2.0 (Resource Owner Password Credentials flow) to generate bearer tokens for API calls to ServiceNow.
- Navigate to System OAuth > Application Registry (or search for "Application Registry" in the All menu).
- Click New and select Create an OAuth API endpoint for external clients.
- Fill in the fields:
| Field | Value |
|---|---|
| Name | Guardrails OAuth Application |
| Accessible from | All application scopes |
| Active | Checked |
| Refresh Token Lifespan | Default or per your preference |
| Access Token Lifespan | Default or per your preference |

- Click Submit to create the OAuth application.
- Note the Client ID and Client Secret. You will need both when connecting in Guardrails.
Step 4: Create a User Preference Row
Guardrails requires a row in the User Preferences table for the service account. There are two ways to create it:
Option A: Log into the ServiceNow instance as the service account. ServiceNow automatically creates the required row.
Option B: Manually create the row:
- In the All menu, search for User Preferences.
- Click New in the top right corner.
- Set the Name field to
apps.current_app. - Look up the service account in the User field.
- Click Submit. If ServiceNow requires a Value, any placeholder string will work. Guardrails updates it automatically.
Step 5: Open the Create Connection Wizard
Navigate to Accounts and click Create Connection. Select ServiceNow from the provider grid.

The wizard opens to Step 1: Credentials.
Step 6: Enter ServiceNow Credentials
Fill in the credentials from the previous steps:
| Field | Description |
|---|---|
| Instance URL | The full URL of your ServiceNow instance (e.g., https://dev12345.service-now.com). |
| Username | The User ID of the service account you created. |
| Password | The password for the service account. |
| Client ID | The Client ID from your OAuth application. |
| Client Secret | The Client Secret from your OAuth application. |
| Application Scope | The scope identifier from your custom application (e.g., x_1553127_guardrai). |

Click Continue to proceed.
Step 7: Test the Connection
Click Test Connection to verify that Guardrails can authenticate and communicate with your ServiceNow instance. Guardrails validates the credentials, discovers the instance name and version, and lists installed applications.

If the test succeeds, you will see the instance name, version, and number of applications discovered. Click Continue.
[!NOTE] If the test fails, verify that your Instance URL is correct, the service account is active with the
adminrole, the OAuth application is active, and the Client ID/Secret are correct.
Step 8: Choose the Destination Folder
Select where to place the ServiceNow instance in your Guardrails resource hierarchy. You can select the root Turbot level or any existing folder.

Click Continue to proceed.
Step 9: Review and Create the Connection
Review your configuration. The summary shows your credentials (with passwords and secrets masked), instance details from the test step, and the destination folder.

Click Create Connection to import the ServiceNow instance. Guardrails creates the instance resource, stores your credentials as policies, and begins discovering resources.
Step 10: Verify the Import
After the import completes, Guardrails navigates to the instance overview page. You will see the instance name, controls being initialized, and policies being set.

The ServiceNow > Config > * policies are now set for your instance. Under the Policies tab, you can see the stored credentials and configuration.
Next Steps
- Enable ServiceNow to Guardrails Sync, Import Applications, Cost Centers, and Users from ServiceNow into Guardrails.
- Enable Guardrails to ServiceNow Sync, Push cloud resources from Guardrails into ServiceNow CMDB tables.
- Discover Custom Tables, Extend visibility to any ServiceNow table.
Troubleshooting
| Issue | Solution |
|---|---|
| Test connection fails with authentication error | Verify the service account is active, has the admin role, and the password is correct. Check that the OAuth application is active with the correct Client ID and Secret. |
| Test connection fails with network error | Verify the Instance URL is correct and accessible from the Guardrails workspace. Check for any firewall or network restrictions. |
| Instance is hibernating | ServiceNow developer instances hibernate after inactivity. Wake the instance by logging in through the ServiceNow portal, then retry the test. |
| App Scope Valid shows "No" | This is informational. It means the specified application scope was not found among the discovered applications. The import will still succeed. The scope is used to isolate Guardrails-managed objects (Business Rules, System Properties) in your ServiceNow instance. |
| Controls stuck in TBD | After import, controls take a few minutes to initialize. If they remain in TBD after several minutes, check the Activity tab for errors. |