Skip to content

Commit 7d0814f

Browse files
committed
Update docs and tests to use 'when' field instead of 'match' for parameter matching
1 parent 82eb683 commit 7d0814f

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

docs/features/permissions.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ permissions:
4747
allowed: true
4848
source: config
4949
reason: safe doc edits
50-
match:
50+
when:
5151
file_path: "*.md"
5252
expires:
5353
type: never
@@ -164,7 +164,7 @@ permissions:
164164
allowed: true
165165
source: config
166166
reason: safe documentation edits
167-
match:
167+
when:
168168
file_path: "*.md"
169169
expires:
170170
type: never
@@ -211,7 +211,7 @@ Matches any command starting with `git diff ` (e.g., `git diff HEAD`, `git diff
211211
allowed: true
212212
source: config
213213
reason: safe doc edits
214-
match:
214+
when:
215215
file_path: "*.md"
216216
expires:
217217
type: never
@@ -227,7 +227,7 @@ All permissions use the same structure:
227227
allowed: true|false # Whether to allow
228228
source: config|user|skill|safe|default # Where it came from
229229
reason: "description" # Why it was granted (shown in logs)
230-
match: # Optional: parameter-level matching
230+
when: # Optional: parameter-level matching
231231
param_name: "pattern"
232232
expires:
233233
type: never|session_end|turn_end # When it expires
@@ -250,7 +250,7 @@ When multiple permissions could match:
250250
allowed: true
251251
source: config
252252
reason: safe doc edits
253-
match:
253+
when:
254254
file_path: "docs/**/*.md"
255255
expires:
256256
type: never
@@ -262,7 +262,7 @@ When multiple permissions could match:
262262
allowed: true
263263
source: config
264264
reason: safe config edits
265-
match:
265+
when:
266266
file_path: "*.{yaml,yml,json}"
267267
expires:
268268
type: never
@@ -274,7 +274,7 @@ When multiple permissions could match:
274274
allowed: true
275275
source: config
276276
reason: safe short commands
277-
match:
277+
when:
278278
timeout: "30000" # Exact match on timeout parameter
279279
expires:
280280
type: never
@@ -345,15 +345,15 @@ permissions:
345345
allowed: true
346346
source: config
347347
reason: doc updates
348-
match:
348+
when:
349349
file_path: "docs/**/*.md"
350350
expires:
351351
type: never
352352
"edit":
353353
allowed: true
354354
source: config
355355
reason: doc updates
356-
match:
356+
when:
357357
file_path: "docs/**/*.md"
358358
expires:
359359
type: never

docs/network/host-config.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ permissions:
295295
allowed: true
296296
source: config
297297
reason: safe documentation edits
298-
match:
298+
when:
299299
file_path: "*.md"
300300
expires:
301301
type: never
@@ -305,7 +305,7 @@ permissions:
305305
allowed: true
306306
source: config
307307
reason: safe to read docs
308-
match:
308+
when:
309309
file_path: "docs/**/*"
310310
expires:
311311
type: never
@@ -332,7 +332,7 @@ permissions:
332332
allowed: true
333333
source: config
334334
reason: safe documentation edits
335-
match:
335+
when:
336336
file_path: "*.md"
337337
expires:
338338
type: never
@@ -342,7 +342,7 @@ permissions:
342342
allowed: true
343343
source: config
344344
reason: safe doc edits
345-
match:
345+
when:
346346
file_path: "docs/**/*.md"
347347
expires:
348348
type: never
@@ -352,7 +352,7 @@ permissions:
352352
allowed: true
353353
source: config
354354
reason: safe short commands
355-
match:
355+
when:
356356
timeout: "30000" # Exact match on timeout parameter
357357
expires:
358358
type: never
@@ -396,7 +396,7 @@ permissions:
396396
allowed: true
397397
source: config
398398
reason: safe doc edits
399-
match:
399+
when:
400400
file_path: "*.md"
401401
expires:
402402
type: never
@@ -442,15 +442,15 @@ permissions:
442442
allowed: true
443443
source: config
444444
reason: documentation updates
445-
match:
445+
when:
446446
file_path: "docs/**/*.md"
447447
expires:
448448
type: never
449449
"edit":
450450
allowed: true
451451
source: config
452452
reason: documentation updates
453-
match:
453+
when:
454454
file_path: "docs/**/*.md"
455455
expires:
456456
type: never

docs/useful_plugins/tool_approval.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ permissions:
180180
allowed: true
181181
source: config
182182
reason: safe doc edits
183-
match:
183+
when:
184184
file_path: "*.md"
185185
expires:
186186
type: never
@@ -224,7 +224,7 @@ permissions:
224224
allowed: true
225225
source: config
226226
reason: safe doc edits
227-
match:
227+
when:
228228
file_path: "*.md" # Only matches write calls to *.md files
229229
expires:
230230
type: never
@@ -305,15 +305,15 @@ permissions:
305305
allowed: true
306306
source: config
307307
reason: doc updates
308-
match:
308+
when:
309309
file_path: "docs/**/*.md"
310310
expires:
311311
type: never
312312
"edit":
313313
allowed: true
314314
source: config
315315
reason: doc updates
316-
match:
316+
when:
317317
file_path: "docs/**/*.md"
318318
expires:
319319
type: never

tests/integration/test_config_permissions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def test_parameter_matching_with_match_field(tmp_path, monkeypatch):
260260
'allowed': True,
261261
'source': 'config',
262262
'reason': 'safe doc edits',
263-
'match': {
263+
'when': {
264264
'file_path': '*.md'
265265
},
266266
'expires': {'type': 'never'}
@@ -309,7 +309,7 @@ def test_parameter_matching_rejects_non_matching(tmp_path, monkeypatch):
309309
'allowed': True,
310310
'source': 'config',
311311
'reason': 'safe doc edits',
312-
'match': {
312+
'when': {
313313
'file_path': '*.md'
314314
},
315315
'expires': {'type': 'never'}
@@ -360,7 +360,7 @@ def test_glob_pattern_matching_in_match_field(tmp_path, monkeypatch):
360360
'allowed': True,
361361
'source': 'config',
362362
'reason': 'safe doc edits',
363-
'match': {
363+
'when': {
364364
'file_path': 'docs/**/*.md'
365365
},
366366
'expires': {'type': 'never'}

0 commit comments

Comments
 (0)