Files
kandev/apps/backend/internal/agent/mcpconfig/policy.go
T
2026-02-21 22:14:56 +00:00

34 lines
1.0 KiB
Go

package mcpconfig
import "github.com/kandev/kandev/internal/agent/executor"
// DefaultPolicyForRuntime returns the baseline MCP policy for a runtime.
// We only enable local runtimes today; non-local runtimes default to deny-all
// until we add explicit executor policies for their networks.
func DefaultPolicyForRuntime(runtimeName executor.Name) Policy {
switch runtimeName {
case executor.NameLocal, executor.NameStandalone, executor.NameDocker:
return Policy{
AllowStdio: true,
AllowHTTP: true,
AllowSSE: true,
AllowStreamableHTTP: true,
URLRewrite: map[string]string{},
EnvInjection: map[string]string{},
AllowlistServers: nil,
DenylistServers: nil,
}
default:
return Policy{
AllowStdio: false,
AllowHTTP: false,
AllowSSE: false,
AllowStreamableHTTP: false,
URLRewrite: map[string]string{},
EnvInjection: map[string]string{},
AllowlistServers: nil,
DenylistServers: nil,
}
}
}