Repository navigation
Expand file tree
/
Copy pathexample-config.yaml
More file actions
178 lines (155 loc) · 4.83 KB
/
Copy pathexample-config.yaml
File metadata and controls
178 lines (155 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Advanced Hook Server Configuration
#
# This file demonstrates all available configuration options.
# The server hot-reloads this file when it changes.
#
# Usage: go run ./examples/contextual_access/advanced_server -config ./examples/contextual_access/advanced_server/example-config.yaml
# Health endpoint configuration
health:
status: healthy # Options: healthy, degraded, unhealthy
# Access control hook configuration
# Determines which tools a user can see/use
access:
default_action: allow # "allow" or "deny" when no rule matches
rules:
# Block a specific user from all tools
- user_id: "blocked-user"
action: deny
reason: "Account suspended"
# Block a specific toolkit
- toolkit: "DangerousToolkit"
action: deny
reason: "Toolkit disabled by admin"
# Block a specific tool
- toolkit: "Email"
tool: "SendBulk"
action: deny
reason: "Bulk email is disabled"
# Allow admin users access to admin tools
- user_id: "~^admin-.*" # Regex: users starting with "admin-"
toolkit: "Admin*" # Glob: toolkits starting with "Admin"
action: allow
# Deny test users from production tools
- user_id: "~^test-.*"
toolkit: "Production*"
action: deny
reason: "Test users cannot access production tools"
# Pre-execution hook configuration
# Runs before a tool is executed - can block or modify the request
pre:
default_action: proceed # "proceed", "block", or "rate_limit"
rules:
# Block emails to certain domains
- toolkit: "Email"
tool: "SendEmail"
input_match: "to contains @blocked.com"
action: block
error_message: "Sending to blocked.com is not allowed"
# Rate limit search requests
- toolkit: "Search"
tool: "WebSearch"
action: rate_limit
error_message: "Too many search requests"
# Modify inputs before execution
- toolkit: "FileSystem"
tool: "WriteFile"
action: proceed
override:
inputs:
base_path: "/sandbox/"
headers:
X-Sandbox-Mode: "true"
# Inject secrets for database tools
- toolkit: "Database"
tool: "*"
action: proceed
override:
secrets:
DB_PASSWORD: "secure-password-123"
DB_HOST: "db.internal:5432"
# Override server routing for test users
- user_id: "test-user"
action: proceed
override:
server:
name: "test-worker"
uri: "http://localhost:9999"
type: "arcade"
# Post-execution hook configuration
# Runs after tool execution - can block or modify the response
post:
default_action: proceed
rules:
# Block failed executions
- success: false
action: block
error_message: "Tool execution failed - response blocked"
# Redact sensitive data from database queries
- toolkit: "Database"
tool: "Query"
action: proceed
override:
output:
data: "[REDACTED]"
row_count: 0
# PII Redaction configuration
# Automatically detects and handles PII in tool responses
pii:
enabled: true
action: redact # "redact" replaces PII with placeholders; "block" rejects the response
# Which PII types to detect
types:
email: true # email@example.com
ipv4: true # 192.168.1.1
ssn: true # 123-45-6789
phone: true # (555) 123-4567
credit_card: true # 4111-1111-1111-1111
date_of_birth: false # 01/15/1990
# Custom PII patterns (regex)
custom:
- name: "employee_id"
pattern: "EMP-\\d{6}"
replacement: "[EMPLOYEE ID REDACTED]"
# A/B and Canary Testing configuration
ab_testing:
enabled: true
# External tool registry for discovering available tools and versions
tool_registry:
base_url: "" # e.g., https://api.example.com
api_key: "" # API key for authentication
# Experiment definitions
experiments:
# Example: canary test for a new search tool version
- name: "search-v2-canary"
enabled: true
toolkit: "Search"
tool: "WebSearch"
mode: canary # "ab" for A/B test, "canary" for gradual rollout
variants:
- name: "stable"
weight: 90
version: "1.0.0"
- name: "canary"
weight: 10
version: "2.0.0"
server:
name: "search-v2"
uri: "http://search-v2.internal:8080"
type: "arcade"
# Example: A/B test comparing two email tool implementations
- name: "email-provider-test"
enabled: false
toolkit: "Email"
tool: "SendEmail"
mode: ab
variants:
- name: "provider-a"
weight: 50
version: "1.0.0"
- name: "provider-b"
weight: 50
version: "1.0.0"
server:
name: "email-alt"
uri: "http://email-alt.internal:8080"
type: "arcade"