idw exec
idw exec runs a subprocess with vault credentials automatically injected as environment variables. Credentials never appear in shell history, and child processes cannot access the vault passphrase or session tokens.
Options
| Option | Description |
|---|---|
-p, --passport <refs...> | Passport ID(s) or name(s) to inject (repeatable) |
--as <mapping...> | Override env var names: PASSPORT_REF=ENV_VAR (repeatable) |
--all | Inject all active passports from the vault |
--platform <platform> | Filter passports by platform (used with --all) |
--tag <tags...> | Filter passports by tag(s) (used with --all) |
-P, --path <path> | Path to vault file |
--dry-run | Print what would be injected without executing |
--no-inherit | Do not inherit parent process environment variables |
--cwd <dir> | Working directory for the child process |
--actor <name> | Actor name for audit logging (default: $USER or cli-exec) |
Usage examples
How it works
Resolve passports
Passports are resolved by ID, name (case-insensitive), or filter (
--all, --platform, --tag).Policy check
The policy engine evaluates each passport for the
exec action. Denied passports block execution.Map environment variables
Credentials are mapped using the platform-aware mapping table, explicit
--as overrides, or the fallback IDW_{NAME} convention.Collision detection
If two passports map to the same env var, exec fails with a clear error. Use
--as to disambiguate.Spawn child process
Credentials are injected into the child’s environment only.
IDW_PASSPHRASE and IDW_SESSION_TOKEN are stripped from the child env.Audit logging
Every credential access is logged with command name, args, PID, env var names, exit code, and duration.
Platform environment variable mapping
idw exec automatically maps credentials to SDK-standard environment variable names:
| Platform | Credential Type | Environment Variable |
|---|---|---|
| openai | api-key | OPENAI_API_KEY |
| anthropic | api-key | ANTHROPIC_API_KEY |
| aws | api-key | AWS_ACCESS_KEY_ID |
| aws | secret | AWS_SECRET_ACCESS_KEY |
| aws | session-keys | AWS_SESSION_TOKEN |
| github | api-key | GITHUB_TOKEN |
| google-a2a | api-key | GOOGLE_API_KEY |
| azure-ai | api-key | AZURE_OPENAI_API_KEY |
| slack | bot-token | SLACK_BOT_TOKEN |
| langchain | api-key | LANGCHAIN_API_KEY |
| crewai | api-key | OPENAI_API_KEY |
| mcp | api-key | MCP_API_KEY |
| openclaw | api-key | OPENCLAW_API_KEY |
IDW_{PASSPORT_NAME} (uppercased, sanitized). Use --as for full control.
Security properties
- Credentials exist only in the child process environment, never the parent shell
IDW_PASSPHRASEandIDW_SESSION_TOKENare automatically stripped from the child env- No shell expansion — uses
spawnwith array arguments, not shell string interpolation - Credential values never appear in error messages
- Policy engine is evaluated before any credential is injected
- Complete audit trail with process-level metadata
Common patterns
CI pipeline credential injection
Multi-model agent scripts
Custom variable names
Docker and containerized workflows
Next steps
Authentication
Understand how vault passphrase resolution works including
.env file support.Policy engine
Configure rules that govern which credentials can be injected.
Audit log
Review the audit trail for every credential access through exec.