dotset shield run
Run any command with secrets injected from multiple providers and output protection.Usage
Use
-- to separate dotset options from your command.Options
| Option | Description | Default |
|---|---|---|
-p, --providers <list> | Comma-separated providers | auto |
-s, --scope <scope> | Environment scope | development |
-m, --mode <mode> | Protection mode | redact |
--redact-text <text> | Replacement text | [REDACTED] |
-q, --quiet | Suppress shield output | false |
--report | Generate HTML protection report | false |
--no-telemetry | Disable cloud reporting | false |
Secret Resolution
Shield aggregates secrets from configured providers. By default, it usesauto which attempts to detect all available sources.
Supported Providers
- dotenv: Loads from
.env,.env.local,.env.development, etc. - environment: Shell environment variables (with common prefixes like
API_,SECRET_,TOKEN_) - aws-sm: AWS Secrets Manager
Examples
Zero-Setup (.env auto-detection)
Explicit Providers
With Redaction
Production Scope
Compliance Reports
Use the--report flag to generate a standalone HTML report after each run. This is useful for:
- Audit trails: Document what protection was applied
- Compliance evidence: SOC 2, ISO 27001 artifact generation
- CI artifacts: Upload to your build system for review
- Run summary (command, mode, duration)
- Secrets protected (count by provider)
- Exposures detected and blocked
- Pattern matches with severity levels
Security Policies
By default,run uses a hardcoded list of high-accuracy patterns (AWS keys, GitHub tokens, etc.) to scan your output.
Auto-Updating Patterns
When your project is linked to the cloud, Shield automatically syncs your security policies:- Patterns are refreshed every hour in the background
- Custom patterns you add in the Dashboard are applied immediately
- If the cloud is unreachable, Shield falls back to cached policies
Linking for Customization
To use custom regex patterns or disable specific default rules, you must link your project to the Cloud. When linked, the CLI fetches your project-specific policies from the Dashboard, which completely override the local defaults. See the Security Policies guide for a full list of default patterns.How It Works
- Resolution: Aggregates secrets from all specified providers.
- Injection: Injects discovered secrets into the child process environment.
- Redaction: Intercepts
stdout/stderrusing a streaming line-buffered engine. This ensures secrets are caught even if split across output chunks. - Flush: Flushes any remaining buffered text before exiting.