bhatti secret grant
Grant a networked sandbox use of a stored secret at named HTTPS hosts without giving it the value.
Synopsis
bhatti secret grant <name> --sandbox <name-or-id> --host <host> [--host <host>] [--ttl <duration>]
Description
--sandbox and at least one --host are required. The sandbox needs a NIC and an egress policy that permits the hosts (--allow-host for a default-deny sandbox). A grant does not widen egress. The command prints the grant ID and a placeholder; it does not set an env var inside an already-created sandbox. Supply the placeholder to guest code and send it in an HTTPS request header to an approved host. --ttl expires the grant after the duration; omit it to keep the grant until revoked or the sandbox is destroyed. A sandbox created before v2.4 may need recreation to install its per-sandbox CA.
Examples
bhatti secret grant GH_TOKEN --sandbox bot --host api.github.com --ttl 7d
bhatti secret grant GH_TOKEN --sandbox bot --host api.github.com --host uploads.github.com
Options
| Flag | Default | Description |
| ---- | ------- | ----------- |
| --sandbox <name-or-id> | (required) | Sandbox receiving the grant. |
| --host <hostname> | (required, repeatable) | Exact HTTPS host or *.example.com wildcard. |
| --ttl <duration> | Until revoked or sandbox destroyed | Positive duration such as 90m, 24h, 7d. |
See Global flags for --url, --token, --json, --timing, --data-dir.
See also
bhatti secret grants— find grant IDs and expirationbhatti secret revoke— stop new connections using a grant- Credentials for agents — end-to-end setup and limits