You can get access to Generative AI Agents resources
with OCI
Identity and Access Management (IAM)
policies.
By default, only users in the Administrators group have access to all OCI resources including Generative AI Agents resources. If you’re a member of another
group, ask your administrator to assign you the least privileges that are required to perform
your responsibilities by reviewing the following sections.
Adding Policies Before You Can Use the Service
Before you use Generative AI Agents, ask your administrator to add the following policies:
Give users access to Generative AI Agents resources such as agents, knowledge bases, data sources, data ingestion jobs, agent sessions, agent work requests, and endpoints
To get access to all Generative AI Agents resources in the entire tenancy, use the following policy:
Copy
allow group <genai-agent-administrators> to manage genai-agent-family in tenancy
To get access to all Generative AI Agents resources in your compartment, use the following policy:
Copy
allow group <genai-agent-administrators> to manage genai-agent-family in compartment <your-compartment-name>
If the data files for your agent are in OCI
Object Storage buckets, you need permission to list and select those files from within the Generative AI Agents service.
To give permission to users to add Object Storage files to their knowledge bases:
Copy
allow group <your-group-name> to manage object-family in compartment <compartment-with-bucket>
Note
If the Object Storage files and agents are in different compartments, ensure that users creating the agents have permission to manage object-family in the compartment with the bucket.
Ask an administrator to review the examples in Securing Object Storage and add policies that apply to you such as policies to avoid accidental deleting of buckets that contain training data.
To ingest large amounts of content from OCI
Object Storage, follow these steps to create resource principals for data ingestion jobs that might run longer than 24 hours.
Follow the steps in Creating a Dynamic Group with the following specifics for the matching rule:
In the Matching Rules section, click Match any rules defined below.
Enter the following matching rule.
Copy
ALL {resource.type='genaiagentdataingestionjob'}
The genaiagentdataingestionjob resource type is the resource principal for data ingestion jobs. The preceding matching rule means that this dynamic group represents the Generative AI Agents data ingestion job resource.
To restrict the dynamic group membership to data ingestion jobs created in a specific compartment, instead of the previous matching rule, use the following one:
Copy
ALL {resource.type = 'genaiagentdataingestionjob',
resource.compartment.id = '<compartment-ocid-for-ingestion-jobs>’}
Allow this dynamic group to access Object Storage objects in a specified compartment.
Copy
allow dynamic-group <dynamic-group-name>
to read objects in compartment <compartment-name-for-objects>
You can further restrict the policies with more conditions. For example:
Copy
allow dynamic-group <dynamic-group-name>
to read objects in tenancy where all {target.compartment.id='<compartment_ocid>’,
target.bucket.name=<bucket-name>,
target.bucket.tag.MyTagNamespace.TagKey='<MyTagValue>'}
You can restrict access to Object Storage, using conditions that include bucket names, compartments, and tags. Restricting access by specifying an object name or prefix in a policy, such as target.object.name isn't supported and the data ingestion job might fail.
Follow the steps in Creating a Dynamic Group with the following specifics for the matching rule:
In the Matching Rules section, click Match any rules defined below.
Enter the following matching rule.
Copy
ALL {resource.type='genaiagent'}
The genaiagent resource type is the resource principal for agents. The preceding matching rule means that this dynamic group represents the Generative AI Agents agent resource.
Allow this dynamic group to access OCI
Vault secrets in the compartment with your Oracle Database vector store or OCI Search with OpenSearch secret.
Copy
allow dynamic-group <dynamic-group-name>
to read secret-bundle in compartment <compartment-name>
If your data is in Oracle Database 23ai, update the dynamic group that you created in the previous section and add another rule to allow this dynamic group to access OCI Database Tools.
Copy
allow dynamic-group <dynamic-group-name>
to read database-tools-family in compartment <compartment-name>
About Generative AI Agents Resource-Types 🔗
Generative AI Agents has the following individual resource-types to use in Identity and Access Management policies. You can assign different permissions to different user groups based on how they can use the following resource types:
genai-agent: An agent
genai-agent-knowledge-base: The knowledge base associated with an
agent.
genai-agent-data-source: The data source associated with a knowledge
base
genai-agent-data-ingestion-job: The job that ingests data from a data
source.
genai-agent-endpoint: An endpoint to access the agent
genai-agent-work-request: The work request for Generative AI Agents operations
genai-agent-session: An agent's chat session
In addition to preceding listed individual resource types, you can use the aggregate resource type, genai-agent-family to include all seven Generative AI Agents resource types in a policy, for example:
allow group <genai-agent-administrators> to manage genai-agent-family in tenancy
Aggregate Resource-Type
Included Individual Resource-Types
genai-agent-family
genai-agent
genai-agent-knowledge-base
genai-agent-data-source
genai-agent-data-ingestion-job
genai-agent-endpoint
genai-agent-session
genai-agent-work-request
Giving Users Granular Permission for Each Resource-Type 🔗
This section lists the permissions for Generative AI Agents operations. The level of access is cumulative as you go from inspect to read to use to manage. For example, if you have permission to manage the genai-agent-endpoint resource-type, then you can list, get details for, create, and delete endpoints. You don't require another permission to inspect the endpoints. Expand each resource-type for its permissions.