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
@@ -7,7 +7,7 @@ description: Understand how controls work and how to define them.
7
7
8
8
A Control is a protection rule that evaluates agent interactions (inputs/outputs) and takes action based on configured criteria. It defines when to check, what to check, how to evaluate it, and what to do with the results.
The **Selector** specifies which portion of the step's data to extract and pass to the evaluator for analysis. It uses a path specification to navigate the step object.
80
+
The **Condition** is a recursive boolean tree. Leaf conditions pair a `selector` with an `evaluator`, and composite conditions can combine child conditions with `and`, `or`, and `not`.
81
+
82
+
### Example 1: Leaf condition that checks tool output for PII
83
+
84
+
```json
85
+
{
86
+
"condition": {
87
+
"selector": {
88
+
"path": "output"
89
+
},
90
+
"evaluator": {
91
+
"name": "regex",
92
+
"config": {
93
+
"pattern": "\\b\\d{3}-\\d{2}-\\d{4}\\b"
94
+
}
95
+
}
96
+
}
97
+
}
98
+
```
99
+
100
+
### Example 2: Composite condition with `and` and `not`
101
+
102
+
```json
103
+
{
104
+
"condition": {
105
+
"and": [
106
+
{
107
+
"selector": {
108
+
"path": "context.risk_level"
109
+
},
110
+
"evaluator": {
111
+
"name": "list",
112
+
"config": {
113
+
"values": ["high", "critical"]
114
+
}
115
+
}
116
+
},
117
+
{
118
+
"not": {
119
+
"selector": {
120
+
"path": "context.user_role"
121
+
},
122
+
"evaluator": {
123
+
"name": "list",
124
+
"config": {
125
+
"values": ["admin", "security"]
126
+
}
127
+
}
128
+
}
129
+
}
130
+
]
131
+
}
132
+
}
133
+
```
134
+
135
+
### 2.1 Selector (What to Check Inside a Leaf)
136
+
137
+
Inside a leaf condition, the **Selector** specifies which portion of the step's data to extract and pass to the evaluator for analysis. It uses a path specification to navigate the step object.
81
138
82
139
Field:
83
140
@@ -141,9 +198,9 @@ Common Paths:
141
198
142
199
---
143
200
144
-
##3. Evaluator (How to Check)
201
+
### 2.2 Evaluator (How to Check Inside a Leaf)
145
202
146
-
The**Evaluator** receives the data extracted by the selector and evaluates it against configured rules, returning whether the data matches specified criteria.
203
+
Inside a leaf condition, the**Evaluator** receives the data extracted by the selector and evaluates it against configured rules, returning whether the data matches specified criteria.
147
204
148
205
Components:
149
206
@@ -217,7 +274,7 @@ Agent Control supports custom evaluators for domain-specific requirements. See [
217
274
218
275
---
219
276
220
-
## 4. Action (What to Do)
277
+
## 3. Action (What to Do)
221
278
222
279
The **Action** defines what happens when the evaluator matches/detects an issue.
223
280
@@ -313,13 +370,15 @@ Putting it all together - a control that blocks Social Security Numbers in tool
313
370
"step_types": ["tool"],
314
371
"stages": ["post"]
315
372
},
316
-
"selector": {
317
-
"path": "output"
318
-
},
319
-
"evaluator": {
320
-
"name": "regex",
321
-
"config": {
322
-
"pattern": "\\b\\d{3}-\\d{2}-\\d{4}\\b"
373
+
"condition": {
374
+
"selector": {
375
+
"path": "output"
376
+
},
377
+
"evaluator": {
378
+
"name": "regex",
379
+
"config": {
380
+
"pattern": "\\b\\d{3}-\\d{2}-\\d{4}\\b"
381
+
}
323
382
}
324
383
},
325
384
"action": {
@@ -354,10 +413,12 @@ async with AgentControlClient() as client:
Regex pattern note: the pattern itself is `\b\d{3}-\d{2}-\d{4}\b`. Python raw strings render that as `r"\b\d{3}-\d{2}-\d{4}\b"`, while JSON payloads must escape backslashes as `"\\b\\d{3}-\\d{2}-\\d{4}\\b"`.
461
+
397
462
### Example: Block Toxic Input (Luna-2 AI)
398
463
399
464
To use this evaluator, install the package and restart the server.
@@ -460,4 +529,3 @@ curl -X PUT "http://localhost:8000/api/v1/controls/$CONTROL_ID/data" \
460
529
```
461
530
462
531
> **Note**: For the Luna-2 evaluator, set the `GALILEO_API_KEY` environment variable. See the [Evaluators](/concepts/evaluators/overview) for all available evaluators.
Copy file name to clipboardExpand all lines: concepts/overview.mdx
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Overview
3
-
description: Core concepts behind Agent Control — policies, controls, selectors, evaluators, and actions.
3
+
description: Core concepts behind Agent Control — policies, controls, conditions, selectors, evaluators, and actions.
4
4
---
5
5
6
6
Understanding these core concepts will help you get the most out of Agent Control. Start with the high-level [architecture](/concepts/architecture) to see how components fit together, then dive into [evaluators](/concepts/evaluators/overview) to understand how checks are implemented.
@@ -10,7 +10,7 @@ Understanding these core concepts will help you get the most out of Agent Contro
10
10
A **[Control](/concepts/controls)** is a single rule that defines what to check and what to do when a condition is met.
11
11
12
12
```text
13
-
Control = Scope + Selector + Evaluator + Action
13
+
Control = Scope + Condition + Action
14
14
```
15
15
16
16
Example: "If the output contains an SSN pattern, block the response."
@@ -20,15 +20,19 @@ Example: "If the output contains an SSN pattern, block the response."
0 commit comments