Read secrets from a self-hosted 1Password Connect server on headless or remote T3 Code hosts without desktop approval prompts. If you don't already run Connect, a 1Password service account is simpler. See Secrets for basics.
- In 1Password, create a Connect server and access token scoped only to the vaults T3 Code needs.
- Deploy the Connect API and sync containers where the T3 Code server can reach them.
- Install the 1Password CLI (
op) on the T3 Code server machine. - Set
OP_CONNECT_HOST(usehttps://unless local or on a trusted private network) andOP_CONNECT_TOKENin the server's environment (for a background service, add them toservice.envand runt3 service restart). Do not setOP_SERVICE_ACCOUNT_TOKENin the same environment. - In Settings → Secrets → Add provider, enter any sign-in address (e.g.
my.1password.com;opignores it while Connect is configured), then useop://vault/item/fieldreferences.
On the server machine, test with a clean environment:
curl -s "$OP_CONNECT_HOST/health"
env -i PATH="$PATH" HOME="$(mktemp -d)" OP_CONNECT_HOST="$OP_CONNECT_HOST" OP_CONNECT_TOKEN="$OP_CONNECT_TOKEN" \
op read --no-newline "op://Automation/provider-token/credential" >/dev/null && echo "Secret read"- Agent scope: Agents inherit the server's environment and can read any vault accessible to the Connect token—grant only vaults you're comfortable exposing to agents.
- Reference names: Use item IDs if an item title contains characters outside letters, digits, spaces,
.,_, and-(e.g. colons). opover Connect supportsop read(notop vault list), and T3 Code times out secret reads after 45 seconds.