MCPcopy
hub / github.com/docker/docker-agent / WithToolsApproved

Function WithToolsApproved

pkg/session/session.go:814–821  ·  view source on GitHub ↗

WithToolsApproved is the legacy --yolo setter. Prefer [WithSafetyPolicy]. With toolsApproved=true and no explicit SafetyPolicy, pins the policy to [SafetyPolicyUnsafe].

(toolsApproved bool)

Source from the content-addressed store, hash-verified

812// [WithSafetyPolicy]. With toolsApproved=true and no explicit
813// SafetyPolicy, pins the policy to [SafetyPolicyUnsafe].
814func WithToolsApproved(toolsApproved bool) Opt {
815 return func(s *Session) {
816 s.ToolsApproved = toolsApproved
817 if toolsApproved && s.SafetyPolicy == "" {
818 s.SafetyPolicy = SafetyPolicyUnsafe
819 }
820 }
821}
822
823// WithSafetyPolicy sets the session's safety preference.
824// [SafetyPolicyUnsafe] also flips ToolsApproved=true so legacy branches

Calls

no outgoing calls