You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/includes/tutorials/secure-agentic-ai-systems.md
+28-30Lines changed: 28 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,19 @@
2
2
3
3
This tutorial guides you through setting up and running a sample application that demonstrates how to secure an agentic AI systems using {{ product_name }}.
4
4
5
-
You will learn how to implement robust security measures for AI agents that operate autonomously or on users' behalf, ensuring all actions are governed by proper authentication, authorization, and fine-grained access control.
5
+
You will learn how to set up robust security measures for AI agents that operate autonomously or on users' behalf, ensuring proper authentication, authorization, and fine-grained access control.
6
6
7
-
## Learning Objectives
7
+
## Learning objectives
8
8
9
9
By the end of this tutorial, you will understand how to:
10
10
11
11
* Configure AI agents as secure, first-class identities in {{ product_name }}.
12
-
*Implement the On-Behalf-Of (OBO) flow for securely delegating user permissions to an agent.
12
+
*Set up the On-Behalf-Of (OBO) flow for securely delegating user permissions to an agent.
13
13
* Set up fine-grained, scope-based access control for all AI agent operations.
14
14
15
-
## System Overview
15
+
## System overview
16
16
17
-
This tutorial uses a hotel booking system to demonstrate how AI agents can securely interact with users and APIs using {{ product_name }}'s identity and access management.
17
+
This tutorial uses a hotel booking system to show how AI agents can securely interact with users and APIs using {{ product_name }}'s identity and access management.
18
18
19
19
### Components
20
20
@@ -27,7 +27,7 @@ The system consists of four main components:
cd iam-ai-samples/hotel-booking-agent-autogen-agent-iam
109
109
```
110
110
111
-
#### 2\. Configure environment variables
111
+
#### 2. Configure environment variables
112
112
113
113
Create a `.env` file in each service directory (for example `assistant-agent`, `backend`, `frontend`). Copy the contents from the corresponding `.env.example` file and update the values with your {{ product_name }} configurations and Gemini API key.
114
114
115
115
-----
116
116
117
-
#### 3\. Run the application
117
+
#### 3. Run the application
118
118
119
119
With the configuration complete, start all services using the provided bash script.
120
120
@@ -126,30 +126,28 @@ This starts all four components on their respective ports. Once the services are
126
126
127
127
-----
128
128
129
-
## Test the flows
129
+
## Try it out
130
130
131
131
Interact with the application to see the security flows in action. This scenario walks you through booking a room with the assistant agent's help and triggering the autonomous agent.
132
132
133
-
### Example Booking Flow
134
-
135
-
1.**Open the AI Assistant**
133
+
1.**Open the AI assistant**
136
134
Open the application at `http://localhost:3000` and open the AI assistant chat window in the bottom right of the screen.
137
135
138
136
{: width="800" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
139
137
140
-
2.**Search for a Room**
141
-
Type a natural language query. The agent is designed to understand dates and locations. For example:
138
+
2.**Search for a room**
139
+
Type a natural language query. The agent can understand dates and locations. For example:
142
140
`I want to book a single room for myself near Colombo from September 2 to 10, 2025.`
143
141
144
142
The agent will search for options and present you with suitable rooms directly in the chat.
145
143
146
144
{: width="800" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
147
145
148
-
3.**Confirm the Booking**
146
+
3.**Confirm the booking**
149
147
After reviewing the options, confirm that you want to book a room by typing:
150
148
`That looks great, please confirm the booking.`
151
149
152
-
4.**Provide Consent for the Agent**
150
+
4.**Provide consent for the agent**
153
151
Once you confirm, the agent will prompt for your approval to make the booking on your behalf. This is a critical security step where the agent requests your explicit permission. Click the **Approve** button that appears in the chat.
154
152
155
153
{: width="800" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
@@ -159,12 +157,12 @@ Interact with the application to see the security flows in action. This scenario
The booking has now triggered the autonomous **Staff Management Agent** in the background. Using its own secure identity, this agent analyzes your profile, checks staff availability, and assigns the most suitable contact person for your stay. You can now see the assigned contact person in your booking details.
@@ -175,25 +173,25 @@ Interact with the application to see the security flows in action. This scenario
175
173
176
174
Let's break down the two distinct security models you just experienced.
177
175
178
-
### Guest Assistant Agent Flow (On-Behalf-Of)
176
+
### Guest assistant agent flow (On-Behalf-Of)
179
177
180
178
When you asked the agent to book a room, it acted as your delegate.
181
179
182
180
1.**Permission Check:** The agent identified it needed the `create_bookings` scope to fulfill the request.
183
-
2.**Consent Request:**Because it was acting for you, it asked for your explicit permission.
181
+
2.**Consent Request:**As the agent acted on your behalf, it asked for your explicit permission.
184
182
3.**OBO Flow Initiation:** Your approval redirected you to {{ product_name }} to authenticate and formally grant consent. {{ product_name }} then generated a *delegated access token*.
185
183
4.**Secure API Call:** The agent used this delegated token to call the Hotel API.
186
184
5.**Token Validation:** The Hotel API validated the token with {{ product_name }}, confirming that the token represents you (`testuser`) and has the required `create_bookings` scope for this specific action. All actions are attributed to your identity for auditing.
187
185
188
-
### Staff Management Agent Flow (Autonomous)
186
+
### Staff management agent flow (Autonomous)
189
187
190
188
After the booking, the staff agent acted independently.
191
189
192
190
1.**Trigger:** The booking creation event automatically triggered the agent.
193
191
2.**Independent Authentication:** The Staff Agent authenticated with {{ product_name }} using its *own* credentials (the ones you configured in Step 1) to get an access token.
194
192
3.**Admin Operations:** Using its token with admin scopes (`admin_read_staff`, `admin_update_bookings`), the agent read your user profile and staff data to assign a contact person.
195
193
196
-
### Token Comparison: A Look Inside the JWT
194
+
### Token comparison: A look inside the JWT
197
195
198
196
The fundamental difference between these flows is encoded directly within the JWT access tokens. By examining key claims, we can see precisely how {{ product_name }} represents identity and delegation.
199
197
@@ -205,9 +203,9 @@ Here is a detailed comparison:
205
203
| :--- | :--- | :--- | :--- |
206
204
|**Identity Represented**| The User | The User (delegated to Agent) | The Agent itself |
207
205
|**Primary Subject (`sub`)**| User's ID | User's ID | Agent's ID |
208
-
|**Delegation (`act`)**| Not present |**Present.** Contains Agent's ID (`act.sub`) | Not present |
206
+
|**Delegation (`act`)**| Not present | Present. Contains Agent's ID (`act.sub`) | Not present |
209
207
|**Auth Type (`aut`)**|`APPLICATION_USER`|`APPLICATION_USER`|`AGENT`|
210
-
|**Scopes**| User's full allowed scopes (for example `read_bookings`) | Subset of user scopes consented to (for example `create_bookings`) | Agent's own scopes (for example `admin_read_staff`) |
208
+
|**Scopes**| User's full allowed scopes (for example `read_bookings`) | Subset of consented user scopes (for example `create_bookings`) | Agent's own scopes (for example `admin_read_staff`) |
0 commit comments