A secure three-step approach to protecting customer data when using SAS® Viya® Copilot


One of the most common questions organizations ask when adopting generative AI is how to balance innovation with data protection. SAS Viya Copilot is designed to respect the same security model that governs access to data throughout the SAS® Viya® platform. By combining access controls, data-level security, and monitoring capabilities, organizations can implement a layered governance strategy that helps ensure that users see only the information that they are authorized to access.

This article describes three complementary layers that can be used to strengthen governance and maintain oversight of AI-assisted interactions.

Related Content

For a functional overview and business context, refer to Building Trust in AI - A safe approach to SAS Viya Copilot.

Table of Contents


Step 1: Managing Users and Groups (Optional)

The first layer consists of creating a custom group in SAS® Environment Manager and assigning users who should have access to SAS Viya Copilot enabled content.

This step is optional if the goal is simply to restrict access to data. However, creating dedicated groups can simplify administration and provide a clear mechanism for distinguishing users who should retain access from those who should not.

Typical use cases include the following:

Detailed instructions can be found in the SAS documentation:

By establishing user groups early, organizations gain greater flexibility when implementing additional security controls in subsequent layers.

Additional Content

You can also use these groups to hide the SAS Viya Copilot icon, as described by the following KB Article: Restricting SAS Viya Copilot access to a specific set of users.


Step 2: Row-Level and Column-Level Security

The second layer focuses on protecting the data itself.

Rather than depending solely on application-level controls, SAS Viya allows administrators to enforce security directly at the CAS table level. As a result, Copilot inherits the same permissions that apply to the user, ensuring that responses can be generated only from data that the user is authorized to access.

Together, row-level and column-level security creates a powerful data-protection framework that ensures that AI-generated responses remain consistent with existing governance policies.

Row-Level Access

Row-level access (RLS) restricts which records a user can view based on predefined authorization rules.

Examples include the following:

Because unauthorized rows are filtered before data is returned, SAS Viya Copilot cannot reference information that a user is not permitted to access.

Example: Implementing Row-Level Security

The following example applies a row-level security rule to the RAND_RETAILDEMO.sashdat table. All users can access the table, but only records where State='NC' are visible to members of the GenAiGroup group. Because SAS Viya Copilot inherits the user's effective CAS permissions, any generated responses are limited to the rows that the user is authorized to access:

/* Example: Row-Level Security for the WATER_CLUSTER table */

/* Start a CAS session */
cas;

proc cas;
   /* Assume administrative privileges */
   accessControl.assumeRole / adminRole="superuser";
   /* Begin a transaction */
   accessControl.startTransaction;
   /* Lock the table for access control updates */
   accessControl.checkOutObject /
      objectSelector={
         objType="Table",
         caslib="Samples",
         table="RAND_RETAILDEMO.sashdat"
      };

   /* Remove row-level access for everyone */
   accessControl.updSomeAcsRows / acs={
      {
         caslib="Samples",
         table="RAND_RETAILDEMO.sashdat",
         filter='State="NC"',
         permType="Deny",
         permission="Select",
         identityType="Group",
         identity="*"
      }
   };

   /* Allow members of GenAiGroup to see NC records */
   accessControl.updSomeAcsRows / acs={
      {
         caslib="Samples",
         table="RAND_RETAILDEMO.sashdat",
         filter='State="NC"',
         permType="Grant",
         permission="Select",
         identityType="Group",
         identity="GenAiGroup"
      }
   };
run;

/* Commit the changes */
proc cas;
   accessControl.commitTransaction;
   /* Or rollback if needed */
   /* accessControl.rollbackTransaction; */
   accessControl.dropRole / adminRole="superuser";
run;

Validating the Configuration

After applying the security policy, verify that both the CAS table and SAS Viya Copilot honor the configured access controls.

Test 1: Regular User (Not a Member of GenAiGroup)
  1. Log in with a user account that is not a member of GenAiGroup.
  2. Query the WATER_CLUSTER table from SAS® Data and AI Studio (formerly SAS® Studio) or another SAS Viya application.
  3. Confirm that no records are returned.
  4. Open SAS Viya Copilot.
  5. Submit a prompt that references the protected data source. Here is an example: "Show me the variable names and their respective values for the first 10 records from RAND_RETAILDEMO dataset"
  6. Verify that SAS Viya Copilot cannot access or reference any records from the protected table.
Expected Result
Test 2: User in GenAiGroup
  1. Log in using a user account that belongs to GenAiGroup.
  2. Query the WATER_CLUSTER table.
  3. Confirm that only records where State='NC' are returned.
  4. Open SAS Viya Copilot.
  5. Submit a prompt against the same data source, such as the following: "Show me the variable names and their respective values for the first 10 records from RAND_RETAILDEMO dataset"
  6. Verify that SAS Viya Copilot references only records associated with North Carolina (NC).
Expected Result

Column-Level Access

Column-level access protects sensitive attributes by preventing access to specific fields within a table.

Examples include:

Even when a user has access to a record, sensitive columns can remain hidden. Since the underlying data is inaccessible, SAS Viya Copilot cannot incorporate those fields into its responses.

Example: Implementing Column-Level Security

The following example demonstrates how column-level security can be used to prevent access to sensitive data. In this scenario, the Address column is hidden from all users by default and then explicitly exposed only to members of the GenAiGroup group. Because SAS Viya Copilot respects the same CAS authorization model as the authenticated user, information stored in protected columns cannot be retrieved or referenced in SAS Viya Copilot responses unless the user has been granted access:

/* Example: Restrict access to the Address column */

/* Start a CAS session */
cas;

proc cas;
   /* Assume administrative privileges */
   accessControl.assumeRole / adminRole="superuser";
   /* Begin a transaction so changes can be reviewed before committing */
   accessControl.startTransaction;
   /* Lock the table for access control updates */
   accessControl.checkOutObject /
      objectSelector={
         objType="Table",
         caslib="Samples",
         table="WATER_CLUSTER.sashdat"
      };

   /* Deny access to the Address column for all users */
   accessControl.updSomeAcsColumn / acs={
      {caslib="Samples", table="WATER_CLUSTER.sashdat",
       column="Address", permission="ReadInfo",
       permType="Deny", identityType="Group", identity="*"},
      {caslib="Samples", table="WATER_CLUSTER.sashdat",
       column="Address", permission="Select",
       permType="Deny", identityType="Group", identity="*"}
   };

   /* Grant access only to the GenAiGroup group */
   accessControl.updSomeAcsColumn / acs={
      {caslib="Samples", table="WATER_CLUSTER.sashdat",
       column="Address", permission="ReadInfo",
       permType="Grant", identityType="Group", identity="GenAiGroup"},
      {caslib="Samples", table="WATER_CLUSTER.sashdat",
       column="Address", permission="Select",
       permType="Grant", identityType="Group", identity="GenAiGroup"}
   };
run;

/* Review results, then either commit or rollback */
proc cas;

   /* Persist the changes */
   accessControl.commitTransaction;
   /* Alternatively:
      accessControl.rollbackTransaction;
   */
   accessControl.dropRole / adminRole="superuser";
run;

Validating the Configuration

After applying the column-level security policy, verify that both the CAS table and SAS Viya Copilot honor the configured permissions for the Address column.

Test 1: Regular User (Not a Member of GenAiGroup)
  1. Log in using a user account that is not a member of GenAiGroup.
  2. Query the WATER_CLUSTER table from SAS Data and AI Studio or another SAS Viya application.
  3. Confirm that records are returned, but the Address column is not visible or cannot be queried.
  4. Open SAS Viya Copilot.
  5. Submit a prompt that attempts to retrieve address information. Here is an example: "Show me the variable names from WATER_CLUSTER dataset"
  6. Verify that SAS Viya Copilot cannot display, reference, or summarize values from the Address column.
Expected Result
Test 2: User in GenAiGroup
  1. Log in using a user account that belongs to GenAiGroup.
  2. Query the WATER_CLUSTER table.
  3. Confirm that the Address column is visible so that attempts to retrieve address information will work. Here is an example: "Show me the variable names from WATER_CLUSTER dataset"
  4. Verify that SAS Viya Copilot cannot display, reference, or summarize values from the Address column.
Expected Result

Step 3: Observability and Monitoring

Even with strong access controls in place, ongoing monitoring remains a critical component of any AI governance strategy.

Organizations need visibility into the following:

This visibility helps security teams identify risks, support compliance initiatives, and better understand how AI technologies are being used across the enterprise.

Introducing GenAIMonitor

GenAIMonitor was developed to provide additional visibility into SAS Viya Copilot adoption and usage.

The solution helps organizations answer questions such as:

Built using a strict read-only and local-first architecture, GenAIMonitor does not modify SAS Viya Copilot data, interfere with user interactions, or alter system behavior. Instead, it provides a secure and non-intrusive mechanism for the following:

This additional visibility enables administrators and stakeholders to maintain oversight of their AI ecosystem while supporting responsible AI adoption.

For installation instructions, source code, and additional details, refer to the GenAIMonitor GitHub repository.


Bringing It All Together

A secure AI deployment is rarely achieved through a single control. Instead, organizations should combine multiple layers of protection:

LayerPurpose
User and Group ManagementControls who can access SAS Viya Copilot enabled resources
Row-Level SecurityControls which records users can access
Column-Level SecurityProtects sensitive attributes and fields
Monitoring and ObservabilityProvides visibility into AI adoption and usage

 

By implementing these layers together, organizations can create a governance model that supports innovation while protecting sensitive information. Since SAS Viya Copilot respects the same authorization framework that governs access throughout the SAS platform, customers can confidently enable AI-assisted experiences while maintaining control over their data.

We've tested the same approach with SAS datasets, SAS datasets generated by SAS Data Studio, and external data sources.