You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: commands_runsecurity.go
    path of file: ./repos/buildkit/frontend/dockerfile/instructions
    
    the code of the file until where you have to start completion: //go:build dfrunsecurity
// +build dfrunsecurity

package instructions

import (
	"github.com/pkg/errors"
)

const (
	SecurityInsecure = "insecure"
	SecuritySandbox  = "sandbox"
)

var allowedSecurity = map[string]struct{}{
	SecurityInsecure: {},
	SecuritySandbox:  {},
}

func isValidSecurity(value string
    
func runSecurityPostHook(cmd *RunCommand, req parseRequest) error {
	st := cmd.getExternalValue(securityKey).(*securityState)
	if st == nil {
		return errors.Errorf("no security state")
	}

	value := st.flag.Value
	if !isValidSecurity(value) {
		return errors.Errorf("security %q is not valid", value)
	}

	st.security = value

	return nil
}