Authorization Guide
After adding a Harmony instance, you need to authorize it to communicate with the Runbeam Cloud API.
Authorizing a Harmony Instance
# Authorize a Harmony instance by label
runbeam harmony:authorize -l my-label
# Or by instance ID
runbeam harmony:authorize --id 1a2b3c4d
Authorization Flow
The authorization process securely exchanges your user credentials for a machine-scoped token:
- CLI loads your user authentication token
- CLI retrieves the encryption key from secure OS keyring (if configured)
- CLI calls the Runbeam Cloud API to authorize the gateway
- Runbeam Cloud issues a machine-scoped token (30-day expiry)
- CLI sends the token and encryption key to Harmony
- Harmony stores the machine token encrypted with the provided key
- Harmony can now make authenticated API calls to Runbeam Cloud
Security Model
The authorization system is designed with multiple layers of security:
- User tokens are short-lived (used only for authorization)
- Machine tokens are encrypted at rest using age X25519 encryption
- Each Harmony instance can have its own encryption key
- Encryption keys are auto-generated or provided via
RUNBEAM_ENCRYPTION_KEYenvironment variable - You can revoke a Harmony instance's access independently
- Tokens can be renewed before expiry
Encryption Key Management
The Runbeam SDK automatically manages encryption keys for secure token storage:
- Keys are generated automatically on first use
- Keys are stored at
~/.runbeam/<instance_id>/encryption.keyor provided viaRUNBEAM_ENCRYPTION_KEYenvironment variable - Keys are used transparently for encrypted filesystem token storage
- No manual key management is required
Prerequisites
Before authorizing a Harmony instance, ensure:
-
You are logged in to Runbeam CLI:
runbeam login -
Your Harmony instance has Runbeam integration enabled in
config.toml:[runbeam]
enabled = true
If the Harmony proxy returns 403 Forbidden during authorization, check that this configuration is present.
Advanced Options
Automatic Configuration Upload
After authorization, you can automatically upload the Harmony configuration to Runbeam Cloud:
runbeam harmony:authorize -l my-label --update
Non-Interactive Mode
For CI/CD environments, use the -y flag to skip interactive prompts:
runbeam harmony:authorize -l my-label -y
When used without --update, configuration upload is skipped in non-interactive mode.
Troubleshooting
403 Forbidden Error
If you receive a 403 Forbidden error during authorization:
- Check that
runbeam.enabled = trueis set in your Harmonyconfig.toml - Reload the Harmony configuration:
runbeam harmony:reload -l my-label - Try authorization again
Expired Token
If your user token has expired:
- Log out and log back in:
runbeam logout
runbeam login - Verify your token:
runbeam verify - Try authorization again
Machine Token Renewal
Machine tokens expire after 30 days. To renew:
- Ensure you're logged in with a valid user token
- Run the authorization command again:
runbeam harmony:authorize -l my-label
The new machine token will replace the expired one.