forked from docker/docker-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent-schema.json
More file actions
2004 lines (2004 loc) · 77.8 KB
/
agent-schema.json
File metadata and controls
2004 lines (2004 loc) · 77.8 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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/docker/docker-agent/blob/main/agent-schema.json",
"title": "Docker Agent Configuration",
"description": "Configuration schema for Docker Agent v8",
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "Configuration version",
"enum": [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"
],
"examples": [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"
]
},
"providers": {
"type": "object",
"description": "Map of custom provider configurations. Providers define reusable defaults (base_url, token_key, api_type) that models can reference.",
"additionalProperties": {
"$ref": "#/definitions/ProviderConfig"
}
},
"agents": {
"type": "object",
"description": "Map of agent configurations",
"additionalProperties": {
"$ref": "#/definitions/AgentConfig"
}
},
"models": {
"type": "object",
"description": "Map of model configurations",
"additionalProperties": {
"$ref": "#/definitions/ModelConfig"
}
},
"mcps": {
"type": "object",
"description": "Map of reusable MCP server definitions. Define MCP servers here and reference them by name from agent toolsets to avoid duplication.",
"additionalProperties": {
"$ref": "#/definitions/MCPToolset"
}
},
"rag": {
"type": "object",
"description": "Map of reusable RAG source definitions. Define RAG sources here and reference them by name from agent toolsets to avoid duplication.",
"additionalProperties": {
"$ref": "#/definitions/RAGToolset"
}
},
"metadata": {
"$ref": "#/definitions/Metadata",
"description": "Configuration metadata"
},
"permissions": {
"$ref": "#/definitions/PermissionsConfig",
"description": "Tool permission configuration for controlling tool approval behavior"
}
},
"additionalProperties": false,
"definitions": {
"ProviderConfig": {
"type": "object",
"description": "Configuration for a model provider. Defines reusable defaults that models can inherit by referencing the provider name. Supports any provider type (openai, anthropic, google, amazon-bedrock, etc.).",
"properties": {
"provider": {
"type": "string",
"description": "The underlying provider type. Defaults to \"openai\" when not set. Supported values: openai, anthropic, google, amazon-bedrock, dmr, and any built-in alias (requesty, azure, xai, ollama, mistral, etc.).",
"examples": [
"openai",
"anthropic",
"google",
"amazon-bedrock"
]
},
"api_type": {
"type": "string",
"description": "The API schema type to use. Only applicable for OpenAI-compatible providers.",
"enum": [
"openai_chatcompletions",
"openai_responses"
],
"default": "openai_chatcompletions",
"examples": [
"openai_chatcompletions",
"openai_responses"
]
},
"base_url": {
"type": "string",
"description": "Base URL for the provider's API endpoint. Required for OpenAI-compatible providers, optional for native providers.",
"format": "uri",
"examples": [
"https://router.example.com/v1"
]
},
"token_key": {
"type": "string",
"description": "Environment variable name containing the API token. If not set, requests will use the default token for the provider type.",
"examples": [
"CUSTOM_PROVIDER_API_KEY",
"ANTHROPIC_API_KEY"
]
},
"temperature": {
"type": "number",
"description": "Default sampling temperature for models using this provider.",
"minimum": 0,
"maximum": 2
},
"max_tokens": {
"type": "integer",
"description": "Default maximum number of tokens for models using this provider."
},
"top_p": {
"type": "number",
"description": "Default top-p (nucleus) sampling parameter.",
"minimum": 0,
"maximum": 1
},
"frequency_penalty": {
"type": "number",
"description": "Default frequency penalty.",
"minimum": -2,
"maximum": 2
},
"presence_penalty": {
"type": "number",
"description": "Default presence penalty.",
"minimum": -2,
"maximum": 2
},
"parallel_tool_calls": {
"type": "boolean",
"description": "Whether to enable parallel tool calls by default."
},
"provider_opts": {
"type": "object",
"description": "Provider-specific options passed through to the underlying client.",
"additionalProperties": true
},
"track_usage": {
"type": "boolean",
"description": "Whether to track token usage by default."
},
"thinking_budget": {
"description": "Default reasoning effort/budget for models using this provider. Can be an integer token count or a string effort level.",
"oneOf": [
{
"type": "integer",
"description": "Token budget for reasoning"
},
{
"type": "string",
"description": "Effort level (e.g., \"low\", \"medium\", \"high\", \"none\", \"adaptive\")"
}
]
},
"task_budget": {
"description": "Default total-token budget for an agentic task (forwarded to Anthropic as `output_config.task_budget`, with the required `task-budgets-2026-03-13` beta header attached automatically). Configurable on any Claude model — docker-agent does not gate by model name — but at the time of writing only Claude Opus 4.7 honors it. Accepts an integer token count or an object {type: tokens, total: N}.",
"oneOf": [
{
"type": "integer",
"minimum": 0,
"description": "Token budget for the full task (combined thinking, tool calls, and output)."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["tokens"],
"description": "Budget kind. Only \"tokens\" is supported today."
},
"total": {
"type": "integer",
"minimum": 0,
"description": "Total budget value."
}
},
"required": ["total"],
"additionalProperties": false
}
]
}
},
"additionalProperties": false
},
"AgentConfig": {
"type": "object",
"description": "Configuration for a single agent",
"properties": {
"model": {
"type": "string",
"description": "Model to use for this agent (can be just model name or provider/model format)",
"examples": [
"gpt-4",
"openai/gpt-4o",
"anthropic/claude-sonnet-4-0",
"anthropic/claude-sonnet-4-5",
"claude"
]
},
"fallback": {
"$ref": "#/definitions/FallbackConfig",
"description": "Fallback model configuration for automatic failover and retry behavior"
},
"description": {
"type": "string",
"description": "Description of the agent"
},
"welcome_message": {
"type": "string",
"description": "Optional welcome message to display when the agent starts"
},
"toolsets": {
"type": "array",
"description": "List of toolsets available to the agent",
"items": {
"$ref": "#/definitions/Toolset"
}
},
"instruction": {
"type": "string",
"description": "Instructions for the agent"
},
"code_mode_tools": {
"type": "boolean",
"description": "Enable Code Mode for tools"
},
"sub_agents": {
"type": "array",
"description": "List of sub-agents. Can be names of agents defined in this config, external references (OCI images like 'namespace/repo' or URLs), or named external references using 'name:reference' syntax (e.g. 'reviewer:agentcatalog/review-pr'). External agents without an explicit name are named after their last path segment.",
"items": {
"type": "string"
}
},
"handoffs": {
"type": "array",
"description": "List of agents this agent can hand off the conversation to. Can be names of agents defined in this config, external references (OCI images like 'namespace/repo' or URLs), or named external references using 'name:reference' syntax (e.g. 'reviewer:agentcatalog/review-pr'). External agents without an explicit name are named after their last path segment.",
"items": {
"type": "string"
}
},
"add_date": {
"type": "boolean",
"description": "Whether to add date information"
},
"add_environment_info": {
"type": "boolean",
"description": "Whether to add environment information"
},
"max_iterations": {
"type": "integer",
"description": "Maximum number of iterations",
"minimum": 0
},
"max_consecutive_tool_calls": {
"type": "integer",
"description": "Maximum consecutive identical tool calls before the agent is terminated. Prevents degenerate loops. 0 uses the default of 5.",
"minimum": 0
},
"max_old_tool_call_tokens": {
"type": "integer",
"description": "Maximum number of tokens to keep from old tool call arguments and results. Older tool calls beyond this budget will have their content replaced with a placeholder. Tokens are approximated as len/4. Set to -1 to disable truncation (unlimited tool content). Default: 40000.",
"minimum": -1
},
"num_history_items": {
"type": "integer",
"description": "Number of history items to keep",
"minimum": 0
},
"add_prompt_files": {
"type": "array",
"description": "List of prompt files to add",
"items": {
"type": "string"
}
},
"commands": {
"description": "Named prompts for /commands. Supports simple string format or advanced object format with description and instruction.",
"oneOf": [
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string",
"description": "Simple command format: the string becomes the instruction"
},
{
"$ref": "#/definitions/CommandConfig"
}
]
}
},
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string",
"description": "Simple command format: the string becomes the instruction"
},
{
"$ref": "#/definitions/CommandConfig"
}
]
}
}
}
]
},
"structured_output": {
"type": "object",
"description": "Structured output configuration for constraining model responses to a specific JSON schema. Supported by OpenAI (native) and Google Gemini (native). Anthropic requires prompt engineering or tool-based approaches.",
"properties": {
"name": {
"type": "string",
"description": "Name of the response format schema"
},
"description": {
"type": "string",
"description": "Optional description of what the schema represents"
},
"strict": {
"type": "boolean",
"description": "Enable strict schema adherence (OpenAI only). When true, all properties must be in required array.",
"default": false
},
"schema": {
"type": "object",
"description": "JSON Schema object defining the structure of the response. Must include type, properties, and required fields.",
"required": [
"type",
"properties"
],
"properties": {
"type": {
"type": "string",
"enum": [
"object"
],
"description": "Schema type, must be 'object' for structured outputs"
},
"properties": {
"type": "object",
"description": "Object properties with their schemas",
"additionalProperties": true
},
"required": {
"type": "array",
"description": "List of required property names",
"items": {
"type": "string"
}
},
"additionalProperties": {
"type": "boolean",
"description": "Whether additional properties are allowed",
"default": false
}
},
"additionalProperties": true
}
},
"required": [
"name",
"schema"
],
"additionalProperties": false
},
"add_description_parameter": {
"type": "boolean",
"description": "Whether to add a 'description' parameter to tool calls, allowing the LLM to provide context about why it is calling a tool"
},
"hooks": {
"$ref": "#/definitions/HooksConfig",
"description": "Lifecycle hooks for executing shell commands at various points in the agent's execution"
},
"cache": {
"$ref": "#/definitions/CacheConfig",
"description": "Optional response cache: when the same user question is asked again, replay the previous answer instead of calling the model."
},
"skills": {
"description": "Enable skills discovery for this agent. Set to true to load all discovered skills from local filesystem sources; false disables skills. A list can mix sources (\"local\" or an HTTP/HTTPS URL) and/or skill names to include. If only names are given, local sources are loaded and filtered to just those skills.",
"oneOf": [
{
"type": "boolean",
"description": "When true, loads all discovered local skills. When false, skills are disabled."
},
{
"type": "array",
"description": "List combining skill sources and/or skill names to include. Items equal to \"local\" or starting with http:// or https:// are treated as sources; any other string is treated as a skill name filter.",
"items": {
"type": "string"
},
"examples": [
["local"],
["local", "https://skills.example.com"],
["git", "docker"],
["local", "docker-build"]
]
}
]
}
},
"additionalProperties": false
},
"CommandConfig": {
"type": "object",
"description": "Advanced command configuration with description and instruction",
"properties": {
"description": {
"type": "string",
"description": "Description shown in completion dialogs and help text"
},
"instruction": {
"type": "string",
"description": "The prompt sent to the agent. Supports bang commands (!`command`) and positional arguments ($1, $2, etc.)"
}
},
"additionalProperties": false
},
"FallbackConfig": {
"type": "object",
"description": "Configuration for fallback model behavior when the primary model fails",
"properties": {
"models": {
"type": "array",
"description": "List of fallback models to try in order if the primary model fails. Each entry can be a model name from the models section or an inline provider/model format (e.g., 'openai/gpt-4o').",
"items": {
"type": "string"
},
"examples": [
[
"anthropic/claude-sonnet-4-0",
"openai/gpt-4o"
],
[
"backup_model",
"openai/gpt-5-mini"
]
]
},
"retries": {
"type": "integer",
"description": "Number of retries per model with exponential backoff for retryable errors (5xx, timeouts). Use 0 or omit for default (2 retries = 3 total attempts per model). Use -1 to disable retries entirely (try each model only once).",
"minimum": -1,
"default": 2
},
"cooldown": {
"type": "string",
"description": "Duration to stick with a successful fallback model before retrying the primary. Only applies after a non-retryable error (e.g., 429 rate limit). Use Go duration format (e.g., '1m', '30s', '2m30s'). Default is '1m'.",
"pattern": "^([0-9]+(ns|us|\u00b5s|ms|s|m|h))+$",
"default": "1m",
"examples": [
"1m",
"30s",
"2m30s",
"5m"
]
}
},
"additionalProperties": false
},
"CacheConfig": {
"type": "object",
"description": "Configuration for the agent's response cache. When enabled, the assistant response produced for a given user question is stored and replayed verbatim the next time the same question is asked, skipping the model entirely. Two normalization options control what 'same question' means: case_sensitive (default false) toggles case-insensitive matching, and trim_spaces (default false) strips leading/trailing whitespace before comparison. Set 'path' to persist entries to a JSON file (relative paths resolve against the agent config directory); leave it empty to keep entries in memory only.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Set to true to enable the cache. When false (or when the cache section is omitted), no caching is performed.",
"default": false
},
"case_sensitive": {
"type": "boolean",
"description": "When true, questions must match exactly (including case) to hit the cache. Default: false (case-insensitive matching).",
"default": false
},
"trim_spaces": {
"type": "boolean",
"description": "When true, leading and trailing whitespace is stripped from questions before they are compared. Default: false.",
"default": false
},
"path": {
"type": "string",
"description": "Path to a JSON file used to persist cache entries across runs. Relative paths are resolved against the agent's config directory. When empty, the cache lives only in memory."
}
},
"additionalProperties": false
},
"HooksConfig": {
"type": "object",
"description": "Lifecycle hooks configuration for an agent. Hooks allow running shell commands at various points in the agent's execution lifecycle.",
"properties": {
"pre_tool_use": {
"type": "array",
"description": "Hooks that run before a tool is executed. Can allow/deny/modify tool calls.",
"items": {
"$ref": "#/definitions/HookMatcherConfig"
}
},
"post_tool_use": {
"type": "array",
"description": "Hooks that run after a tool completes (both success and failure). The result is delivered in tool_response (failed calls carry an is_error flag and any error text). Returning decision=block or exit code 2 stops the run loop after the current tool batch — useful for circuit-breaker patterns.",
"items": {
"$ref": "#/definitions/HookMatcherConfig"
}
},
"permission_request": {
"type": "array",
"description": "Hooks that run just before the runtime prompts the user to approve a tool call (i.e. when --yolo and permission rules did not short-circuit the decision). Hooks may auto-allow or auto-deny via hook_specific_output.permission_decision; otherwise control falls through to the interactive confirmation. Tool-matched, like pre_tool_use.",
"items": {
"$ref": "#/definitions/HookMatcherConfig"
}
},
"session_start": {
"type": "array",
"description": "Hooks that run when a session begins. Can load context or setup environment.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"user_prompt_submit": {
"type": "array",
"description": "Hooks that run once per user message, after the user has submitted their prompt and before the first model call of the turn. The submitted text is passed in the prompt field. Hooks can block submission (decision=block / continue=false / exit code 2) or contribute additional_context that is spliced into the conversation as a transient system message for that turn only. Sub-sessions (transferred tasks, background agents) do NOT fire this event because their kick-off message is synthesised by the runtime.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"turn_start": {
"type": "array",
"description": "Hooks that run at the start of every agent turn (each model call). Their AdditionalContext is appended as transient system messages for that turn only — it is NOT persisted to the session, so per-turn signals (date, prompt files) are recomputed every turn instead of bloating message history on every resume.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"before_llm_call": {
"type": "array",
"description": "Hooks that run just before each model call (after turn_start has assembled the messages). Use for observability, cost guardrails, or auditing without contributing system messages — turn_start is the right event for the latter.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"after_llm_call": {
"type": "array",
"description": "Hooks that run just after each successful model call, before the response is recorded into the session and tool calls are dispatched. Receives the assistant text content in stop_response. Failed calls fire on_error instead.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"session_end": {
"type": "array",
"description": "Hooks that run when a session ends. Can perform cleanup or logging.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"pre_compact": {
"type": "array",
"description": "Hooks that run just before the runtime compacts the session transcript into a summary. The trigger is reported in source: 'manual' (user-initiated /compact), 'auto' (proactive threshold), 'overflow' (context-overflow recovery), or 'tool_overflow' (proactive after tool results pushed past the threshold). Hooks may block compaction (decision=block / continue=false / exit code 2) or contribute additional_context that is appended to the compaction prompt — useful for steering the summary without modifying the agent's instruction.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"subagent_stop": {
"type": "array",
"description": "Hooks that run when a sub-agent (transferred task, background agent, skill sub-session) finishes. Fires against the parent agent's executor so handlers configured on the orchestrator see every child completion. The sub-agent's name is in agent_name and its final assistant message in stop_response.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"on_user_input": {
"type": "array",
"description": "Hooks that run when the agent needs user input. Can send notifications or log events.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"stop": {
"type": "array",
"description": "Hooks that run when the model finishes responding and is about to hand control back to the user. Can perform post-response validation or logging.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"notification": {
"type": "array",
"description": "Hooks that run when the agent sends a notification (error, warning) to the user. Can send external notifications or log events.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"on_error": {
"type": "array",
"description": "Hooks that run when the runtime hits an error during a turn (model failures, repetitive tool-call loops). Fires alongside notification (level=error); use this for structured error-only handlers without parsing notification_level.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"on_max_iterations": {
"type": "array",
"description": "Hooks that run when the runtime reaches its configured max_iterations limit. Fires alongside notification (level=warning); use this for structured handlers (e.g. log to a metrics pipeline) without parsing notification_message.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"on_agent_switch": {
"type": "array",
"description": "Hooks that run whenever the runtime moves the active agent to a new one (transfer_task, handoff, or the return after a transferred task completes). Receives from_agent, to_agent, and agent_switch_kind in the input. Observational; useful for audit, transcript, and metrics pipelines that track which agent ran which tools.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"on_session_resume": {
"type": "array",
"description": "Hooks that run when the user explicitly approves the runtime to continue past its configured max_iterations limit. Receives previous_max_iterations and new_max_iterations in the input. Observational; useful for alerting on extended-runtime sessions or for billing/quota pipelines that meter resumes.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"on_tool_approval_decision": {
"type": "array",
"description": "Hooks that run after the runtime's tool approval chain (yolo / permissions / readonly / ask) resolves a verdict for a tool call, before the call is executed (allow) or its error response is recorded (deny / canceled). Receives approval_decision (\"allow\" | \"deny\" | \"canceled\") and approval_source (a stable classifier of which step decided). Observational; gives audit pipelines a single \"who approved what\" record without re-implementing the chain.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"before_compaction": {
"type": "array",
"description": "Hooks that run immediately before a session compaction. The Input carries input_tokens, output_tokens, context_limit, and compaction_reason ('threshold', 'overflow', 'manual'). A hook may veto compaction by setting decision='block' (or exiting with code 2), or supply a custom summary via hookSpecificOutput.summary, in which case the runtime applies that summary verbatim and skips the LLM-based summarization. Be cautious about denying when compaction_reason='overflow': the runtime is recovering from a context-overflow error and a denial there will leave the session unable to make progress.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
},
"after_compaction": {
"type": "array",
"description": "Hooks that run after a successful compaction (a summary was applied to the session). Receives the final summary text in Input.summary alongside input_tokens, output_tokens, context_limit and compaction_reason. Purely observational — hook output is ignored.",
"items": {
"$ref": "#/definitions/HookDefinition"
}
}
},
"additionalProperties": false
},
"HookMatcherConfig": {
"type": "object",
"description": "Configuration for matching tools and their associated hooks",
"properties": {
"matcher": {
"type": "string",
"description": "Regex pattern to match tool names (e.g., 'shell|edit_file'). Use '*' to match all tools. Case-sensitive.",
"examples": [
"*",
"shell",
"shell|edit_file|write_file",
"mcp__.*"
]
},
"hooks": {
"type": "array",
"description": "Hooks to execute when the matcher matches",
"items": {
"$ref": "#/definitions/HookDefinition"
}
}
},
"required": [
"hooks"
],
"additionalProperties": false
},
"HookDefinition": {
"type": "object",
"description": "Definition of a single hook command",
"properties": {
"name": {
"type": "string",
"description": "Optional friendly hook name used in logs and runtime hook events."
},
"type": {
"type": "string",
"description": "Type of hook. 'command' executes a shell command; 'builtin' invokes a named in-process Go function registered by the runtime; 'model' asks an LLM and translates its reply into the hook's native output (used for LLM-as-a-judge pre_tool_use, summarizers, etc., with no Go code). The docker-agent runtime ships these builtins: 'add_date' (turn_start: today's date), 'add_environment_info' (session_start: cwd, git, OS, arch), 'add_prompt_files' (turn_start: contents of named files looked up in the workdir hierarchy and the home directory), 'add_git_status' (turn_start: `git status --short --branch`), 'add_git_diff' (turn_start: `git diff --stat`, or full diff with args=['full']), 'add_directory_listing' (session_start: top-level entries of cwd), 'add_user_info' (session_start: current OS user and hostname), 'add_recent_commits' (session_start: `git log --oneline -n N`, default N=10, override via args=['<N>']), 'max_iterations' (before_llm_call: hard stop after N model calls; args=['<N>'] required).",
"enum": [
"command",
"builtin",
"model"
]
},
"command": {
"type": "string",
"description": "Shell command (type=command) or builtin name (type=builtin) to invoke. Command hooks receive JSON input via stdin with tool/session information. Ignored when type=model."
},
"args": {
"type": "array",
"description": "Arbitrary string arguments passed to the hook handler. Builtin handlers receive them as a typed parameter; e.g. 'add_prompt_files' takes the list of prompt files to load, 'add_recent_commits' optionally takes a positive integer commit limit, 'add_git_diff' accepts 'full' to emit the full unified diff, and 'max_iterations' takes a positive integer call limit.",
"items": {
"type": "string"
}
},
"timeout": {
"type": "integer",
"description": "Execution timeout in seconds (default: 60)",
"minimum": 1,
"default": 60
},
"env": {
"type": "object",
"description": "Environment variables to add or override for this hook only.",
"additionalProperties": {
"type": "string"
}
},
"working_dir": {
"type": "string",
"description": "Working directory for this hook. Relative paths are resolved from the agent working directory."
},
"on_error": {
"type": "string",
"description": "How non-fail-closed hook failures are handled. 'warn' logs and continues (default), 'ignore' continues silently, and 'block' denies the event.",
"enum": [
"warn",
"ignore",
"block"
],
"default": "warn"
},
"model": {
"type": "string",
"description": "Model spec ('provider/model', e.g. 'openai/gpt-4o-mini') invoked by type=model hooks. Required for that type, ignored otherwise."
},
"prompt": {
"type": "string",
"description": "User-message template rendered for each invocation of a type=model hook. Parsed as a Go text/template with the hook Input as the data context: {{ .ToolName }}, {{ .ToolInput }}, {{ .StopResponse }}, etc. Required for type=model."
},
"schema": {
"type": "string",
"description": "Well-known response interpretation for type=model hooks. Empty: return the model's reply as additional_context. 'pre_tool_use_decision': ask the model for {decision, reason} JSON and produce a permission_decision verdict (allow|ask|deny)."
}
},
"required": [
"type"
],
"additionalProperties": false,
"allOf": [
{
"if": {"properties": {"type": {"const": "command"}}, "required": ["type"]},
"then": {"required": ["command"]}
},
{
"if": {"properties": {"type": {"const": "builtin"}}, "required": ["type"]},
"then": {"required": ["command"]}
},
{
"if": {"properties": {"type": {"const": "model"}}, "required": ["type"]},
"then": {"required": ["model", "prompt"]}
}
]
},
"ModelConfig": {
"type": "object",
"description": "Configuration for a model",
"properties": {
"provider": {
"type": "string",
"description": "Model provider (e.g., openai, anthropic, dmr)",
"examples": [
"openai",
"anthropic",
"dmr",
"ollama",
"github-copilot"
]
},
"model": {
"type": "string",
"description": "Model name"
},
"temperature": {
"type": "number",
"description": "Sampling temperature",
"minimum": 0,
"maximum": 2
},
"max_tokens": {
"type": "integer",
"description": "Maximum number of tokens",
"minimum": 1
},
"top_p": {
"type": "number",
"description": "Top-p sampling parameter",
"minimum": 0,
"maximum": 1
},
"frequency_penalty": {
"type": "number",
"description": "Frequency penalty",
"minimum": -2,
"maximum": 2
},
"presence_penalty": {
"type": "number",
"description": "Presence penalty",
"minimum": -2,
"maximum": 2
},
"base_url": {
"type": "string",
"description": "Base URL for the model API",
"format": "uri"
},
"parallel_tool_calls": {
"type": "boolean",
"description": "Whether to enable parallel tool calls"
},
"token_key": {
"type": "string",
"description": "Token key for authentication"
},
"provider_opts": {
"type": "object",
"description": "Provider-specific options. Sampling parameters: top_k (integer, supported by anthropic, google, amazon-bedrock, and custom OpenAI-compatible providers like vLLM/Ollama), repetition_penalty (float, forwarded to custom OpenAI-compatible providers), min_p (float, forwarded to custom providers), seed (integer, forwarded to OpenAI). Infrastructure options: http_headers (map of string to string, adds custom HTTP headers to every request; used for OpenAI-compatible providers like github-copilot which requires Copilot-Integration-Id). dmr: runtime_flags. anthropic/amazon-bedrock (Claude): interleaved_thinking (boolean, default true), thinking_display ('summarized', 'omitted', or 'display') controls whether thinking blocks are returned in responses when thinking is enabled. Claude Opus 4.7 hides thinking by default ('omitted'); set thinking_display: summarized (or thinking_display: display) to receive thinking blocks. openai: transport ('sse' or 'websocket') to choose between SSE and WebSocket streaming for the Responses API. openai/anthropic/google: rerank_prompt (string) to fully override the system prompt used for RAG reranking (advanced - prefer using results.reranking.criteria for domain-specific guidance). Google: google_search (boolean) enables Google Search grounding, google_maps (boolean) enables Google Maps grounding, code_execution (boolean) enables server-side code execution.",
"additionalProperties": true
},
"track_usage": {
"type": "boolean",
"description": "Whether to track usage"
},
"thinking_budget": {
"description": "Controls reasoning effort/budget. Use 'none' or 0 to disable thinking. OpenAI: string levels ('minimal','low','medium','high','xhigh'). Anthropic: integer token budget (1024-32768), 'adaptive' (adaptive thinking with high effort by default), 'adaptive/<effort>' where effort is low/medium/high/xhigh/max ('xhigh' is supported by Claude Opus 4.7+), or effort levels ('low','medium','high','xhigh','max') which use adaptive thinking with the given effort. Amazon Bedrock (Claude): integer token budget or effort levels ('low','medium','high') mapped to token budgets. Google Gemini 2.5: integer token budget (-1 for dynamic, 0 to disable, 24576 max). Google Gemini 3: string levels ('minimal' Flash only,'low','medium','high'). Thinking is only enabled when explicitly configured.",
"oneOf": [
{
"type": "string",
"pattern": "^(none|minimal|low|medium|high|xhigh|max|adaptive(/low|/medium|/high|/xhigh|/max)?)$",
"description": "Reasoning effort level. 'adaptive' uses adaptive thinking with high effort (default). 'adaptive/<effort>' specifies the effort level (low/medium/high/xhigh/max). 'adaptive/xhigh' requires Claude Opus 4.7+. Use 'none' to disable thinking."
},
{
"type": "integer",
"minimum": -1,
"maximum": 32768,
"description": "Token budget for extended thinking (Anthropic, Bedrock Claude, Gemini 2.5). Use 0 to disable thinking."
}
],
"examples": [
"none",
0,
"minimal",
"low",
"medium",
"high",
"xhigh",
"max",
"adaptive",
"adaptive/low",
"adaptive/medium",
"adaptive/high",
"adaptive/xhigh",
"adaptive/max",
-1,
1024,
8192,
32768
]
},
"task_budget": {
"description": "Total-token budget for a full agentic task (forwarded to Anthropic as `output_config.task_budget`, with the required `task-budgets-2026-03-13` beta header attached automatically). Limits the combined tokens spent on thinking, tool calls, and output across the whole task. Configurable on any Claude model — docker-agent does not gate by model name — but at the time of writing only Claude Opus 4.7 honors it. Accepts an integer token count or an object {type: tokens, total: N}.",
"oneOf": [
{
"type": "integer",
"minimum": 0,
"description": "Total token budget for the task (e.g., 128000)."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["tokens"],
"description": "Budget kind. Only \"tokens\" is supported today."
},
"total": {
"type": "integer",
"minimum": 0,
"description": "Total budget value."
}
},
"required": ["total"],
"additionalProperties": false
}
],
"examples": [
64000,
128000,
{ "type": "tokens", "total": 128000 }
]
},
"routing": {
"type": "array",
"description": "Routing rules for request-based model selection. When configured, this model becomes a router that selects the best model based on the user's input. The model's provider/model fields define the fallback model.",
"items": {
"$ref": "#/definitions/RoutingRule"
}
}
},
"additionalProperties": false
},
"RoutingRule": {
"type": "object",
"description": "A single routing rule that maps example phrases to a target model",
"properties": {
"model": {
"type": "string",
"description": "Model reference (another model name in the models section or inline spec like 'openai/gpt-4o')"
},
"examples": {
"type": "array",
"description": "Example phrases that should trigger routing to this model",
"items": {
"type": "string"
}
}
},
"required": [
"model",
"examples"
],
"additionalProperties": false
},
"Metadata": {
"type": "object",
"description": "Configuration metadata",
"properties": {
"author": {
"type": "string",
"description": "Author of the configuration"
},
"license": {
"type": "string",
"description": "License for the configuration"
},
"readme": {
"type": "string",
"description": "README or description"
},
"description": {
"type": "string",
"description": "Description of the agent configuration"
},
"version": {
"type": "string",
"description": "Version of the agent configuration (used for OCI registry publishing)"
}
},
"additionalProperties": false
},
"PermissionsConfig": {
"type": "object",
"description": "Tool permission configuration. Controls tool call approval behavior with optional argument matching.",
"properties": {
"allow": {
"type": "array",
"description": "Tool patterns that are auto-approved without user confirmation. Supports tool names with glob patterns (e.g., 'read_*') and argument matching (e.g., 'shell:cmd=ls*' to allow shell commands starting with 'ls'). MCP tools can use qualified names (e.g., 'mcp:github:*').",
"items": {
"type": "string"
},
"examples": [
[
"shell:cmd=ls*",
"shell:cmd=git status*",
"shell:cmd=go test*"
],
[
"mcp:github:get_*",
"mcp:github:list_*"
],
[
"think",
"create_todo*",