forked from wardgate/wardgate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yaml.example
More file actions
391 lines (363 loc) · 14.7 KB
/
config.yaml.example
File metadata and controls
391 lines (363 loc) · 14.7 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
server:
listen: ":8080"
base_url: "http://localhost:8080" # Base URL for links in notifications
admin_key_env: WARDGATE_ADMIN_KEY # Env var for admin key (enables Web UI at /ui/)
# grants_file: grants.json # Path to dynamic grants file (default: grants.json)
logging:
max_entries: 1000 # Max log entries to keep in memory for dashboard (default: 1000)
store_bodies: false # Store request bodies in logs (default: false, for privacy)
# =============================================================================
# SENSITIVE DATA FILTERING (global defaults)
# =============================================================================
# Filtering is enabled by default to prevent agents from seeing OTP codes,
# verification links, and API keys. Configure per-endpoint to override.
filter_defaults:
enabled: true
patterns:
- otp_codes # OTP/verification codes (e.g., "Code: 123456")
- verification_links # Email verification/password reset URLs
- api_keys # Common API key formats (sk-..., ghp_..., etc.)
- ssn # Common SSN formats
- passport # Common passport number formats
action: block # block | redact | ask | log
replacement: "[SENSITIVE DATA REDACTED]"
# =============================================================================
# JWT AGENT AUTHENTICATION (optional)
# =============================================================================
# Instead of static keys, agents can authenticate with signed JWTs.
# The JWT "sub" claim is used as the agent ID. Standard "exp" handles expiry.
# Both modes coexist -- static keys are checked first, JWT as fallback.
#
# server:
# jwt:
# secret_env: WARDGATE_JWT_SECRET # env var holding HMAC signing secret
# # secret: "inline-secret" # or inline (for dev only)
# # issuer: "my-orchestrator" # optional: validate "iss" claim
# # audience: "wardgate" # optional: validate "aud" claim
# Agents can be added manually below, or via CLI: wardgate agent add <id>
agents:
- id: agent-name
key_env: WARDGATE_AGENT_KEY
# Notification settings for "ask" workflow
notify:
timeout: "5m" # How long to wait for approval
# slack:
# webhook_url: "https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
# webhook:
# url: "https://your-webhook.example.com/notify"
# headers:
# Authorization: "Bearer your-token"
# =============================================================================
# PRESETS DIRECTORY
# =============================================================================
# Presets are loaded from YAML files. The presets/ directory contains
# pre-configured presets for popular APIs. See docs/presets.md for details.
# Load presets from the presets directory (required for using presets)
presets_dir: ./presets
# =============================================================================
# CUSTOM PRESETS (optional)
# =============================================================================
# Define your own presets inline, or add YAML files to presets_dir.
# Or define inline custom presets
# custom_presets:
# my-internal-api:
# description: "My Company Internal API"
# upstream: https://api.internal.company.com/v1
# auth_type: bearer
# capabilities:
# - name: read_data
# description: "Read resources"
# rules:
# - match: { method: GET }
# - name: create_resources
# description: "Create new resources"
# rules:
# - match: { method: POST, path: "/resources" }
# - name: delete_resources
# description: "Delete resources"
# rules:
# - match: { method: DELETE }
# =============================================================================
# CONCLAVES (remote execution environments)
# =============================================================================
# Conclaves are isolated environments that run wardgate-exec and connect
# to wardgate via WebSocket. Agents execute commands on conclaves through
# wardgate, which enforces policy and logs everything.
#
# Each conclave needs:
# - A key for authentication (stored in env var)
# - Policy rules (same syntax as endpoint exec rules)
# - A wardgate-exec instance running on the conclave host
# conclaves:
# # --- Command templates (recommended for most use cases) ---
# # Define pre-made commands that agents invoke by name.
# # The agent only provides arguments; the command shape is fixed.
# # Use: wardgate-cli run <conclave> <command> [args...]
#
# obsidian:
# description: "Obsidian vault (personal notes)"
# key_env: WARDGATE_CONCLAVE_OBSIDIAN_KEY
# agents: [agent-name] # Optional: restrict to specific agents (omit for all)
# cwd: /data/vault
#
# # Output filtering - scan stdout/stderr for sensitive data before returning
# filter:
# enabled: true
# patterns: [api_keys, passwords, private_keys]
# action: block # block, redact, or log (not ask - command already ran)
#
# commands:
# search:
# description: "Search notes by filename"
# template: "find . -iname {query}"
# args:
# - name: query
# description: "Filename pattern (e.g. *.md)"
# filter:
# enabled: false # filenames only, no sensitive data
# grep:
# description: "Search note contents"
# template: "rg {pattern}"
# args:
# - name: pattern
# description: "Text pattern to search for"
#
# # --- Standard file tools (scripts/file_*.py) ---
# # Install scripts to /usr/local/lib/wardgate-tools/ in your conclave.
# # See examples/file-tools-commands.yaml for the full set.
# #
# # Path args support two layers of control:
# # type: path + allowed_paths - hard boundary (rejects immediately)
# # rules - policy (allow/ask/deny per path)
# read:
# description: "Read a note (numbered lines)"
# template: "python3 /usr/local/lib/wardgate-tools/file_read.py {file}"
# args:
# - name: file
# description: "Path to note file"
# type: path
# allowed_paths: ["notes/**", "config/**"]
# rules:
# - match: { file: "notes/**" }
# action: allow
# - match: { file: "config/**" }
# action: ask
# # no catch-all -> unmatched paths default deny
# read-raw:
# description: "Read a note (raw content)"
# template: "python3 /usr/local/lib/wardgate-tools/file_read.py {file} --raw"
# args:
# - name: file
# description: "Path to note file"
# type: path
# allowed_paths: ["notes/**", "config/**"]
# rules:
# - match: { file: "notes/**" }
# action: allow
# - match: { file: "config/**" }
# action: ask
# create:
# description: "Create a new note (fails if exists)"
# template: "python3 /usr/local/lib/wardgate-tools/file_create.py {file} {content}"
# args:
# - name: file
# description: "Path for new note"
# type: path
# allowed_paths: ["notes/**"]
# - name: content
# description: "Note content"
# action: ask
# update:
# description: "Replace entire note contents"
# template: "python3 /usr/local/lib/wardgate-tools/file_update.py {file} {content}"
# args:
# - name: file
# description: "Path to existing note"
# type: path
# allowed_paths: ["notes/**"]
# - name: content
# description: "New note content"
# action: ask
# patch:
# description: "Replace exact text in a note"
# template: "python3 /usr/local/lib/wardgate-tools/file_patch.py {file} {old_text} {new_text}"
# args:
# - name: file
# description: "Path to the note file"
# type: path
# allowed_paths: ["notes/**"]
# - name: old_text
# description: "Exact text to find"
# - name: new_text
# description: "Replacement text"
# action: ask
# insert:
# description: "Insert text at location in a note"
# template: "python3 /usr/local/lib/wardgate-tools/file_insert.py {file} {text}"
# args:
# - name: file
# description: "Path to note file"
# type: path
# allowed_paths: ["notes/**"]
# - name: text
# description: "Text to insert (appends to end)"
# action: ask
# # Optional: also allow raw exec with policy rules
# # allow_redirects: false # Default: false. Set true to allow >, >>, <, etc.
# # rules:
# # - match: { command: "cat" }
# # action: allow
# # - match: { command: "*" }
# # action: deny
#
# # --- Raw exec with policy rules (for more flexibility) ---
#
# code:
# description: "Development environment"
# key_env: WARDGATE_CONCLAVE_CODE_KEY
# cwd: /workspace/project
# rules:
# - match: { command: "git", args_pattern: "^(status|log|diff|show|branch)" }
# action: allow
# - match: { command: "git", args_pattern: "^(push|commit|rebase)" }
# action: ask
# - match: { command: "rg" }
# action: allow
# - match: { command: "make" }
# action: allow
# - match: { command: "setup-dev.sh" }
# action: ask
# - match: { command: "*" }
# action: deny
# =============================================================================
# ENDPOINTS
# =============================================================================
endpoints:
# ---------------------------------------------------------------------------
# USING PRESETS (recommended)
# ---------------------------------------------------------------------------
# See docs/presets.md for all presets, capabilities and examples.
todoist:
preset: todoist
description: "Todoist API (Personal)" # Optional: shown in discovery API for agents
# agents: [agent-name] # Optional: restrict to specific agents (omit for all)
auth:
credential_env: WARDGATE_CRED_TODOIST_API_KEY
capabilities:
read_data: allow
create_tasks: allow
close_tasks: allow
update_tasks: ask
delete_tasks: deny
# ---------------------------------------------------------------------------
# MANUAL CONFIGURATION (for custom APIs or advanced use)
# ---------------------------------------------------------------------------
# See docs/config.md for full configuration reference.
# custom-api:
# upstream: https://api.example.com/v1
# auth:
# type: bearer
# credential_env: WARDGATE_CRED_CUSTOM_API
# rules:
# - match: { method: GET }
# action: allow
# - match: { method: POST, path: "/allowed-endpoint" }
# action: allow
# - match: { method: "*" }
# action: deny
# ---------------------------------------------------------------------------
# DYNAMIC UPSTREAMS (agent chooses target per-request)
# ---------------------------------------------------------------------------
# The agent sets X-Wardgate-Upstream header; Wardgate validates against the
# allowed_upstreams glob patterns. Useful for multi-host APIs (e.g., Google).
# See docs/config.md#dynamic-upstreams for details.
# google-apis:
# allowed_upstreams:
# - "https://*.googleapis.com"
# auth:
# type: bearer
# credential_env: WARDGATE_CRED_GOOGLE
# rules:
# - match: { method: GET }
# action: allow
# - match: { method: "*" }
# action: deny
# ---------------------------------------------------------------------------
# LLM API with SSE streaming filter
# ---------------------------------------------------------------------------
# SSE streams (text/event-stream) are filtered per-message in real time.
# Set sse_mode: passthrough to skip filtering on trusted SSE endpoints.
# openai:
# upstream: https://api.openai.com/v1
# auth:
# type: bearer
# credential_env: WARDGATE_CRED_OPENAI
# filter:
# enabled: true
# patterns: [api_keys]
# action: redact
# sse_mode: filter # "filter" (default) or "passthrough"
# rules:
# - match: { method: POST, path: "/chat/completions" }
# action: allow
# - match: { method: "*" }
# action: deny
# ---------------------------------------------------------------------------
# IMAP (email reading) - using preset
# ---------------------------------------------------------------------------
# mail-read:
# preset: imap
# upstream: imaps://imap.gmail.com:993 # Override with your server
# auth:
# credential_env: WARDGATE_CRED_IMAP # format: user@gmail.com:app-password
# capabilities:
# list_folders: allow
# read_inbox: allow
# mark_read: ask
# # Filter sensitive data (OTPs, verification links) - enabled by default
# # filter:
# # enabled: true
# # action: block
# ---------------------------------------------------------------------------
# IMAP for OTP inbox (filtering disabled to allow agent to read codes)
# ---------------------------------------------------------------------------
# mail-otp:
# preset: imap
# upstream: imaps://imap.gmail.com:993
# auth:
# credential_env: WARDGATE_CRED_IMAP_OTP
# capabilities:
# list_folders: allow
# read_inbox: allow
# filter:
# enabled: false # Allow OTP codes for automated account creation
# ---------------------------------------------------------------------------
# SMTP (email sending) - using preset
# ---------------------------------------------------------------------------
# mail-send:
# preset: smtp
# upstream: smtps://smtp.gmail.com:465 # Override with your server
# auth:
# credential_env: WARDGATE_CRED_SMTP # format: user@gmail.com:app-password
# capabilities:
# send_email: ask
# # Optional: additional SMTP controls (see docs/config.md)
# # smtp:
# # from: "your-email@gmail.com"
# # known_recipients:
# # - "@company.com"
# # ask_new_recipients: true
# ---------------------------------------------------------------------------
# SSH (remote execution) - using preset
# ---------------------------------------------------------------------------
# prod-server:
# preset: ssh
# ssh:
# host: prod.example.com
# port: 22
# username: deploy
# known_host: "prod.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA..."
# auth:
# credential_env: WARDGATE_SSH_KEY_PROD
# capabilities:
# exec_commands: ask # require human approval for every command