Skip to content

Personal Access Tokens

Scion supports Personal Access Tokens (PATs) for programmatic access to the Hub API and for authenticating CLI operations when browser-based OAuth is not feasible.

A Personal Access Token is a long-lived credential linked to your user account. It inherits all your permissions, allowing scripts, CI/CD pipelines, or remote tools to interact with the Scion Hub on your behalf.

You can generate a new PAT using the Scion CLI:

Terminal window
scion hub token create "My CI/CD Token"

This will output the token value. Store this token securely. It is only displayed once and cannot be retrieved later.

To authenticate with a PAT, you must set it in your environment using the SCION_HUB_TOKEN variable:

Terminal window
export SCION_HUB_TOKEN="scion_pat_..."
scion list

When this environment variable is set, the CLI will bypass the browser-based OAuth flow and use the token for all communication with the Hub.

It is crucial to understand the distinction between how users authenticate with the Hub and how agents authenticate with the Hub. Scion uses two separate environment variables for this purpose to enforce strict privilege boundaries:

  • Purpose: Authenticates a human user or a CI/CD pipeline.
  • Scope: Grants full access based on the user’s permissions.
  • Usage: Used by the Scion CLI or external scripts calling the Hub API.
  • Purpose: Authenticates an agent running within a container.
  • Scope: Carries a Hub-issued JWT scoped specifically to that agent. It is short-lived, auto-injected by the Runtime Broker, and grants only the specific permissions that agent needs to function (e.g., reporting status, reading its own secrets).
  • Usage: Automatically used by the sciontool binary running inside the agent.

If a token is compromised or no longer needed, you can revoke it:

Terminal window
scion hub token revoke <token-id>

You can list all your active tokens using:

Terminal window
scion hub token list