API keys
Connect scripts and tools to your account.
Create an API key when you want a script or tool to access the Hub on your behalf. The Embedl Hub SDK, CLI, and REST API use it to authenticate as your account, with your project permissions.
Create a key#
- Open API keys from your account.
- Enter a label describing its use, such as
Evaluation workstation. - Choose the key’s Access: Full access, or a scope. See Scopes.
- Choose an Expiration period and select Create key.
- Copy and store the key securely. It is shown only once.
The account can have up to five active keys. Remove an unused key if you reach the limit.
Scopes#
A scope limits what a key may do. A key with Full access acts as you in
everything you can do. A key with a scope may only make the requests that scope
covers; every other request answers 403 with the code api_key_out_of_scope,
and the SDK raises ApiKeyScopeError for it. Safe mode downgrades it to a
warning like any other rejected request.
runs:write covers finding a project and its runs, creating, starting and
finishing runs, and logging metrics, params, tags, links, dashboards and
artifacts to runs you can write. It does not cover reading what a run holds,
downloading artifacts, deleting anything, re-parenting a run, or managing
projects or keys.
Give a job the narrowest scope that covers what it does. A scope never widens a key beyond your own project permissions, and losing access to a project takes effect for the key at once.
Configure the SDK#
Use SDK setup to configure both the key and the address of this
Hub. For automated jobs, store the key in your job runner’s secret store and
provide it through EMBEDL_HUB_API_KEY, together with the address of the Hub.
See Run automated jobs.
Keep keys out of source code, screenshots, and logs. embedl-hub status reports
where the configured key comes from without printing its value.
Service accounts#
A service account is a non-human member of a team that holds API keys and never signs in. It has no password and no identity with any sign-in provider. It gets project access through grants to the account or its team. A job that authenticates with its key acts as the account, within that access and within the key’s scope. The account cannot create projects or anything else outside its team.
Team and organization administrators manage service accounts from the team’s settings page: create one, create or revoke its keys, and disable it to stop every key at once. Service accounts are team Members and cannot be Admin. The account lives as long as its team; deleting the team deletes the account and its keys. Other team members see the accounts but not their keys.
A run keeps the author it was created with. A run the service account creates names the account, with a service account marker in run lists and on the run page. A pending run that a person creates and a job later adopts with the account’s key still names the person; the run’s history records the account and the key label for what the job did.
Two common uses, both with the key stored in the job runner’s secret store and
provided as EMBEDL_HUB_API_KEY:
- A launcher started by a person creates a pending run as that person and hands
its id to the job, which adopts it with the service account’s
runs:writekey throughembedl-hub exec --use-pending-runorClient.use_pending_run(). The run names the person as its author. - A scheduled pipeline with no person behind it creates its own runs with the same key. The runs name the service account.
Replace a key#
- Create a replacement key.
- Update the tools that use it and confirm they can connect.
- Revoke the old key from API keys.
Expired or revoked keys can no longer authenticate. If a key was exposed, revoke it immediately and replace it in affected tools.
Next steps#
- Set up the SDK to connect your code to the Hub.