Share feedback
Answers are generated based on the documentation.

sbx secret set

DescriptionCreate or update a secret
Usagesbx secret set [-g | sandbox] [service] [flags]

Description

Create or update a secret for a service.

Available services: anthropic, aws, github, google, groq, mistral, nebius, openai, xai

When no arguments are provided, an interactive prompt guides you through scope and service selection.

Options

OptionDefaultDescription
-f, --forceOverwrite an existing secret when --token is used
-g, --globalUse global secret scope
-t, --tokenSecret value (less secure: visible in shell history)

Global options

OptionDefaultDescription
-D, --debugEnable debug logging

Examples

# Store a GitHub token globally (available to all sandboxes)
sbx secret set -g github

# Store an OpenAI key for a specific sandbox
sbx secret set my-sandbox openai

# Non-interactive via stdin (e.g., from a secret manager or env var)
echo "$ANTHROPIC_API_KEY" | sbx secret set -g anthropic