---
sourceDocument: Brazil Enable AI
sourceDocumentLink: https://www.servicenow.com/docs/r/intelligent-experiences

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Enable AI

ft:clusterId :

    - platai

bundleId :

    - platai

workflow :

    - Platform


---

# Configure runtime security metrics

# Configure runtime security metrics {#ariaid-title1}

Release version: Brazil  
Updated October 27, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read  
Set up a Traceloop connection and API key for prompt injection, offensive content, sensitive data input, and sensitive data anonymized trace data from external AI servers. Review data privacy settings to see which patterns
detect sensitive data in LLM input and output.

## Before you begin

Role required: admin

Install the open-source Traceloop SDK. In a terminal window, run this command:

`pip install traceloop-sdk`

After you install Traceloop SDK, you can
customize the following code to initialize the Traceloop tracer:

    import os from openai
    import OpenAI from traceloop.sdk
    import Traceloop from traceloop.sdk.decorators
    import workflow task

    # Initialize
    Traceloop SDKTraceloop.init(app_name="joke_generation_service", disable_batch=True)
    client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

For more information, see [Traceloop OpenLLMetry for Python](https://www.traceloop.com/docs/openllmetry/getting-started-python).

If you have a domain-separated instance, create an alias with a parent of connection alias sn_ai_security.Traceloop_API. Create one active connection and credential
record under this new alias. The domain of each connection record determines the domain of the runtime metrics it pulls.

## Procedure

1. Configure a trace connection for every external AI system for which you want to show runtime metrics.  
   For more information, see [Configuring trace connections](https://www.servicenow.com/docs/EK3Iw3iPFL6BCuHFHeVTuQ "Collect trace data from AI agents running on supported cloud platforms and monitoring services to generate evaluation metrics, populate AI inventory, and support security monitoring in AI Control Tower.").
2. Generate an API key to authenticate trace data requests from your external AI system.
   1. Navigate to AllConnections \& CredentialsCredentials.
   2. Create credentials of type API Key Credentials.  
      Fill out these fields and select Submit.{#gov-sec-configure-pi-sensitive-metrics__table_ayw_34s_1lc__entry__2}

      | Field | Description |
      |-|-|
      | Name | Traceloop API Key |
      | Applies to | All MID servers |
      | Active | Selected. |
      | Order | 100 |
      | API Key Header | Authorization |
      | API Key Prefix | Bearer |
      | API Key | \<your Traceloop API key\> |
      | Credential alias | Locked. |
      [Table 1. API Key form fields]

      {#gov-sec-configure-pi-sensitive-metrics__table_ayw_34s_1lc}

   {#gov-sec-configure-pi-sensitive-metrics__substeps_fxb_spn_djc}  
   For more information, see [API key credentials](https://www.servicenow.com/docs/access?context=API-key-credential-form&version=brazil&pubname=brazil-platform-security&ft:locale=en-US).
3. Link the API key to your trace connection.
   1. Navigate to AllConnections \& CredentialsConnections.
   2. Create an HTTPS connection with the sn_ai_security.Traceloop_API connection alias and a connection URL of <kbd class="ph userinput">https://api.traceloop.com</kbd>. For more information, see [Create an HTTP(s) connection](https://www.servicenow.com/docs/access?context=create-https-connection&version=brazil&pubname=brazil-platform-security&ft:locale=en-US).

   {#gov-sec-configure-pi-sensitive-metrics__substeps_yjv_lsn_djc}  
   The scheduled job will automatically pull runtime metrics from the linked Traceloop environment.
4. Configure the Traceloop SDK in your agent code by adding these ServiceNow attributes when initializing Traceloop.  
   These are unique user-defined identifiers for tracking.

       Traceloop.init(
           app_name="your_agent_name",
           api_key=traceloop_api_key,
           resource_attributes={
               "sn.aict.system.id": "your_agent_system_id",
               "sn.aict.system.name": "your_agent_name",
               "sn.aict.system.version": "1.0.0",
               "sn.aict.system.source": "your_source"
           }
       )

   For more information about configuring Traceloop in your agent, see [Traceloop - Guardrails](https://www.traceloop.com/docs/evaluators/guardrails).
5. To review data privacy, in AI Control Tower, navigate to SettingsRules and templatesSecurityData Privacy.  
   This section shows the data patterns enabled in Data Privacy to detect and anonymize information in LLM prompts. Use this view as a quick reference when troubleshooting sensitive data charts. This feature requires the Data privacy plugin to be activated. For more information on how the data is sent and stored, see [User data usage policy for Now Assist](https://www.servicenow.com/docs/WIyTQZ52x8p2V69mRZh6_Q "Now Assist is designed to keep user data safe and secure. You can also mask sensitive data or opt-out of sharing data for model improvements.").
6. Return to the AI Control Tower Security tab and refresh the page.  
   Select the Runtime tab and verify that metrics are populated.
{#gov-sec-configure-pi-sensitive-metrics__steps_zxw_34s_1lc}

*[\>]: and then


