Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
253 changes: 225 additions & 28 deletions pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,7 @@
},
{
"not": {
"anyOf": [
{ "required": ["branches"] },
{ "required": ["branches-ignore"] }
]
"anyOf": [{ "required": ["branches"] }, { "required": ["branches-ignore"] }]
}
}
],
Expand All @@ -305,10 +302,7 @@
},
{
"not": {
"anyOf": [
{ "required": ["paths"] },
{ "required": ["paths-ignore"] }
]
"anyOf": [{ "required": ["paths"] }, { "required": ["paths-ignore"] }]
}
}
]
Expand Down Expand Up @@ -431,10 +425,7 @@
},
{
"not": {
"anyOf": [
{ "required": ["branches"] },
{ "required": ["branches-ignore"] }
]
"anyOf": [{ "required": ["branches"] }, { "required": ["branches-ignore"] }]
}
}
],
Expand All @@ -451,10 +442,7 @@
},
{
"not": {
"anyOf": [
{ "required": ["paths"] },
{ "required": ["paths-ignore"] }
]
"anyOf": [{ "required": ["paths"] }, { "required": ["paths-ignore"] }]
}
}
]
Expand Down Expand Up @@ -669,10 +657,7 @@
},
{
"not": {
"anyOf": [
{ "required": ["branches"] },
{ "required": ["branches-ignore"] }
]
"anyOf": [{ "required": ["branches"] }, { "required": ["branches-ignore"] }]
}
}
]
Expand Down Expand Up @@ -996,10 +981,7 @@
},
{
"not": {
"anyOf": [
{ "required": ["branches"] },
{ "required": ["branches-ignore"] }
]
"anyOf": [{ "required": ["branches"] }, { "required": ["branches-ignore"] }]
}
}
],
Expand All @@ -1016,10 +998,7 @@
},
{
"not": {
"anyOf": [
{ "required": ["paths"] },
{ "required": ["paths-ignore"] }
]
"anyOf": [{ "required": ["paths"] }, { "required": ["paths-ignore"] }]
}
}
]
Expand Down Expand Up @@ -5136,6 +5115,224 @@
}
}
}
},
{
"$comment": "Strict mode: MCP containers require network configuration",
"if": {
"properties": {
"strict": {
"const": true
},
"mcp-servers": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"anyOf": [
{
"required": ["container"]
},
{
"properties": {
"type": {
"enum": ["stdio", "local"]
}
},
"required": ["type", "container"]
}
]
}
}
}
},
"required": ["strict", "mcp-servers"]
},
"then": {
"properties": {
"mcp-servers": {
"patternProperties": {
".*": {
"if": {
"anyOf": [
{
"required": ["container"]
},
{
"properties": {
"type": {
"enum": ["stdio", "local"]
}
},
"required": ["type", "container"]
}
]
},
"then": {
"required": ["network"]
}
}
}
}
}
}
},
{
"$comment": "Strict mode: Write permissions require safe-outputs configuration",
"if": {
"properties": {
"strict": {
"const": true
},
"permissions": {
"type": "object",
"anyOf": [
{
"properties": {
"contents": {
"const": "write"
}
},
"required": ["contents"]
},
{
"properties": {
"issues": {
"const": "write"
}
},
"required": ["issues"]
},
{
"properties": {
"pull-requests": {
"const": "write"
}
},
"required": ["pull-requests"]
}
]
}
},
"required": ["strict", "permissions"]
},
"then": {
"required": ["safe-outputs"]
}
},
{
"$comment": "Sandbox-runtime requires feature flag",
"if": {
"anyOf": [
{
"properties": {
"sandbox": {
"const": "sandbox-runtime"
}
},
"required": ["sandbox"]
},
{
"properties": {
"sandbox": {
"type": "object",
"properties": {
"type": {
"const": "sandbox-runtime"
}
},
"required": ["type"]
}
},
"required": ["sandbox"]
},
{
"properties": {
"sandbox": {
"type": "object",
"properties": {
"agent": {
"type": "object",
"properties": {
"type": {
"const": "sandbox-runtime"
}
},
"required": ["type"]
}
},
"required": ["agent"]
}
},
"required": ["sandbox"]
}
]
},
"then": {
"properties": {
"features": {
"type": "object",
"properties": {
"sandbox-runtime": {
"const": true
}
},
"required": ["sandbox-runtime"]
}
},
"required": ["features"]
}
},
{
"$comment": "UV packages require network access with PyPI",
"if": {
"properties": {
"runtimes": {
"type": "object",
"properties": {
"uv": {
"type": "object"
}
},
"required": ["uv"]
}
},
"required": ["runtimes"]
},
"then": {
"anyOf": [
{
"properties": {
"network": {
"type": "object",
"properties": {
"allowed": {
"type": "array",
"contains": {
"enum": ["pypi.org", "python", "*"]
}
}
},
"required": ["allowed"]
}
},
"required": ["network"]
},
{
"properties": {
"network": {
"type": "object",
"properties": {
"mode": {
"const": "defaults"
}
},
"required": ["mode"]
}
},
"required": ["network"]
}
]
}
}
],
"$defs": {
Expand Down
1 change: 1 addition & 0 deletions pkg/workflow/mcp-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ func getMCPConfig(toolConfig map[string]any, toolName string) (*parser.MCPServer
"entrypointArgs": true,
"env": true,
"proxy-args": true,
"network": true,
"url": true,
"headers": true,
"registry": true,
Expand Down
3 changes: 2 additions & 1 deletion pkg/workflow/mcp_config_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func getRawMCPConfig(toolConfig map[string]any) (map[string]any, error) {
// to add custom arguments without triggering custom MCP tool processing logic. Including "args"
// would incorrectly classify built-in tools as custom MCP tools, changing their processing behavior
// and causing validation errors.
mcpFields := []string{"type", "url", "command", "container", "env", "headers"}
mcpFields := []string{"type", "url", "command", "container", "env", "headers", "network"}

// List of all known tool config fields (not just MCP)
knownToolFields := map[string]bool{
Expand All @@ -132,6 +132,7 @@ func getRawMCPConfig(toolConfig map[string]any) (map[string]any, error) {
"args": true,
"entrypointArgs": true,
"proxy-args": true,
"network": true, // for container-based MCP servers
"registry": true,
"allowed": true,
"mode": true, // for github tool
Expand Down