Role masking for AI agents
Summarize
Summary of Role masking for AI agents
Role masking for AI agents and agentic workflows in ServiceNow enhances security by restricting the roles that AI agents use during execution. This ensures AI agents operate with the least-access privileges necessary, reducing the risk of unauthorized access or errors caused by excessive permissions. Without role masking, AI agents inherit all roles of the triggering user, potentially granting broader access than needed. Role masking confines the agent’s runtime roles to only those required for its specific tools and tasks, improving auditability and minimizing security risks.
Show less
How Role Masking Works
- Role masking limits execution roles to the intersection between the invoking user’s roles and a predefined approved roles list.
- Administrators can configure AI components to run as either an AI user or a dynamic user:
- If running as an AI user, the agent has all roles assigned to that AI user, enabling elevated access but without role masking.
- If running as a dynamic user, role masking can be applied to restrict roles accordingly.
- Role masking is not available for agentic workflows or AI agents configured to run as AI users.
Prerequisites
- ServiceNow Now Assist for Platform version 10.0.2-SS or later.
- snaia.admin privileges to configure role masking.
Dynamic Role Addition
Roles can be added individually to an AI agent’s role masking configuration via the Agent Access Role Configuration form. Each role creates a separate record in the Agent Access Role Mapping table, enabling different Business Units to customize role access for the same AI agent independently. This modular setup helps maintain clear separation of role management across teams and use cases.
Benefits for ServiceNow Customers
- Improved security by enforcing least privilege access for AI agents.
- Reduced risk of unintended data exposure or unauthorized actions by AI-driven workflows.
- Greater control and flexibility in managing AI agent permissions across multiple Business Units.
- Enhanced auditability and compliance through clearly defined and limited AI agent role sets.
Role masking for AI agents and agentic workflows helps administrators enhance security by limiting the roles those agents use during tool execution, and by verifying that AI agents run with least-access privileges.
An AI agent runs tools, queries data, and updates records on behalf of the user who triggered it. Without role masking, the agent inherits all of the triggering user's session roles, which can give the agent more access than its specialty requires.
Role masking lets you restrict the AI agent's runtime role set to only the roles needed for the agent's tools and tasks. By limiting the role set, you reduce the blast radius of any prompt-driven error or misuse, and you make the agent's behavior easier to audit.
Role masking rules
- Role masking limits the roles with which an agentic workflow, AI agent or Skill can execute to the intersection between the roles assigned to the invoking user and the roles included in the role masking approved roles list.
- AI user vs Role mask:
The AI admin can choose for the component to run as either an AI user or a dynamic user. If set to run as a dynamic user, the AI admin can configure role masking for the component. Role masking can't be configured for agentic workflows or AI agents set to run as AI users.
- If an AI user is selected, all roles assigned to the AI user are available to the agentic workflow or AI agent. This can be used to provide elevated access to the agentic workflow AI agent.
- If Role masking is applied to an agentic workflow, AI agent, or tool running as a dynamic user, the component runs with roles with roles limited to the intersection of the current invoking user's roles and the roles included in the role masking approved roles list.
To know more about AI agent role masking, see Role masking in Now Assist AI agents.
Prerequisites
To configure role masking on your ServiceNow instance, you must have:
- Now Assist for Platform version 10.0.2-SS.
- The sn_aia.admin privileges.
Dynamic role addition
You can add multiple roles to an AI agent's role masking configuration as individual records, rather than as a single delimited list. Each role you add through the embedded list on the Agent Access Role Configuration form creates a record in the Agent Access Role Mapping table.
role_list column continues to operate as expected. All new role configurations is implement through the sys_agent_access_role_mapping table.This design supports the common case where different Business Units can use the same AI agent. The agent is shipped with a minimum set of roles, and each Business Unit can add the specific roles based on their use case. Since each role is a separate record in the table, Business Units can add and remove their own role entries independently, without affecting the role entries owned by other teams. To know more about the configuration, see Configure role masking for an AI agent.