From 6bd8ecb66de8b6b9a9afdcb2403c234ef0fc5f5d Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Thu, 5 Nov 2026 22:19:38 +0000
Subject: [PATCH 01/22] Document expanded scoped API key permissions
---
apps/deploy.mdx | 14 ++
browsers/telemetry/export.mdx | 4 +-
docs.json | 1 +
info/api-key-permissions.mdx | 218 +++++++++++++++++++++++---
info/api-key-policy-examples.mdx | 261 +++++++++++++++++++++++++++++++
info/api-keys.mdx | 38 ++++-
info/projects.mdx | 4 +-
7 files changed, 506 insertions(+), 34 deletions(-)
create mode 100644 info/api-key-policy-examples.mdx
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index e574db30..1f37f5c2 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -45,6 +45,20 @@ kernel deploy github \
- The CLI automatically downloads and extracts the GitHub source code and uploads your app for deployment.
- For private repositories, provide a `--github-token` or set the `GITHUB_TOKEN` environment variable.
+## Use a scoped API key
+
+To deploy with a [policy-scoped API key](/info/api-keys#scope-a-key-to-specific-resources), grant these actions on the deployment's project or organization container:
+
+- `deployments:create` to deploy the app.
+- `deployments:delete` to replace older deployments of the same app and version.
+- `invocations:write` so the runtime can report invocation results and attach browsers.
+
+The deployment's injected runtime key inherits your project-limited policy and expiry. Add the browser, profile, vault, or other permissions your app needs. To invoke it with a scoped key, also grant `invocations:create` and ensure the invoking key covers the runtime key's full policy and expiry. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
+
+
+Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support.
+
+
## Environment variables
You can set environment variables for your app using the `--env` flag. For example:
diff --git a/browsers/telemetry/export.mdx b/browsers/telemetry/export.mdx
index c6737889..8c309b67 100644
--- a/browsers/telemetry/export.mdx
+++ b/browsers/telemetry/export.mdx
@@ -12,7 +12,7 @@ Events are exported as OTLP **logs**. Kernel appends `/v1/logs` to your endpoint
## How export works
-You create a **destination** - an OTLP/HTTP endpoint plus the headers your backend expects - and select it when you create a browser. Destinations belong to your organization, so a browser in any project can export to them.
+You create a **destination** - an OTLP/HTTP endpoint plus the headers your backend expects - and select it when you create a browser. Unrestricted keys can select destinations across the organization. With a policy-scoped key, create and select the destination in the project where the browser runs.
Kernel's relay forwards the session's events to the destination and attaches your headers at export time. Headers are encrypted at rest and never reach the browser VM, so a session can export to your backend without ever holding your ingestion key.
@@ -62,6 +62,8 @@ You can also manage destinations in the dashboard under **Telemetry Destinations
Creating, updating, and deleting a destination requires organization-scoped authentication, such as an organization-wide API key or the dashboard; a project-scoped API key gets a `403`. Project-scoped keys can still list and retrieve destinations, and select one when creating a browser.
+For a key with a policy, grant `telemetry_destinations:read` to inspect a destination and `telemetry_destinations:use` to select it for export. Management uses the separate `create`, `write`, and `delete` actions. See the [telemetry policy example](/info/api-key-policy-examples) and [permission reference](/info/api-key-permissions#telemetry-destinations).
+
Header values are write-only. API, SDK, and CLI responses show each header name with an empty value, and the dashboard shows only header names: to change a stored value there, enter a replacement, or leave the field blank to keep the current value.
An organization can have up to 50 destinations. Names must match `^[a-zA-Z0-9._-]{1,255}$`, must be unique within the organization, and can't look like a Kernel ID. A destination can have up to 32 headers, with names and values totaling at most 8,192 bytes.
diff --git a/docs.json b/docs.json
index 2f95d077..f94c2952 100644
--- a/docs.json
+++ b/docs.json
@@ -287,6 +287,7 @@
"info/projects",
"info/api-keys",
"info/api-key-permissions",
+ "info/api-key-policy-examples",
"info/audit-logs",
"info/network-access"
]
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 6d27711c..1576f230 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -1,27 +1,55 @@
---
title: "API Key Permissions"
-description: "Actions and resources you can grant in a scoped API key policy"
+description: "Choose the actions and resources a scoped API key can access"
---
-This page lists everything you can grant in a scoped API key's `policy`. To create a scoped key, see [Scope a key to specific resources](/info/api-keys#scope-a-key-to-specific-resources).
+Use a scoped API key's `policy` to grant only the actions your automation needs. Each statement pairs one action with one resource. See [Create a scoped key](/info/api-keys#create-a-scoped-key) to issue a key, or start with a [policy example](/info/api-key-policy-examples).
## Resources
-| Resource | Matches |
+| Selector | Matches |
| --- | --- |
-| `organizations/{org_id}/*` | Everything in the organization. |
-| `projects/{project_id}/*` | Everything in the project. |
-| `projects/{project_id}/{kind}/{id}` | One object. `kind` is `browsers`, `profiles`, `vaults`, or `proxies`. |
+| `organizations/{org_id}` | The organization itself, for organization actions. |
+| `projects/{project_id}` | The project itself, for project actions. |
+| `organizations/{org_id}/*` | Resources throughout the organization, for the statement's action. |
+| `projects/{project_id}/*` | Resources in one project, for the statement's action. |
+| `projects/{project_id}/{kind}/{id}` | One project-owned resource. |
+| `{kind}/{id}` | One resource. For a project-owned resource, the request's project determines its scope. Use this form for organization-owned resources. |
-Resources must be inside the new key's organization, or its project for a project-scoped key. Kernel checks that every object ID exists when you create the key.
+Choose `kind` from the following resource types:
+
+| Scope | Resource kinds |
+| --- | --- |
+| Project | `browsers`, `profiles`, `vaults`, `proxies`, `extensions`, `telemetry_destinations`, `browser_pools`, `deployments`, `invocations`, `credentials`, `auth_connections` |
+| Organization | `credential_providers`, `vault_provider_configs`, `audit_log_export_destinations` |
+| Matches the target key | `api_keys`: a project key belongs to its project; a key without a project belongs to the organization, not the default project. |
+
+All selectors must fit inside the new key's organization and, for a project-scoped key, its project. KERNEL validates exact resource IDs when you create the key. Existing project-owned resources without a project are treated as belonging to the default project.
+
+Creation actions need a container selector ending in `/*`, rather than an existing object's ID. Project creation and creation of organization-owned resources need `organizations/{org_id}/*`. Audit log access also uses an organization container. Search and configuration registry actions use a project or organization container rather than individual search or analysis IDs.
+
+
+A policy narrows your key's access; it doesn't change its organization or project boundary. Use an organization-scoped key for organization administration, credential providers, wallet provider configurations, audit logs, and telemetry destination management. A project-scoped key can rename its own project, but project creation, deletion, status changes, and limit changes require an organization-scoped credential.
+
## Actions
+### Organizations and projects
+
+| Action | Allows |
+| --- | --- |
+| `organizations:read` | Read organization entitlements and limits. |
+| `organizations:write` | Set the organization's default per-project limits. |
+| `projects:create` | Create projects. Grant on the organization container. |
+| `projects:read` | List projects and read project metadata and limits. |
+| `projects:write` | Rename projects, change their status, and set their limits. |
+| `projects:delete` | Delete empty projects. |
+
### Browsers
| Action | Allows |
| --- | --- |
-| `browsers:create` | Create browsers. Grant it on a project or organization. |
+| `browsers:create` | Create browsers. |
| `browsers:use` | List, inspect, connect to, and control browsers. |
| `browsers:write` | Update browser configuration. |
| `browsers:delete` | Delete browsers. |
@@ -30,9 +58,9 @@ Resources must be inside the new key's organization, or its project for a projec
| Action | Allows |
| --- | --- |
-| `profiles:create` | Create profiles. Grant it on a project or organization. |
+| `profiles:create` | Create profiles. |
| `profiles:read` | List profiles and view their metadata. |
-| `profiles:use` | Attach profiles to browsers and download them. |
+| `profiles:use` | Attach profiles to browsers and download their archives. |
| `profiles:write` | Rename profiles and save browser state into them. |
| `profiles:delete` | Delete profiles. |
@@ -40,7 +68,7 @@ Resources must be inside the new key's organization, or its project for a projec
| Action | Allows |
| --- | --- |
-| `vaults:create` | Create vaults. Grant it on a project or organization. |
+| `vaults:create` | Create vaults. |
| `vaults:read` | List vaults and view vault and item metadata. |
| `vaults:use` | Link vaults to browsers, fill credentials, and run vault item operations. |
| `vaults:write` | Create, update, and delete vault items. |
@@ -50,31 +78,171 @@ Resources must be inside the new key's organization, or its project for a projec
| Action | Allows |
| --- | --- |
-| `proxies:create` | Create proxies. Grant it on a project or organization. |
+| `proxies:create` | Create and validate proxies. |
| `proxies:read` | List proxies and view their configuration, without credentials. |
| `proxies:use` | Select saved proxies for browsers and run health checks. |
| `proxies:write` | Rename proxies. |
| `proxies:delete` | Delete proxies. |
+### Extensions
+
+| Action | Allows |
+| --- | --- |
+| `extensions:create` | Upload saved extensions and import them from the Chrome Web Store. |
+| `extensions:read` | List extensions and read their metadata. |
+| `extensions:use` | Attach saved extensions to browsers and download their archives. |
+| `extensions:delete` | Delete extensions. |
+
+### Telemetry destinations
+
+| Action | Allows |
+| --- | --- |
+| `telemetry_destinations:create` | Create OTLP export destinations. |
+| `telemetry_destinations:read` | List destinations and read configuration and health, with header values redacted. |
+| `telemetry_destinations:use` | Select a destination for browser or auth connection telemetry export. |
+| `telemetry_destinations:write` | Update destinations, including endpoints and headers. A changed endpoint receives the stored headers. |
+| `telemetry_destinations:delete` | Delete destinations. |
+
+Scoped keys resolve destinations within the request's project. Reading and selecting a destination are separate permissions. Creating, updating, and deleting destinations also requires an organization-scoped credential.
+
+### Browser pools
+
+| Action | Allows |
+| --- | --- |
+| `browser_pools:create` | Create browser pools. |
+| `browser_pools:read` | List pools and read their configuration and browser counts. |
+| `browser_pools:use` | Acquire and release pooled browsers. |
+| `browser_pools:write` | Update pool configuration and flush idle browsers. |
+| `browser_pools:delete` | Delete pools and their browsers. |
+
+### Apps, deployments, and invocations
+
+| Action | Allows |
+| --- | --- |
+| `deployments:create` | Deploy apps, together with `deployments:delete` and `invocations:write`. |
+| `deployments:read` | List apps and deployments, and read deployment details, events, and logs. |
+| `deployments:delete` | Stop and delete deployments, including versions replaced by a new deployment. |
+| `invocations:create` | Run app actions, subject to the runtime-key requirements below. |
+| `invocations:read` | List invocations and read payloads, outputs, events, and logs. |
+| `invocations:write` | Update invocation status and output, and attach new browsers to invocations. |
+
+Apps are authorized through their deployments. An invocation belongs to its deployment's project. See [Deployment API keys](/info/api-keys#deployment-api-keys) for runtime permissions and expiry.
+
+
+Scoped app deployment requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support.
+
+
+### Credentials and auth connections
+
+| Action | Allows |
+| --- | --- |
+| `credentials:create` | Create stored credentials. |
+| `credentials:read` | List credentials and read metadata and field names, without secret values. |
+| `credentials:use` | Generate TOTP codes and use credentials through auth connections or vault items. |
+| `credentials:write` | Update credential values and save login values into credentials. |
+| `credentials:delete` | Delete credentials. |
+| `auth_connections:create` | Create managed auth connections. |
+| `auth_connections:read` | Read connection configuration, state, events, and timelines. |
+| `auth_connections:use` | Start logins, submit login input, and obtain hosted login and live view URLs. |
+| `auth_connections:write` | Update connection configuration. |
+| `auth_connections:delete` | Delete connections. |
+
+A read grant returns connection metadata. To receive hosted login or live view URLs, you also need `auth_connections:use` and the referenced-resource permissions needed to run that login.
+
+### Credential providers and wallet provider configurations
+
+| Action | Allows |
+| --- | --- |
+| `credential_providers:create` | Create organization credential providers. |
+| `credential_providers:read` | List providers and read their metadata, without tokens. |
+| `credential_providers:use` | Test providers, list their items, and use them for auth connection logins. |
+| `credential_providers:write` | Update providers, including their tokens. |
+| `credential_providers:delete` | Delete providers. |
+| `vault_provider_configs:create` | Create organization wallet provider configurations. |
+| `vault_provider_configs:read` | List provider configurations and read their settings, without secrets. |
+| `vault_provider_configs:use` | Bind vault wallets to provider configurations. |
+| `vault_provider_configs:write` | Update provider configurations, including their secrets. |
+| `vault_provider_configs:delete` | Delete provider configurations. |
+
+### API keys
+
+| Action | Allows |
+| --- | --- |
+| `api_keys:create` | Issue keys in the authorized container. A scoped issuer must grant a subset of its own policy. |
+| `api_keys:read` | List keys and read metadata and policies, without plaintext keys. |
+| `api_keys:write` | Rename keys. |
+| `api_keys:rotate` | Replace keys whose policies the caller covers, returning the new plaintext key. |
+| `api_keys:delete` | Revoke keys. |
+
+New and rotated keys must expire no later than a scoped issuer. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
+
+### Audit logs and export destinations
+
+| Action | Allows |
+| --- | --- |
+| `audit_logs:read` | Read and export organization audit logs. |
+| `audit_log_export_destinations:create` | Create paused export destinations. |
+| `audit_log_export_destinations:read` | List destinations and read configuration and delivery status. |
+| `audit_log_export_destinations:use` | Write a test object to a destination. |
+| `audit_log_export_destinations:write` | Reconfigure, pause, or activate destinations. Also requires `audit_logs:read`. |
+| `audit_log_export_destinations:delete` | Delete destinations. |
+
+### Search and configuration registry
+
+| Action | Allows |
+| --- | --- |
+| `searches:create` | Run web searches. |
+| `searches:read` | Read stored search results and configured search providers. |
+| `searches:use` | Retrieve page content for search results. |
+| `config_registry:read` | Look up recommended browser configurations and read analyses. |
+| `config_registry:create` | Start or resolve configuration analyses. Also requires `config_registry:read`. |
+| `config_registry:write` | Cancel configuration analyses. |
+
## Operations that need more than one action
+### Browsers and pools
+
| Operation | Requires |
| --- | --- |
-| Create a browser | `browsers:create` and `browsers:use` on the project or organization, because the response includes connection URLs. Add `profiles:use` on its profile, `profiles:write` if it saves profile changes, `vaults:use` on each linked vault, and `proxies:use` on a saved proxy. |
-| Any operation on an existing browser | The browser action, plus `profiles:use` on its attached profile and `vaults:use` on every linked vault. If the browser saves profile changes, `profiles:write` on that profile too. |
-| Update a browser | `browsers:write` and `browsers:use`, plus `use` on any profile, vault, or proxy the update adds. |
-| Fill from a vault | `vaults:use` on the vault and `browsers:use` on the browser. |
-| Add or remove a card in a Kernel wallet (`add_payment_method`, `remove_payment_method`) | `vaults:use` and `vaults:write` on the vault. Without `vaults:write`, the wallet doesn't list either operation in `available_operations`, and invoking one returns `403` with `insufficient_scope`. Other wallet and purchase operations need only `vaults:use`. |
+| Create a browser | Container-wide `browsers:create` and `browsers:use`, because the response includes connection URLs. Add `profiles:use` on its profile, `profiles:write` if it saves changes, `vaults:use` on each linked vault, `extensions:use` on saved extensions, `proxies:use` on selected saved proxies, and `telemetry_destinations:use` on an export destination. |
+| Access an existing browser | The browser action, plus `profiles:use` on its attached profile, `vaults:use` on linked vaults, and `extensions:use` on saved extensions. If the browser saves profile changes, also grant `profiles:write`. |
+| Update a browser | `browsers:write` and `browsers:use`, plus permissions on attached resources and newly selected resources. |
+| Create or update a pool | The pool's `create` or `write` action, plus `use` on the profiles, proxies, and extensions you select. |
+| Acquire a pooled browser | `browser_pools:use`, container-wide `browsers:use`, and permissions on the pool's profile/extensions and the browser's actual attachments. An acquire-time profile also requires `profiles:write` when saving changes. |
+| Release a pooled browser | `browser_pools:use` and access to the leased browser, including its attachments. |
+| Force-delete a pool with leased browsers | `browser_pools:delete` and `browsers:delete` on every leased browser. |
| Run a proxy health check | `proxies:use` and `proxies:read`. |
-List endpoints return only the objects the key can access, so a key without a matching grant gets an empty list.
+### Auth connections and vaults
+
+| Operation | Requires |
+| --- | --- |
+| Create or update an auth connection, start a login, or submit login input | The connection's action, `profiles:use` and `profiles:write` on its profile, and `credentials:use` on a linked credential. Add `credentials:write` when saving values, `credentials:create` when creating a credential, `profiles:create` when creating a profile, and `credential_providers:use` for a provider-backed connection. |
+| Select a proxy or telemetry destination for an auth connection | `proxies:use` or `telemetry_destinations:use` on the selected resource, in addition to connection and login-resource permissions. Stored telemetry destinations are also checked when you start a login. |
+| Fill from a vault | `vaults:use` and browser access, including the browser's attachments. |
+| Create a vault item backed by an auth connection | `vaults:write` on the vault, `auth_connections:use` on the connection, and `credentials:use` on its saved credential. |
+| Bind a provider wallet to a vault | `vaults:write` on the vault and `vault_provider_configs:use` on the provider configuration. |
+| Add or remove a stored wallet card (`add_payment_method`, `remove_payment_method`) | `vaults:use` and `vaults:write`. These operations appear in `available_operations` only with write access. Other wallet and purchase operations require `vaults:use`. |
+
+Connection updates check the resulting configuration. Turning off credential saving also checks the existing configuration, because an already-running login can still save values. Background health checks and reauthentication continue using the connection's saved configuration after the configuring API key is revoked; update or delete the connection to change that behavior.
+
+### Apps and services
+
+| Operation | Requires |
+| --- | --- |
+| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. The runtime key inherits your project-limited policy and expiry. Add permissions for the operations your app performs. |
+| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the deployment runtime key's policy, and your key must expire no earlier than that runtime key. |
+| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
+| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
+| Create or rotate an API key | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. Its expiry must fit within your own key's expiry. |
+| Update an audit export destination | `audit_log_export_destinations:write` and organization-wide `audit_logs:read`. |
+| Retrieve search content with an automatically created browser | `searches:use` plus container-wide `browsers:create`, `browsers:use`, and `browsers:delete`. With an existing browser, grant access to that browser and its attachments instead. |
+| Resolve a browser configuration | `config_registry:create` and `config_registry:read`. |
+
+## Lists and authentication
-## Not available to scoped keys
+Resource lists, such as browsers, profiles, pools, and API keys, filter permissions before pagination. A key with no grant for those resources receives an empty list. Service-wide listings, such as search providers, require the service's read action.
-Scoped keys get `403` with `insufficient_scope` on:
+`GET /auth/context` describes the calling credential and needs no additional policy action; the key must still be valid and unexpired.
-- API key management, including creating, listing, rotating, and deleting keys.
-- Browser pools.
-- Project and organization endpoints, such as listing projects or reading limits.
-- Creating browsers that use saved extensions, telemetry export, or app invocations.
-- Any other endpoint not covered by the actions above.
+Payment-authenticated browser creation, card-capture tokens, and managed auth handoff-code exchange keep their own authentication protocols. An API key policy doesn't replace those credentials.
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
new file mode 100644
index 00000000..cea87bc3
--- /dev/null
+++ b/info/api-key-policy-examples.mdx
@@ -0,0 +1,261 @@
+---
+title: "API Key Policy Examples"
+description: "Policies for browser automation, pools, managed auth, app execution, and administration"
+---
+
+Start with the example closest to your workload and keep only the permissions you need. Each snippet defines a `policy` value to pass to the [API key creation call](/info/api-keys#create-a-scoped-key). TypeScript and Python examples grant the same permissions.
+
+The IDs below represent resources you've already created. Replace them with IDs returned by your own API requests; exact resource IDs are validated when you issue a key. Most examples fit a project-scoped key with `project_id: 'proj_staging_9f3k'`. Examples that include organization resources require an organization-scoped key.
+
+For every available action and its prerequisites, see [API key permissions](/info/api-key-permissions).
+
+
+
+
+Use an organization-scoped key to read organization limits and view or update one project. Omit `project_id` when issuing this key.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'organizations:read', resource: 'organizations/org_8f3k9m2q' },
+ { action: 'projects:read', resource: 'projects/proj_staging_9f3k' },
+ { action: 'projects:write', resource: 'projects/proj_staging_9f3k' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "organizations:read", "resource": "organizations/org_8f3k9m2q"},
+ {"action": "projects:read", "resource": "projects/proj_staging_9f3k"},
+ {"action": "projects:write", "resource": "projects/proj_staging_9f3k"},
+ ],
+}
+```
+
+
+Create additional projects with `projects:create` on `organizations/org_8f3k9m2q/*`.
+
+
+
+Create and control browsers in the staging project using one saved extension.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'browsers:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'extensions:read', resource: 'projects/proj_staging_9f3k/extensions/ext_9k4m2q7s' },
+ { action: 'extensions:use', resource: 'projects/proj_staging_9f3k/extensions/ext_9k4m2q7s' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "browsers:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "extensions:read", "resource": "projects/proj_staging_9f3k/extensions/ext_9k4m2q7s"},
+ {"action": "extensions:use", "resource": "projects/proj_staging_9f3k/extensions/ext_9k4m2q7s"},
+ ],
+}
+```
+
+
+Pass `ext_9k4m2q7s` in the browser request's `extensions` list. Include `extensions:use` on every saved extension attached to a browser you access.
+
+
+
+Create browsers in staging and send their telemetry to one saved destination.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'browsers:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'telemetry_destinations:read', resource: 'projects/proj_staging_9f3k/telemetry_destinations/tdst_8k2q4m6r' },
+ { action: 'telemetry_destinations:use', resource: 'projects/proj_staging_9f3k/telemetry_destinations/tdst_8k2q4m6r' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "browsers:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "telemetry_destinations:read", "resource": "projects/proj_staging_9f3k/telemetry_destinations/tdst_8k2q4m6r"},
+ {"action": "telemetry_destinations:use", "resource": "projects/proj_staging_9f3k/telemetry_destinations/tdst_8k2q4m6r"},
+ ],
+}
+```
+
+
+Select destination ID `tdst_8k2q4m6r` in `telemetry.export.otlp.destination`. `telemetry_destinations:read` lets you inspect the destination; `telemetry_destinations:use` authorizes export.
+
+
+
+Acquire and release browsers from one pool that uses a saved profile.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'browser_pools:read', resource: 'projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s' },
+ { action: 'browser_pools:use', resource: 'projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s' },
+ { action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'profiles:use', resource: 'projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "browser_pools:read", "resource": "projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s"},
+ {"action": "browser_pools:use", "resource": "projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s"},
+ {"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "profiles:use", "resource": "projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1"},
+ ],
+}
+```
+
+
+Use pool `pool_6m2k9q4s`, configured with profile `prof_7h2kq9x4m1`. If its browsers also carry vaults or saved extensions, grant use of those resources too. An acquire-time profile that saves changes also needs `profiles:write`.
+
+
+
+Read a connection and start logins using its saved profile and credential, including saving updated credential values.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'auth_connections:read', resource: 'projects/proj_staging_9f3k/auth_connections/mconn_5k3m8q2r' },
+ { action: 'auth_connections:use', resource: 'projects/proj_staging_9f3k/auth_connections/mconn_5k3m8q2r' },
+ { action: 'profiles:use', resource: 'projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1' },
+ { action: 'profiles:write', resource: 'projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1' },
+ { action: 'credentials:use', resource: 'projects/proj_staging_9f3k/credentials/cred_4q8m2k6s' },
+ { action: 'credentials:write', resource: 'projects/proj_staging_9f3k/credentials/cred_4q8m2k6s' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "auth_connections:read", "resource": "projects/proj_staging_9f3k/auth_connections/mconn_5k3m8q2r"},
+ {"action": "auth_connections:use", "resource": "projects/proj_staging_9f3k/auth_connections/mconn_5k3m8q2r"},
+ {"action": "profiles:use", "resource": "projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1"},
+ {"action": "profiles:write", "resource": "projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1"},
+ {"action": "credentials:use", "resource": "projects/proj_staging_9f3k/credentials/cred_4q8m2k6s"},
+ {"action": "credentials:write", "resource": "projects/proj_staging_9f3k/credentials/cred_4q8m2k6s"},
+ ],
+}
+```
+
+
+Use connection `mconn_5k3m8q2r`, configured with profile `prof_7h2kq9x4m1` and credential `cred_4q8m2k6s`. Provider-backed connections additionally require `credential_providers:use` on the organization-owned provider.
+
+
+
+Deploy and run an app in staging, and read its deployment and invocation results.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'deployments:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'deployments:delete', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'deployments:read', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'invocations:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'invocations:write', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'invocations:read', resource: 'projects/proj_staging_9f3k/*' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "deployments:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "deployments:delete", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "deployments:read", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "invocations:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "invocations:write", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "invocations:read", "resource": "projects/proj_staging_9f3k/*"},
+ ],
+}
+```
+
+
+Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. Add permissions for the browser, profile, vault, or other operations your app performs. An invocation's caller must cover the runtime key's full policy and expire no earlier than that runtime key.
+
+
+
+Read staging API-key metadata, read organization audit logs, and look up browser configuration recommendations. Issue this as an organization-scoped key by omitting `project_id`.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'api_keys:read', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'audit_logs:read', resource: 'organizations/org_8f3k9m2q/*' },
+ { action: 'config_registry:read', resource: 'projects/proj_staging_9f3k/*' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "api_keys:read", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "audit_logs:read", "resource": "organizations/org_8f3k9m2q/*"},
+ {"action": "config_registry:read", "resource": "projects/proj_staging_9f3k/*"},
+ ],
+}
+```
+
+
+API-key reads return metadata and policies. Creating delegated keys requires `api_keys:create` on their container plus the permissions you intend to delegate; rotating keys requires `api_keys:rotate` and coverage of their policy.
+
+
+
+Run searches in staging, inspect their results, and retrieve page content with automatically created browsers.
+
+
+```typescript TypeScript
+const policy = {
+ statements: [
+ { action: 'searches:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'searches:read', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'searches:use', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:delete', resource: 'projects/proj_staging_9f3k/*' },
+ ],
+};
+```
+
+```python Python
+policy = {
+ "statements": [
+ {"action": "searches:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "searches:read", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "searches:use", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:delete", "resource": "projects/proj_staging_9f3k/*"},
+ ],
+}
+```
+
+
+The browser grants allow retrieval to create, control, and clean up its browser. To retrieve with an existing browser instead, grant access to that browser and its attached resources.
+
+
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 3f543546..b06803e5 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -19,6 +19,8 @@ API keys can be **org** or **project** scoped:
- Set `project_id` to create a project-scoped key that can only access resources in that project.
- When you authenticate with a project-scoped key, you can only create another project-scoped key for the same project.
+Organization/project scope sets the key's boundary. A `policy` separately limits which actions and resources it can access inside that boundary. Both organization- and project-scoped keys can have policies.
+
## Create an API key
Use the SDKs when your backend needs to provision keys for environments, customers, or automation jobs.
@@ -98,11 +100,13 @@ Use scoped keys when you hand a credential to code you trust less than your back
A policy is a list of **statements**. Each statement allows one **action** on one **resource**, and the key is denied everything no statement allows.
-- A **resource** is either one object, `projects/{project_id}/{kind}/{id}`, or everything in a container, `projects/{project_id}/*` or `organizations/{org_id}/*`.
-- An **action** is `{kind}:{verb}`, such as `browsers:use` or `vaults:read`.
+- A **resource** selects one project-owned object, such as `projects/{project_id}/extensions/{extension_id}`, an organization-owned object, such as `credential_providers/{provider_id}`, or a container such as `projects/{project_id}/*` or `organizations/{org_id}/*`.
+- An **action** is an exact name such as `browsers:use`, `extensions:read`, or `api_keys:create`. A container wildcard grants that action throughout the container, not every action.
Some operations need more than one action. For example, creating a browser with a profile needs `browsers:create` and `browsers:use` on the project, plus `profiles:use` on that profile. See [API key permissions](/info/api-key-permissions) for every action and what each operation requires.
+Policies cover browsers, profiles, vaults, proxies, extensions, telemetry destinations, browser pools, apps, managed auth, credentials, organization/project administration, API keys, audit logs, search, and the configuration registry. Start with a [policy example](/info/api-key-policy-examples) for your workload.
+
### Create a scoped key
This key can create and control browsers in one project, only with profile `prof_7h2kq9x4m1` or no profile, and expires in one hour:
@@ -162,19 +166,39 @@ print(api_key.key) # Save this value now. Kernel won't show it again.
- An expired key is rejected immediately, and a deleted key within about 10 seconds. Neither revokes connection URLs (CDP, WebDriver, live view) the key already obtained. They keep working, including for new connections, until the browser is deleted, so delete the key's browsers to cut off access.
- Rotating a scoped key keeps its policy.
-Scoped keys can't manage API keys, and they get `403` on endpoints that don't support scoped access yet.
+### Delegate a narrower key
+
+You can use a scoped key to create another scoped key:
+
+1. Grant the issuer `api_keys:create` on the new key's project or organization container.
+2. Supply a `policy` whose statements are covered by the issuer's policy, and keep the new key inside the issuer's organization/project boundary.
+3. Set the new key's expiry no later than the issuer's expiry.
+
+For example, an issuer with `api_keys:create` and `browsers:use` on a project can issue a key with only `browsers:use` on one browser in that project. Use the same SDK creation call shown above with the narrower policy.
+
+Use `api_keys:read` to inspect keys, `api_keys:write` to rename them, `api_keys:delete` to revoke them, and `api_keys:rotate` to replace them. Rotation also requires the issuer to cover the target key's policy and the replacement's expiry. These permissions are separate, so you can grant metadata access without granting key issuance or rotation.
## Deployment API keys
When you deploy an app, Kernel mints a **deployment-scoped API key** for that deployment and injects it into the deployment (and every invocation it runs) as the `KERNEL_API_KEY` environment variable. Because the SDKs read `KERNEL_API_KEY` from the environment by default, your app can call the Kernel API as itself without you managing a key.
+When you deploy with a scoped key, the deployment key inherits your policy narrowed to the deployment's project, plus your expiry. Deploying requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. Add permissions for the operations your app performs, such as creating browsers or using profiles.
+
+To invoke that deployment with a scoped key, grant `invocations:create` and every permission held by the deployment key. The invoking key must expire no earlier than the deployment key. Scoped callers run deployments with scoped runtime keys; deployments created with unrestricted keys require an unrestricted caller.
+
+
+Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support. See the [app policy example](/info/api-key-policy-examples) for a deployment and invocation policy.
+
+
Key points about deployment keys:
- **One key per deployment.** Each deploy (including a redeploy of the same app) mints a fresh deployment key. `KERNEL_API_KEY` is a [reserved environment variable](/apps/deploy#reserved-environment-variables) — a value you supply at deploy time is overridden by the injected key. To use your own long-lived key, pass it under a non-reserved name.
-- **Lifecycle tied to the deployment.** A deployment key stays valid while its deployment is active. When you redeploy, the new deployment supersedes the old one, and the old deployment's key is released once it is no longer needed — that is, once the superseded deployment is stopped **and** no invocation is still running on it.
-- **In-flight invocations are drained, not cut off.** If an invocation is still running on a deployment that gets superseded, its key is kept valid until that invocation completes; the key is released right after. An idle redeploy (nothing in flight) releases the old key immediately. In the rare case where an invocation's workflow terminates without releasing the key, a background sweep releases it after a grace period (~95 minutes). You do not need to manage any of this — it is automatic.
+- **Lifecycle tied to the deployment.** A deployment key is released when it's no longer needed. For scoped deployments, it also expires at the deployer's expiry. When you redeploy, the new deployment supersedes the old one, and the old deployment's key is released once it is no longer needed — that is, once the superseded deployment is stopped **and** no invocation is still running on it.
+- **Superseded deployments drain in-flight invocations.** If an invocation is still running on a deployment that gets superseded, its key is retained until that invocation completes; its expiry still applies, and the key is released afterward. An idle redeploy (nothing in flight) releases the old key immediately. In the rare case where an invocation's workflow terminates without releasing the key, a background sweep releases it after a grace period (~95 minutes). You do not need to manage any of this — it is automatic.
-If you need a credential whose lifetime you control (for CI, a persistent backend, or a resource that should outlive any single deployment), create an org- or project-scoped key as described below and pass it explicitly to the client. This only affects the calls your app makes — the platform still injects the deployment key and uses it to run the invocation and report its result, so you're choosing the credential for your own calls, not replacing the deployment key.
+Revoking the deploying key doesn't revoke the deployment's key or stop its invocations. Stop the deployment and let in-flight invocations drain, or revoke the deployment key to stop further API requests.
+
+If you need a credential whose lifetime you control (for CI, a persistent backend, or a resource that should outlive any single deployment), create an org- or project-scoped key as described above and pass it explicitly to the client. This only affects the calls your app makes — the platform still injects the deployment key and uses it to run the invocation and report its result, so you're choosing the credential for your own calls, not replacing the deployment key.
## List and inspect API keys
@@ -311,6 +335,8 @@ Two optional parameters control the timing:
- `days_to_expire` sets the new key's lifetime in days (`1`-`3650`). Omit it to give the new key the same lifetime the rotated key originally had, or to never expire if the old key never did.
- `expire_in_days` sets how long the old key keeps working before it expires. Use `0` to revoke it immediately, or omit it for the default 7-day grace window. The old key stops authenticating automatically once the window passes—you don't need to delete it.
+When you rotate using a scoped key, the caller needs `api_keys:rotate` on the target and must cover its policy. The replacement must expire no later than the caller; choose `days_to_expire` within that remaining lifetime.
+
```typescript TypeScript
const rotated = await kernel.apiKeys.rotate('key_01jwv4tn5m8k3q2v7x9p0a1bc2', {
diff --git a/info/projects.mdx b/info/projects.mdx
index 12e0221a..fbf557f3 100644
--- a/info/projects.mdx
+++ b/info/projects.mdx
@@ -104,9 +104,9 @@ func main() {
API keys can be **org-wide** or **project-scoped**.
-- **Existing API keys are org-wide.** They see every resource in your organization across all projects. Include an `X-Kernel-Project-Id` header to restrict a single request to one project.
+- **Organization-scoped API keys** can reach resources across projects. If the key has a [policy](/info/api-key-permissions), its grants determine which actions and resources it can access. Include an `X-Kernel-Project-Id` header to select a project for a request.
- **Project-scoped API keys** can only access resources inside the project they were issued for. Create one from the **API Keys** page in the dashboard, the [CLI](/reference/cli/api-keys), an SDK, or the [API keys guide](/info/api-keys), and pass the target `project_id` when generating the key. Requests made with a scoped key are automatically limited to that project — no header required. If you do send an `X-Kernel-Project-Id` header and it conflicts with the key's project, the request is rejected with `403 Forbidden`.
-- **Most project administration requires an org-wide credential.** A project-scoped key may rename its own project, but cannot create, archive, or delete projects, or change project limits.
+- **Most project administration requires an org-wide credential.** A project-scoped key may rename its own project, but cannot create, archive, or delete projects, or change project limits. Policy-scoped keys additionally need `projects:read`, `projects:write`, or `projects:delete` on the target project. Creating a project requires `projects:create` on `organizations/{org_id}/*`; organization limits use `organizations:read` and `organizations:write`.
### OAuth
From 970230e9b232d22e47af4ef32db255561cce7fef Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 10 Nov 2026 16:56:09 +0000
Subject: [PATCH 02/22] Document permission to issue longer-lived API keys
---
info/api-key-permissions.mdx | 5 ++--
info/api-keys.mdx | 54 ++++++++++++++++++++++++++++++++----
2 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 1576f230..2a5d34af 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -169,12 +169,13 @@ A read grant returns connection metadata. To receive hosted login or live view U
| Action | Allows |
| --- | --- |
| `api_keys:create` | Issue keys in the authorized container. A scoped issuer must grant a subset of its own policy. |
+| `api_keys:issue_beyond_expiry` | Allow a scoped key's finite expiry to exceed the caller's, up to 3650 days. Grant it on the new key's container for creation, or the existing key for rotation. Scoped callers cannot pass this permission to another key. |
| `api_keys:read` | List keys and read metadata and policies, without plaintext keys. |
| `api_keys:write` | Rename keys. |
| `api_keys:rotate` | Replace keys whose policies the caller covers, returning the new plaintext key. |
| `api_keys:delete` | Revoke keys. |
-New and rotated keys must expire no later than a scoped issuer. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
+A new or rotated key with a policy must expire no later than its issuer unless the issuer holds `api_keys:issue_beyond_expiry` on the target. Excessive expiry requests return `400`; Kernel never silently shortens them. Other permission checks still apply. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
### Audit logs and export destinations
@@ -234,7 +235,7 @@ Connection updates check the resulting configuration. Turning off credential sav
| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the deployment runtime key's policy, and your key must expire no earlier than that runtime key. |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
-| Create or rotate an API key | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. Its expiry must fit within your own key's expiry. |
+| Create or rotate an API key | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. Its expiry must fit within your own key's expiry unless you also hold `api_keys:issue_beyond_expiry` on the target. A scoped caller cannot issue or rotate a key carrying that permission. |
| Update an audit export destination | `audit_log_export_destinations:write` and organization-wide `audit_logs:read`. |
| Retrieve search content with an automatically created browser | `searches:use` plus container-wide `browsers:create`, `browsers:use`, and `browsers:delete`. With an existing browser, grant access to that browser and its attachments instead. |
| Resolve a browser configuration | `config_registry:create` and `config_registry:read`. |
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index b06803e5..6be86db9 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -162,7 +162,7 @@ print(api_key.key) # Save this value now. Kernel won't show it again.
### Expiry and revocation
-- Use `expires_at` for an exact expiry, such as minutes from now, instead of `days_to_expire`. A scoped key can't outlive the key that creates it.
+- Use `expires_at` for an exact expiry, such as minutes from now, instead of `days_to_expire`. A key with a policy can't outlive its issuer unless the issuer holds `api_keys:issue_beyond_expiry` on the target. Kernel returns `400` for an expiry it can't honor; it never silently shortens the requested lifetime.
- An expired key is rejected immediately, and a deleted key within about 10 seconds. Neither revokes connection URLs (CDP, WebDriver, live view) the key already obtained. They keep working, including for new connections, until the browser is deleted, so delete the key's browsers to cut off access.
- Rotating a scoped key keeps its policy.
@@ -172,11 +172,55 @@ You can use a scoped key to create another scoped key:
1. Grant the issuer `api_keys:create` on the new key's project or organization container.
2. Supply a `policy` whose statements are covered by the issuer's policy, and keep the new key inside the issuer's organization/project boundary.
-3. Set the new key's expiry no later than the issuer's expiry.
+3. Set the new key's expiry no later than the issuer's expiry, or grant the issuer `api_keys:issue_beyond_expiry` on that container and request a finite lifetime of at most 3650 days.
For example, an issuer with `api_keys:create` and `browsers:use` on a project can issue a key with only `browsers:use` on one browser in that project. Use the same SDK creation call shown above with the narrower policy.
-Use `api_keys:read` to inspect keys, `api_keys:write` to rename them, `api_keys:delete` to revoke them, and `api_keys:rotate` to replace them. Rotation also requires the issuer to cover the target key's policy and the replacement's expiry. These permissions are separate, so you can grant metadata access without granting key issuance or rotation.
+Use `api_keys:read` to inspect keys, `api_keys:write` to rename them, `api_keys:delete` to revoke them, and `api_keys:rotate` to replace them. Rotation also requires the issuer to cover the target key's policy. Its expiry follows the same rule as creation, with `api_keys:issue_beyond_expiry` checked on the existing key. These permissions are separate, so you can grant metadata access without granting key issuance or rotation.
+
+### Allow longer-lived child keys
+
+Use an unscoped credential to issue a trusted key with `api_keys:issue_beyond_expiry`. This permission doesn't grant creation, rotation, or resource access by itself.
+
+
+```typescript TypeScript
+const issuer = await kernel.apiKeys.create({
+ name: 'ci-key-issuer',
+ project_id: 'proj_staging_9f3k',
+ days_to_expire: 30,
+ policy: {
+ statements: [
+ { action: 'api_keys:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'api_keys:issue_beyond_expiry', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
+ ],
+ },
+});
+```
+
+```python Python
+issuer = client.api_keys.create(
+ name="ci-key-issuer",
+ project_id="proj_staging_9f3k",
+ days_to_expire=30,
+ policy={
+ "statements": [
+ {"action": "api_keys:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "api_keys:issue_beyond_expiry", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
+ ],
+ },
+)
+```
+
+
+Authenticate with `issuer.key` to create a child with `days_to_expire: 365` and only `browsers:use` on this project. Its expiry is one year, not silently shortened to the issuer's 30 days. Without the special permission, that request returns `400`.
+
+The child must have a finite expiry of at most 3650 days. Scoped callers cannot create or rotate keys whose policies contain `api_keys:issue_beyond_expiry`, so the child can't inherit this authority. Add `api_keys:rotate` separately to let the issuer rotate other keys.
+
+
+Grant this permission only to trusted issuers. Their child keys can remain valid after the issuer expires or is revoked.
+
## Deployment API keys
@@ -335,7 +379,7 @@ Two optional parameters control the timing:
- `days_to_expire` sets the new key's lifetime in days (`1`-`3650`). Omit it to give the new key the same lifetime the rotated key originally had, or to never expire if the old key never did.
- `expire_in_days` sets how long the old key keeps working before it expires. Use `0` to revoke it immediately, or omit it for the default 7-day grace window. The old key stops authenticating automatically once the window passes—you don't need to delete it.
-When you rotate using a scoped key, the caller needs `api_keys:rotate` on the target and must cover its policy. The replacement must expire no later than the caller; choose `days_to_expire` within that remaining lifetime.
+When you rotate using a scoped key, the caller needs `api_keys:rotate` on the target and must cover its policy. For a replacement with a policy, choose `days_to_expire` within the caller's remaining lifetime or hold `api_keys:issue_beyond_expiry` on the target. The same validation applies when you omit `days_to_expire` and reuse the old lifetime. A disallowed expiry returns `400`, never a shortened replacement. A scoped caller cannot rotate a key that itself carries `api_keys:issue_beyond_expiry`.
```typescript TypeScript
@@ -410,7 +454,7 @@ To cut over immediately instead of using a grace window, pass `expire_in_days: 0
| --- | --- | --- |
| `400 Bad Request` | The name is missing, `days_to_expire` is outside `1`-`3650`, `expire_in_days` is outside `0`-`3650`, or `project_id` is empty. | Send a name, choose a valid expiry, or omit `project_id` for an org-scoped key. |
| `400 Bad Request` (rotate) | `days_to_expire` is shorter than `expire_in_days`, so the new key would expire before the old key's grace window ends. | Raise `days_to_expire` or lower `expire_in_days`. |
-| `400 Bad Request` (scoped key) | The policy has an unknown action or a resource outside the key's organization or project, or the expiry is invalid or later than your own key's. | Check the policy against [API key permissions](/info/api-key-permissions) and send one expiry field. |
+| `400 Bad Request` (scoped key) | The policy has an unknown action or a resource outside the key's organization or project, or the expiry exceeds the issuer's without the required permission. | Check [API key permissions](/info/api-key-permissions). Request an allowed expiry, or have an unscoped issuer grant `api_keys:issue_beyond_expiry`; its exception requires a finite expiry within 3650 days. |
| `401 Unauthorized` | Kernel couldn't authenticate the request. | Set a valid `KERNEL_API_KEY`. |
| `403 Forbidden` (`insufficient_scope`) | A scoped key is missing a permission. | The message names the missing action and resource. Add it to the policy. |
| `404 Not Found` | The project, API key, or a resource named in the policy doesn't exist, or the caller can't access it. | Check the ID. If you're using a project-scoped key, you can only rotate keys in that same project. |
From 511e7f44070a8f3e370d00a343f11036bd400c45 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 10 Nov 2026 17:59:36 +0000
Subject: [PATCH 03/22] Document projects:delete for project archive and
restore
---
info/api-key-permissions.mdx | 4 ++--
info/api-key-policy-examples.mdx | 2 +-
info/projects.mdx | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 2a5d34af..d7bf789c 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -42,8 +42,8 @@ A policy narrows your key's access; it doesn't change its organization or projec
| `organizations:write` | Set the organization's default per-project limits. |
| `projects:create` | Create projects. Grant on the organization container. |
| `projects:read` | List projects and read project metadata and limits. |
-| `projects:write` | Rename projects, change their status, and set their limits. |
-| `projects:delete` | Delete empty projects. |
+| `projects:write` | Rename projects and set their limits. |
+| `projects:delete` | Archive or restore projects, and delete empty projects. A project update that changes `status` along with other fields also needs `projects:write`. |
### Browsers
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index cea87bc3..118872fa 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -36,7 +36,7 @@ policy = {
```
-Create additional projects with `projects:create` on `organizations/org_8f3k9m2q/*`.
+Add `projects:delete` on `projects/proj_staging_9f3k` to archive or restore the project. Create additional projects with `projects:create` on `organizations/org_8f3k9m2q/*`.
diff --git a/info/projects.mdx b/info/projects.mdx
index fbf557f3..5c61d07f 100644
--- a/info/projects.mdx
+++ b/info/projects.mdx
@@ -106,7 +106,7 @@ API keys can be **org-wide** or **project-scoped**.
- **Organization-scoped API keys** can reach resources across projects. If the key has a [policy](/info/api-key-permissions), its grants determine which actions and resources it can access. Include an `X-Kernel-Project-Id` header to select a project for a request.
- **Project-scoped API keys** can only access resources inside the project they were issued for. Create one from the **API Keys** page in the dashboard, the [CLI](/reference/cli/api-keys), an SDK, or the [API keys guide](/info/api-keys), and pass the target `project_id` when generating the key. Requests made with a scoped key are automatically limited to that project — no header required. If you do send an `X-Kernel-Project-Id` header and it conflicts with the key's project, the request is rejected with `403 Forbidden`.
-- **Most project administration requires an org-wide credential.** A project-scoped key may rename its own project, but cannot create, archive, or delete projects, or change project limits. Policy-scoped keys additionally need `projects:read`, `projects:write`, or `projects:delete` on the target project. Creating a project requires `projects:create` on `organizations/{org_id}/*`; organization limits use `organizations:read` and `organizations:write`.
+- **Most project administration requires an org-wide credential.** A project-scoped key may rename its own project, but cannot create, archive, restore, or delete projects, or change project limits. Policy-scoped keys additionally need `projects:read` to view the target project, `projects:write` to rename it or change its limits, and `projects:delete` to archive, restore, or delete it. An update that changes status along with other fields needs both `projects:write` and `projects:delete`. Creating a project requires `projects:create` on `organizations/{org_id}/*`; organization limits use `organizations:read` and `organizations:write`.
### OAuth
From e7a3f2ce384a80540713fb9c491a806564471b49 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 10 Nov 2026 19:22:13 +0000
Subject: [PATCH 04/22] Limit rotation expiry checks to callers with policies
---
info/api-key-permissions.mdx | 2 +-
info/api-keys.mdx | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index d7bf789c..1419eed5 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -175,7 +175,7 @@ A read grant returns connection metadata. To receive hosted login or live view U
| `api_keys:rotate` | Replace keys whose policies the caller covers, returning the new plaintext key. |
| `api_keys:delete` | Revoke keys. |
-A new or rotated key with a policy must expire no later than its issuer unless the issuer holds `api_keys:issue_beyond_expiry` on the target. Excessive expiry requests return `400`; Kernel never silently shortens them. Other permission checks still apply. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
+A new key with a policy must expire no later than the credential that creates it unless that credential holds `api_keys:issue_beyond_expiry` on the target container. The same limit applies when a caller with a policy rotates a key, checked on the existing key. Rotation by a caller without a policy keeps its existing replacement-lifetime behavior. Excessive expiry requests return `400`; Kernel never silently shortens them. Other permission checks still apply. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
### Audit logs and export destinations
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index d56c4ea1..cec46c7f 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -162,7 +162,7 @@ print(api_key.key) # Save this value now. Kernel won't show it again.
### Expiry and revocation
-- Use `expires_at` for an exact expiry, such as minutes from now, instead of `days_to_expire`. A key with a policy can't outlive its issuer unless the issuer holds `api_keys:issue_beyond_expiry` on the target. Kernel returns `400` for an expiry it can't honor; it never silently shortens the requested lifetime.
+- Use `expires_at` for an exact expiry, such as minutes from now, instead of `days_to_expire`. When you create a key with a policy, it can't outlive the issuing credential unless that credential holds `api_keys:issue_beyond_expiry` on the target. Kernel returns `400` for an expiry it can't honor; it never silently shortens the requested lifetime.
- Expired and deleted keys can't authenticate new API requests.
- Deleting a key through the API or dashboard, or rotating it with `expire_in_days: 0`, also ends browser sessions associated with that key, including pool browsers it acquired and hasn't released. Cleanup runs asynchronously and discards unsaved profile changes.
- Grace-period expiry and natural expiry do **not** end existing browsers. Delete those browsers explicitly if you need to stop them.
@@ -184,7 +184,7 @@ You can use a scoped key to create another scoped key:
For example, an issuer with `api_keys:create` and `browsers:use` on a project can issue a key with only `browsers:use` on one browser in that project. Use the same SDK creation call shown above with the narrower policy.
-Use `api_keys:read` to inspect keys, `api_keys:write` to rename them, `api_keys:delete` to revoke them, and `api_keys:rotate` to replace them. Rotation also requires the issuer to cover the target key's policy. Its expiry follows the same rule as creation, with `api_keys:issue_beyond_expiry` checked on the existing key. These permissions are separate, so you can grant metadata access without granting key issuance or rotation.
+Use `api_keys:read` to inspect keys, `api_keys:write` to rename them, `api_keys:delete` to revoke them, and `api_keys:rotate` to replace them. When a scoped key rotates another key, it must also cover the target key's policy, and the replacement's expiry follows the same rule as creation, with `api_keys:issue_beyond_expiry` checked on the existing key. These permissions are separate, so you can grant metadata access without granting key issuance or rotation.
### Allow longer-lived child keys
@@ -387,7 +387,9 @@ Two optional parameters control the timing:
- `days_to_expire` sets the new key's lifetime in days (`1`-`3650`). Omit it to give the new key the same lifetime the rotated key originally had, or to never expire if the old key never did.
- `expire_in_days` sets how long the old key keeps working before it expires. Use `0` to revoke it immediately, or omit it for the default 7-day grace window. The old key stops authenticating automatically once the window passes—you don't need to delete it.
-When you rotate using a scoped key, the caller needs `api_keys:rotate` on the target and must cover its policy. For a replacement with a policy, choose `days_to_expire` within the caller's remaining lifetime or hold `api_keys:issue_beyond_expiry` on the target. The same validation applies when you omit `days_to_expire` and reuse the old lifetime. A disallowed expiry returns `400`, never a shortened replacement. A scoped caller cannot rotate a key that itself carries `api_keys:issue_beyond_expiry`.
+If the key you rotate with has no policy, these lifetime rules apply to every target, including keys with policies, and you don't need `api_keys:issue_beyond_expiry`.
+
+If the key you rotate with has a policy, it needs `api_keys:rotate` on the target and must cover the target's policy. When the caller expires, the replacement must expire no later than the caller, or the caller must hold `api_keys:issue_beyond_expiry` on the target and request a finite lifetime of up to 3650 days. The same check applies when you omit `days_to_expire` and reuse the old lifetime. A disallowed expiry returns `400`, never a shortened replacement. A caller with a policy cannot rotate a key that itself carries `api_keys:issue_beyond_expiry`.
```typescript TypeScript
@@ -462,7 +464,7 @@ To cut over immediately instead of using a grace window, pass `expire_in_days: 0
| --- | --- | --- |
| `400 Bad Request` | The name is missing, `days_to_expire` is outside `1`-`3650`, `expire_in_days` is outside `0`-`3650`, or `project_id` is empty. | Send a name, choose a valid expiry, or omit `project_id` for an org-scoped key. |
| `400 Bad Request` (rotate) | `days_to_expire` is shorter than `expire_in_days`, so the new key would expire before the old key's grace window ends. | Raise `days_to_expire` or lower `expire_in_days`. |
-| `400 Bad Request` (scoped key) | The policy has an unknown action or a resource outside the key's organization or project, or the expiry exceeds the issuer's without the required permission. | Check [API key permissions](/info/api-key-permissions). Request an allowed expiry, or have an unscoped issuer grant `api_keys:issue_beyond_expiry`; its exception requires a finite expiry within 3650 days. |
+| `400 Bad Request` (scoped key) | The policy has an unknown action or a resource outside the key's organization or project, or the requested expiry exceeds the issuing or rotating credential's without the required permission. | Check [API key permissions](/info/api-key-permissions). Request an allowed expiry, or have an unscoped issuer grant `api_keys:issue_beyond_expiry`; its exception requires a finite expiry within 3650 days. |
| `401 Unauthorized` | Kernel couldn't authenticate the request. | Set a valid `KERNEL_API_KEY`. |
| `403 Forbidden` (`insufficient_scope`) | A scoped key is missing a permission. | The message names the missing action and resource. Add it to the policy. |
| `404 Not Found` | The project, API key, or a resource named in the policy doesn't exist, or the caller can't access it. | Check the ID. If you're using a project-scoped key, you can only rotate keys in that same project. |
From 6745c32080cd7f2f41d08893ceba8cb0f6b4ce4f Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 10 Nov 2026 19:33:07 +0000
Subject: [PATCH 05/22] Clarify API key expiry limits for callers with policies
---
info/api-key-permissions.mdx | 2 +-
info/api-keys.mdx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 1419eed5..7389de9f 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -235,7 +235,7 @@ Connection updates check the resulting configuration. Turning off credential sav
| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the deployment runtime key's policy, and your key must expire no earlier than that runtime key. |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
-| Create or rotate an API key | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. Its expiry must fit within your own key's expiry unless you also hold `api_keys:issue_beyond_expiry` on the target. A scoped caller cannot issue or rotate a key carrying that permission. |
+| Create or rotate an API key with a key that has a policy | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. If your key expires, the new or replacement key must expire no later than it unless you also hold `api_keys:issue_beyond_expiry` on the target and request a finite lifetime of up to 3650 days. You can't issue or rotate a key carrying that permission. |
| Update an audit export destination | `audit_log_export_destinations:write` and organization-wide `audit_logs:read`. |
| Retrieve search content with an automatically created browser | `searches:use` plus container-wide `browsers:create`, `browsers:use`, and `browsers:delete`. With an existing browser, grant access to that browser and its attachments instead. |
| Resolve a browser configuration | `config_registry:create` and `config_registry:read`. |
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index cec46c7f..5dc79ed9 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -464,7 +464,7 @@ To cut over immediately instead of using a grace window, pass `expire_in_days: 0
| --- | --- | --- |
| `400 Bad Request` | The name is missing, `days_to_expire` is outside `1`-`3650`, `expire_in_days` is outside `0`-`3650`, or `project_id` is empty. | Send a name, choose a valid expiry, or omit `project_id` for an org-scoped key. |
| `400 Bad Request` (rotate) | `days_to_expire` is shorter than `expire_in_days`, so the new key would expire before the old key's grace window ends. | Raise `days_to_expire` or lower `expire_in_days`. |
-| `400 Bad Request` (scoped key) | The policy has an unknown action or a resource outside the key's organization or project, or the requested expiry exceeds the issuing or rotating credential's without the required permission. | Check [API key permissions](/info/api-key-permissions). Request an allowed expiry, or have an unscoped issuer grant `api_keys:issue_beyond_expiry`; its exception requires a finite expiry within 3650 days. |
+| `400 Bad Request` (scoped key) | The policy has an unknown action or a resource outside the key's organization or project. Or the requested expiry exceeds the calling key's expiry without `api_keys:issue_beyond_expiry`, when you create a key with a policy or rotate using a key with a policy. | Check [API key permissions](/info/api-key-permissions). Request an allowed expiry, or have an unscoped issuer grant `api_keys:issue_beyond_expiry`; its exception requires a finite expiry within 3650 days. Rotating with a key that has no policy doesn't apply this limit. |
| `401 Unauthorized` | Kernel couldn't authenticate the request. | Set a valid `KERNEL_API_KEY`. |
| `403 Forbidden` (`insufficient_scope`) | A scoped key is missing a permission. | The message names the missing action and resource. Add it to the policy. |
| `404 Not Found` | The project, API key, or a resource named in the policy doesn't exist, or the caller can't access it. | Check the ID. If you're using a project-scoped key, you can only rotate keys in that same project. |
From 9ad9386f7e3115e6547f04fb4b977bcd3ac44fdd Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 10 Nov 2026 21:30:00 +0000
Subject: [PATCH 06/22] Note that action-limited OAuth tokens can't manage API
keys
---
info/api-key-permissions.mdx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 7389de9f..ba0bed85 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -177,6 +177,8 @@ A read grant returns connection metadata. To receive hosted login or live view U
A new key with a policy must expire no later than the credential that creates it unless that credential holds `api_keys:issue_beyond_expiry` on the target container. The same limit applies when a caller with a policy rotates a key, checked on the existing key. Rotation by a caller without a policy keeps its existing replacement-lifetime behavior. Excessive expiry requests return `400`; Kernel never silently shortens them. Other permission checks still apply. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
+OAuth access tokens limited to specific actions can't hold any `api_keys:` action, so they can't read, create, rename, rotate, or delete API keys. Use an API key with these permissions instead. OAuth tokens without action limits keep their existing organization or project access.
+
### Audit logs and export destinations
| Action | Allows |
From a79f46d7d5f128440a876b5be4a6d884dfddee8b Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 10 Nov 2026 21:32:17 +0000
Subject: [PATCH 07/22] Clarify which OAuth tokens can't manage API keys
---
info/api-key-permissions.mdx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index ba0bed85..859e3921 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -177,7 +177,7 @@ A read grant returns connection metadata. To receive hosted login or live view U
A new key with a policy must expire no later than the credential that creates it unless that credential holds `api_keys:issue_beyond_expiry` on the target container. The same limit applies when a caller with a policy rotates a key, checked on the existing key. Rotation by a caller without a policy keeps its existing replacement-lifetime behavior. Excessive expiry requests return `400`; Kernel never silently shortens them. Other permission checks still apply. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
-OAuth access tokens limited to specific actions can't hold any `api_keys:` action, so they can't read, create, rename, rotate, or delete API keys. Use an API key with these permissions instead. OAuth tokens without action limits keep their existing organization or project access.
+OAuth access tokens that carry a policy, including tokens limited to specific actions, machine-to-machine tokens, and exchanged tokens, can't hold any `api_keys:` action, so they can't read, create, rename, rotate, or delete API keys. Requests for these permissions are rejected. Use an API key with these permissions instead. An OAuth token that only requests identity scopes and is used directly keeps its existing organization or project access.
### Audit logs and export destinations
From 19be78b0414ae386a9aab187fc7652ef19a3c186 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 10 Nov 2026 22:17:14 +0000
Subject: [PATCH 08/22] Describe policy-mode OAuth tokens' API key restriction
---
info/api-key-permissions.mdx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 859e3921..456182b0 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -177,7 +177,7 @@ A read grant returns connection metadata. To receive hosted login or live view U
A new key with a policy must expire no later than the credential that creates it unless that credential holds `api_keys:issue_beyond_expiry` on the target container. The same limit applies when a caller with a policy rotates a key, checked on the existing key. Rotation by a caller without a policy keeps its existing replacement-lifetime behavior. Excessive expiry requests return `400`; Kernel never silently shortens them. Other permission checks still apply. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
-OAuth access tokens that carry a policy, including tokens limited to specific actions, machine-to-machine tokens, and exchanged tokens, can't hold any `api_keys:` action, so they can't read, create, rename, rotate, or delete API keys. Requests for these permissions are rejected. Use an API key with these permissions instead. An OAuth token that only requests identity scopes and is used directly keeps its existing organization or project access.
+Policy-mode OAuth tokens, which are tokens that request specific actions, machine-to-machine tokens, and exchanged tokens, never receive `api_keys:` permissions, so they can't read, create, rename, rotate, or delete API keys. OAuth requests for API-key scopes or permissions are rejected. Use an API key with these permissions instead. An OAuth token that requests only identity scopes and is used directly doesn't run in policy mode, so it keeps its existing organization or project access, including API key management.
### Audit logs and export destinations
From f9a6f3403cfb637a6dd945a058fe8116776d81c2 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 17 Nov 2026 14:57:29 +0000
Subject: [PATCH 09/22] Align scoped-key docs with runtime and resource checks
---
apps/deploy.mdx | 2 +-
info/api-key-permissions.mdx | 22 +++++++++++++++++-----
info/api-key-policy-examples.mdx | 4 ++--
info/api-keys.mdx | 9 +++++----
4 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index 1f37f5c2..7e438f2a 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -53,7 +53,7 @@ To deploy with a [policy-scoped API key](/info/api-keys#scope-a-key-to-specific-
- `deployments:delete` to replace older deployments of the same app and version.
- `invocations:write` so the runtime can report invocation results and attach browsers.
-The deployment's injected runtime key inherits your project-limited policy and expiry. Add the browser, profile, vault, or other permissions your app needs. To invoke it with a scoped key, also grant `invocations:create` and ensure the invoking key covers the runtime key's full policy and expiry. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
+The deployment's injected runtime key inherits your project-limited policy and expiry, excluding `api_keys:issue_beyond_expiry`. That permission doesn't extend the runtime key's lifetime. Add the browser, profile, vault, or other permissions your app needs. To invoke it with a scoped key, also grant `invocations:create` and ensure the invoking key covers the runtime key's full policy and expiry. The runtime key must still be valid, unrevoked, and unexpired. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support.
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 456182b0..724944b3 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -20,7 +20,7 @@ Choose `kind` from the following resource types:
| Scope | Resource kinds |
| --- | --- |
-| Project | `browsers`, `profiles`, `vaults`, `proxies`, `extensions`, `telemetry_destinations`, `browser_pools`, `deployments`, `invocations`, `credentials`, `auth_connections` |
+| Project | `browsers`, `profiles`, `vaults`, `proxies`, `extensions`, `telemetry_destinations`, `browser_pools`, `tasks`, `deployments`, `invocations`, `credentials`, `auth_connections` |
| Organization | `credential_providers`, `vault_provider_configs`, `audit_log_export_destinations` |
| Matches the target key | `api_keys`: a project key belongs to its project; a key without a project belongs to the organization, not the default project. |
@@ -115,6 +115,16 @@ Scoped keys resolve destinations within the request's project. Reading and selec
| `browser_pools:write` | Update pool configuration and flush idle browsers. |
| `browser_pools:delete` | Delete pools and their browsers. |
+### Tasks and reports
+
+| Action | Allows |
+| --- | --- |
+| `tasks:create` | Create tasks. Grant on the project or organization container. |
+| `tasks:read` | List and read tasks, linked browser IDs, and reports; find report types for a task. |
+| `tasks:write` | Link browsers and submit reports. Also requires `tasks:read` on the task. |
+
+Reports use their parent task's permissions; they don't have separate policy selectors or actions. Linking a browser, including through a report, requires `browsers:use` on that browser, but not permissions on its attachments: linking doesn't control it. Reading a linked browser ID doesn't grant browser access. Retrieving a report type or version by name requires no additional policy action.
+
### Apps, deployments, and invocations
| Action | Allows |
@@ -210,17 +220,19 @@ Policy-mode OAuth tokens, which are tokens that request specific actions, machin
| Create a browser | Container-wide `browsers:create` and `browsers:use`, because the response includes connection URLs. Add `profiles:use` on its profile, `profiles:write` if it saves changes, `vaults:use` on each linked vault, `extensions:use` on saved extensions, `proxies:use` on selected saved proxies, and `telemetry_destinations:use` on an export destination. |
| Access an existing browser | The browser action, plus `profiles:use` on its attached profile, `vaults:use` on linked vaults, and `extensions:use` on saved extensions. If the browser saves profile changes, also grant `profiles:write`. |
| Update a browser | `browsers:write` and `browsers:use`, plus permissions on attached resources and newly selected resources. |
-| Create or update a pool | The pool's `create` or `write` action, plus `use` on the profiles, proxies, and extensions you select. |
+| Create or update a pool | The pool's `create` or `write` action, plus `profiles:use` and `proxies:use` on selected resources, including proxy routes. Selecting saved extensions isn't supported for scoped credentials yet. |
| Acquire a pooled browser | `browser_pools:use`, container-wide `browsers:use`, and permissions on the pool's profile/extensions and the browser's actual attachments. An acquire-time profile also requires `profiles:write` when saving changes. |
| Release a pooled browser | `browser_pools:use` and access to the leased browser, including its attachments. |
| Force-delete a pool with leased browsers | `browser_pools:delete` and `browsers:delete` on every leased browser. |
| Run a proxy health check | `proxies:use` and `proxies:read`. |
+Browsers used for managed auth logins, reauthentication, or health checks additionally require `auth_connections:use` and the current connection's profile, credential, and provider permissions. This applies to browser lists and direct access. If the source connection is unavailable, those browsers remain hidden and inaccessible to scoped keys.
+
### Auth connections and vaults
| Operation | Requires |
| --- | --- |
-| Create or update an auth connection, start a login, or submit login input | The connection's action, `profiles:use` and `profiles:write` on its profile, and `credentials:use` on a linked credential. Add `credentials:write` when saving values, `credentials:create` when creating a credential, `profiles:create` when creating a profile, and `credential_providers:use` for a provider-backed connection. |
+| Create or update an auth connection, start a login, or submit login input | The connection's action, `profiles:use` and `profiles:write` on its profile, and `credentials:use` on a linked credential. Add `credentials:write` when saving values into an existing credential, `profiles:create` when creating a profile, and `credential_providers:use` for a provider-backed connection. Creating a credential, including automatically during a later login, requires container-wide `credentials:create`, `credentials:use`, and `credentials:write`. |
| Select a proxy or telemetry destination for an auth connection | `proxies:use` or `telemetry_destinations:use` on the selected resource, in addition to connection and login-resource permissions. Stored telemetry destinations are also checked when you start a login. |
| Fill from a vault | `vaults:use` and browser access, including the browser's attachments. |
| Create a vault item backed by an auth connection | `vaults:write` on the vault, `auth_connections:use` on the connection, and `credentials:use` on its saved credential. |
@@ -233,8 +245,8 @@ Connection updates check the resulting configuration. Turning off credential sav
| Operation | Requires |
| --- | --- |
-| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. The runtime key inherits your project-limited policy and expiry. Add permissions for the operations your app performs. |
-| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the deployment runtime key's policy, and your key must expire no earlier than that runtime key. |
+| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. The runtime key inherits your project-limited policy and expiry, excluding `api_keys:issue_beyond_expiry`. Add permissions for the operations your app performs. |
+| Invoke an app action | Container-wide `invocations:create`. The runtime key must be valid, unrevoked, and unexpired. Your policy must cover its policy, and your key must expire no earlier than it. |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
| Create or rotate an API key with a key that has a policy | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. If your key expires, the new or replacement key must expire no later than it unless you also hold `api_keys:issue_beyond_expiry` on the target and request a finite lifetime of up to 3650 days. You can't issue or rotate a key carrying that permission. |
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 118872fa..1f7e5ab8 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -160,7 +160,7 @@ policy = {
```
-Use connection `mconn_5k3m8q2r`, configured with profile `prof_7h2kq9x4m1` and credential `cred_4q8m2k6s`. Provider-backed connections additionally require `credential_providers:use` on the organization-owned provider.
+Use connection `mconn_5k3m8q2r`, configured with profile `prof_7h2kq9x4m1` and credential `cred_4q8m2k6s`. Provider-backed connections additionally require `credential_providers:use` on the organization-owned provider, so they need an organization-scoped key. If the connection must create a credential, grant container-wide `credentials:create`, `credentials:use`, and `credentials:write` instead of exact-ID credential grants.
@@ -194,7 +194,7 @@ policy = {
```
-Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. Add permissions for the browser, profile, vault, or other operations your app performs. An invocation's caller must cover the runtime key's full policy and expire no earlier than that runtime key.
+Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. Add permissions for the browser, profile, vault, or other operations your app performs. The runtime key inherits your project-limited policy and expiry, but never `api_keys:issue_beyond_expiry`. An invocation's caller must cover the runtime key's full policy and expire no earlier than that runtime key. The runtime key must still be valid, unrevoked, and unexpired.
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 5dc79ed9..fe1ea11e 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -105,7 +105,7 @@ A policy is a list of **statements**. Each statement allows one **action** on on
Some operations need more than one action. For example, creating a browser with a profile needs `browsers:create` and `browsers:use` on the project, plus `profiles:use` on that profile. See [API key permissions](/info/api-key-permissions) for every action and what each operation requires.
-Policies cover browsers, profiles, vaults, proxies, extensions, telemetry destinations, browser pools, apps, managed auth, credentials, organization/project administration, API keys, audit logs, search, and the configuration registry. Start with a [policy example](/info/api-key-policy-examples) for your workload.
+Policies cover browsers, profiles, vaults, proxies, extensions, telemetry destinations, browser pools, tasks and reports, apps, managed auth, credentials, organization/project administration, API keys, audit logs, search, and the configuration registry. Start with a [policy example](/info/api-key-policy-examples) for your workload.
### Create a scoped key
@@ -234,9 +234,9 @@ Grant this permission only to trusted issuers. Their child keys can remain valid
When you deploy an app, Kernel mints a **deployment-scoped API key** for that deployment and injects it into the deployment (and every invocation it runs) as the `KERNEL_API_KEY` environment variable. Because the SDKs read `KERNEL_API_KEY` from the environment by default, your app can call the Kernel API as itself without you managing a key.
-When you deploy with a scoped key, the deployment key inherits your policy narrowed to the deployment's project, plus your expiry. Deploying requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. Add permissions for the operations your app performs, such as creating browsers or using profiles.
+When you deploy with a scoped key, the deployment key inherits your policy narrowed to the deployment's project, plus your expiry. It never inherits `api_keys:issue_beyond_expiry`; that permission doesn't extend the runtime key's lifetime. Deploying requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. Add permissions for the operations your app performs, such as creating browsers or using profiles.
-To invoke that deployment with a scoped key, grant `invocations:create` and every permission held by the deployment key. The invoking key must expire no earlier than the deployment key. Scoped callers run deployments with scoped runtime keys; deployments created with unrestricted keys require an unrestricted caller.
+To invoke that deployment with a scoped key, grant `invocations:create` and every permission held by the deployment key. The invoking key must expire no earlier than the deployment key. The deployment key must still exist, be unrevoked and unexpired, and have a valid, supported policy. Scoped callers run deployments with scoped runtime keys; deployments created with unrestricted keys require an unrestricted caller.
Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support. See the [app policy example](/info/api-key-policy-examples) for a deployment and invocation policy.
@@ -245,10 +245,11 @@ Scoped deployment creation requires rollout enablement. If the API reports that
Key points about deployment keys:
- **One key per deployment.** Each deploy (including a redeploy of the same app) mints a fresh deployment key. `KERNEL_API_KEY` is a [reserved environment variable](/apps/deploy#reserved-environment-variables) — a value you supply at deploy time is overridden by the injected key. To use your own long-lived key, pass it under a non-reserved name.
+- **Host moves preserve bounds.** When KERNEL moves a deployment to another host, the replacement key keeps the source key's policy and expiry. A missing, revoked, expired, or invalid source credential prevents the move; it isn't replaced with an unrestricted key. This differs from deploying new code, which uses the new deployer's permissions.
- **Lifecycle tied to the deployment.** A deployment key is released when it's no longer needed. For scoped deployments, it also expires at the deployer's expiry. When you redeploy, the new deployment supersedes the old one, and the old deployment's key is released once it is no longer needed — that is, once the superseded deployment is stopped **and** no invocation is still running on it.
- **Superseded deployments drain in-flight invocations.** If an invocation is still running on a deployment that gets superseded, its key is retained until that invocation completes; its expiry still applies, and the key is released afterward. An idle redeploy (nothing in flight) releases the old key immediately. In the rare case where an invocation's workflow terminates without releasing the key, a background sweep releases it after a grace period (~95 minutes). You do not need to manage any of this — it is automatic.
-Revoking the deploying key doesn't revoke the deployment's key or stop its invocations. Stop the deployment and let in-flight invocations drain, or revoke the deployment key to stop further API requests.
+Revoking the deploying key doesn't revoke the deployment's key or stop its invocations. Runtime-key expiry limits API access; it doesn't terminate the app process or in-flight code. Stop the deployment and let in-flight invocations drain, or revoke the deployment key to stop further API requests.
If you need a credential whose lifetime you control (for CI, a persistent backend, or a resource that should outlive any single deployment), create an org- or project-scoped key as described above and pass it explicitly to the client. This only affects the calls your app makes — the platform still injects the deployment key and uses it to run the invocation and report its result, so you're choosing the credential for your own calls, not replacing the deployment key.
From 230b126530f15167a48fecec7297c90c98f5f13f Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 17 Nov 2026 18:19:41 +0000
Subject: [PATCH 10/22] Document explicit deployment runtime policies
---
apps/deploy.mdx | 4 ++-
info/api-key-permissions.mdx | 2 +-
info/api-key-policy-examples.mdx | 44 ++++++++++++++++++++++++++++++++
info/api-keys.mdx | 6 +++--
4 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index 7e438f2a..4018c7b1 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -53,7 +53,9 @@ To deploy with a [policy-scoped API key](/info/api-keys#scope-a-key-to-specific-
- `deployments:delete` to replace older deployments of the same app and version.
- `invocations:write` so the runtime can report invocation results and attach browsers.
-The deployment's injected runtime key inherits your project-limited policy and expiry, excluding `api_keys:issue_beyond_expiry`. That permission doesn't extend the runtime key's lifetime. Add the browser, profile, vault, or other permissions your app needs. To invoke it with a scoped key, also grant `invocations:create` and ensure the invoking key covers the runtime key's full policy and expiry. The runtime key must still be valid, unrevoked, and unexpired. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
+By default, the deployment's injected runtime key inherits your project-limited policy and expiry, excluding `api_keys:issue_beyond_expiry`. That permission doesn't extend the runtime key's lifetime. Add the browser, profile, vault, or other permissions your app needs. To invoke it with a scoped key, also grant `invocations:create` and ensure the invoking key covers the runtime key's full policy and expiry. The runtime key must still be valid, unrevoked, and unexpired. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
+
+To let another key invoke your app without deployment-management permissions, send an explicit `runtime_policy` JSON field in the `POST /deployments` multipart request. Include `invocations:write` on the project container and the permissions your app uses, but omit `deployments:create` and `deployments:delete`. Your deploying key must cover the requested permissions. The invoking key must cover this narrower runtime policy, plus `invocations:create`; expiry checks are unchanged. See [policy examples](/info/api-key-policy-examples).
Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support.
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 724944b3..5ba83ed5 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -245,7 +245,7 @@ Connection updates check the resulting configuration. Turning off credential sav
| Operation | Requires |
| --- | --- |
-| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. The runtime key inherits your project-limited policy and expiry, excluding `api_keys:issue_beyond_expiry`. Add permissions for the operations your app performs. |
+| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. The runtime key inherits your project-limited policy by default. Supply `runtime_policy` to select a narrower policy; it must include container-wide `invocations:write` and exclude `api_keys:issue_beyond_expiry`. The runtime key keeps your expiry. |
| Invoke an app action | Container-wide `invocations:create`. The runtime key must be valid, unrevoked, and unexpired. Your policy must cover its policy, and your key must expire no earlier than it. |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 1f7e5ab8..30366eca 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -197,6 +197,50 @@ policy = {
Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. Add permissions for the browser, profile, vault, or other operations your app performs. The runtime key inherits your project-limited policy and expiry, but never `api_keys:issue_beyond_expiry`. An invocation's caller must cover the runtime key's full policy and expire no earlier than that runtime key. The runtime key must still be valid, unrevoked, and unexpired.
+
+Use an explicit runtime policy so invoking the app doesn't require permission to create or delete deployments. This app creates browsers without saved profiles or other attached resources.
+
+
+```typescript TypeScript
+const runtimePolicy = {
+ statements: [
+ { action: 'invocations:write', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:create', resource: 'projects/proj_staging_9f3k/*' },
+ { action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
+ ],
+};
+
+const invokerPolicy = {
+ statements: [
+ { action: 'invocations:create', resource: 'projects/proj_staging_9f3k/*' },
+ ...runtimePolicy.statements,
+ ],
+};
+```
+
+```python Python
+runtime_policy = {
+ "statements": [
+ {"action": "invocations:write", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:create", "resource": "projects/proj_staging_9f3k/*"},
+ {"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
+ ],
+}
+
+invoker_policy = {
+ "statements": [
+ {"action": "invocations:create", "resource": "projects/proj_staging_9f3k/*"},
+ *runtime_policy["statements"],
+ ],
+}
+```
+
+
+Send the runtime policy as JSON in the `runtime_policy` multipart field of `POST /deployments`. The deploying key needs every runtime permission plus `deployments:create` and `deployments:delete` on the project. Issue a separate key with the invoker policy to start actions without deployment-management access.
+
+A key with only `invocations:create` still fails: it doesn't cover the runtime's browser and callback permissions. The invoker must expire no earlier than the runtime key. Omitting `runtime_policy` keeps default inheritance, including the deployer's deployment-management permissions. Add `invocations:read` and `deployments:read` if the invoker also needs invocation results and event streams.
+
+
Read staging API-key metadata, read organization audit logs, and look up browser configuration recommendations. Issue this as an organization-scoped key by omitting `project_id`.
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index fe1ea11e..82ff2085 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -234,9 +234,11 @@ Grant this permission only to trusted issuers. Their child keys can remain valid
When you deploy an app, Kernel mints a **deployment-scoped API key** for that deployment and injects it into the deployment (and every invocation it runs) as the `KERNEL_API_KEY` environment variable. Because the SDKs read `KERNEL_API_KEY` from the environment by default, your app can call the Kernel API as itself without you managing a key.
-When you deploy with a scoped key, the deployment key inherits your policy narrowed to the deployment's project, plus your expiry. It never inherits `api_keys:issue_beyond_expiry`; that permission doesn't extend the runtime key's lifetime. Deploying requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. Add permissions for the operations your app performs, such as creating browsers or using profiles.
+When you deploy with a scoped key and omit `runtime_policy`, the deployment key inherits your policy narrowed to the deployment's project, plus your expiry. It never inherits `api_keys:issue_beyond_expiry`; that permission doesn't extend the runtime key's lifetime. Deploying requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. Add permissions for the operations your app performs, such as creating browsers or using profiles.
-To invoke that deployment with a scoped key, grant `invocations:create` and every permission held by the deployment key. The invoking key must expire no earlier than the deployment key. The deployment key must still exist, be unrevoked and unexpired, and have a valid, supported policy. Scoped callers run deployments with scoped runtime keys; deployments created with unrestricted keys require an unrestricted caller.
+To choose a narrower runtime policy, send `runtime_policy` as a JSON multipart field when creating the deployment. It must stay within the deployment's project, name existing resources, include container-wide `invocations:write`, and exclude `api_keys:issue_beyond_expiry`. A scoped deploying key must cover every requested permission. Keys without a policy can also request a scoped runtime key. Explicit policies inherit the caller's expiry and require scoped deployment enablement. Omitting the field keeps the existing behavior.
+
+To invoke that deployment with a scoped key, grant `invocations:create` and every permission held by the deployment key. The invoking key must expire no earlier than the deployment key. The deployment key must still exist, be unrevoked and unexpired, and have a valid, supported policy. Scoped callers run deployments with scoped runtime keys; deployments created without a runtime policy by unrestricted keys require an unrestricted caller.
Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support. See the [app policy example](/info/api-key-policy-examples) for a deployment and invocation policy.
From a3deec140796855cedd725958a4c8d22114153b6 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Wed, 18 Nov 2026 15:43:41 +0000
Subject: [PATCH 11/22] Document minimal scoped runtime defaults
---
apps/deploy.mdx | 4 ++--
info/api-key-permissions.mdx | 2 +-
info/api-key-policy-examples.mdx | 8 +++++---
info/api-keys.mdx | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index 4018c7b1..67501be2 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -53,9 +53,9 @@ To deploy with a [policy-scoped API key](/info/api-keys#scope-a-key-to-specific-
- `deployments:delete` to replace older deployments of the same app and version.
- `invocations:write` so the runtime can report invocation results and attach browsers.
-By default, the deployment's injected runtime key inherits your project-limited policy and expiry, excluding `api_keys:issue_beyond_expiry`. That permission doesn't extend the runtime key's lifetime. Add the browser, profile, vault, or other permissions your app needs. To invoke it with a scoped key, also grant `invocations:create` and ensure the invoking key covers the runtime key's full policy and expiry. The runtime key must still be valid, unrevoked, and unexpired. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
+By default, the deployment's injected runtime key gets only project-wide `invocations:write` so the runtime can report results. It inherits your expiry, but not your browser, profile, vault, or deployment-management permissions. This minimum permission applies to the whole project, not just this deployment's invocations. To invoke the app with a scoped key, grant `invocations:create` and cover the runtime key's policy and expiry. The runtime key must still be valid, unrevoked, and unexpired. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
-To let another key invoke your app without deployment-management permissions, send an explicit `runtime_policy` JSON field in the `POST /deployments` multipart request. Include `invocations:write` on the project container and the permissions your app uses, but omit `deployments:create` and `deployments:delete`. Your deploying key must cover the requested permissions. The invoking key must cover this narrower runtime policy, plus `invocations:create`; expiry checks are unchanged. See [policy examples](/info/api-key-policy-examples).
+To give your app additional permissions, send an explicit `runtime_policy` JSON field in the `POST /deployments` multipart request. Include project-wide `invocations:write` and the permissions your app uses. A supplied policy missing that minimum is rejected; permissions aren't silently added. Your deploying key must cover the requested permissions, and `api_keys:issue_beyond_expiry` isn't allowed. The invoking key must cover this runtime policy, plus `invocations:create`; expiry checks are unchanged. See [policy examples](/info/api-key-policy-examples).
Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support.
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 5ba83ed5..847c7273 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -245,7 +245,7 @@ Connection updates check the resulting configuration. Turning off credential sav
| Operation | Requires |
| --- | --- |
-| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. The runtime key inherits your project-limited policy by default. Supply `runtime_policy` to select a narrower policy; it must include container-wide `invocations:write` and exclude `api_keys:issue_beyond_expiry`. The runtime key keeps your expiry. |
+| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. By default, the runtime key gets only project-wide `invocations:write`. Supply `runtime_policy` for additional permissions; it must explicitly include that minimum and exclude `api_keys:issue_beyond_expiry`. The runtime key keeps your expiry. |
| Invoke an app action | Container-wide `invocations:create`. The runtime key must be valid, unrevoked, and unexpired. Your policy must cover its policy, and your key must expire no earlier than it. |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 30366eca..136f186c 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -194,11 +194,11 @@ policy = {
```
-Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. Add permissions for the browser, profile, vault, or other operations your app performs. The runtime key inherits your project-limited policy and expiry, but never `api_keys:issue_beyond_expiry`. An invocation's caller must cover the runtime key's full policy and expire no earlier than that runtime key. The runtime key must still be valid, unrevoked, and unexpired.
+Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. With `runtime_policy` omitted, the runtime key gets only project-wide `invocations:write` and your expiry, not the rest of the deploying key's permissions. For browser, profile, vault, or other operations, grant the deploying key those permissions and include them in an explicit runtime policy as shown below. An invocation's caller must cover the runtime key's full policy and expire no earlier than that runtime key. The runtime key must still be valid, unrevoked, and unexpired.
-Use an explicit runtime policy so invoking the app doesn't require permission to create or delete deployments. This app creates browsers without saved profiles or other attached resources.
+Omitting `runtime_policy` gives the app only project-wide `invocations:write`. Use an explicit runtime policy to add browser access without deployment-management permissions. This app creates browsers without saved profiles or other attached resources.
```typescript TypeScript
@@ -238,7 +238,9 @@ invoker_policy = {
Send the runtime policy as JSON in the `runtime_policy` multipart field of `POST /deployments`. The deploying key needs every runtime permission plus `deployments:create` and `deployments:delete` on the project. Issue a separate key with the invoker policy to start actions without deployment-management access.
-A key with only `invocations:create` still fails: it doesn't cover the runtime's browser and callback permissions. The invoker must expire no earlier than the runtime key. Omitting `runtime_policy` keeps default inheritance, including the deployer's deployment-management permissions. Add `invocations:read` and `deployments:read` if the invoker also needs invocation results and event streams.
+A supplied runtime policy with only `browsers:create` and `browsers:use` is rejected with `400`: it must explicitly include project-wide `invocations:write`. Permissions aren't silently added.
+
+A key with only `invocations:create` still fails to invoke this app: it doesn't cover the runtime's browser and callback permissions. The invoker must expire no earlier than the runtime key. If you omit `runtime_policy`, the app gets only project-wide `invocations:write`, and an invoking key needs that permission plus `invocations:create`. Add `invocations:read` and `deployments:read` if the invoker also needs invocation results and event streams.
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 82ff2085..931e4768 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -234,9 +234,9 @@ Grant this permission only to trusted issuers. Their child keys can remain valid
When you deploy an app, Kernel mints a **deployment-scoped API key** for that deployment and injects it into the deployment (and every invocation it runs) as the `KERNEL_API_KEY` environment variable. Because the SDKs read `KERNEL_API_KEY` from the environment by default, your app can call the Kernel API as itself without you managing a key.
-When you deploy with a scoped key and omit `runtime_policy`, the deployment key inherits your policy narrowed to the deployment's project, plus your expiry. It never inherits `api_keys:issue_beyond_expiry`; that permission doesn't extend the runtime key's lifetime. Deploying requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. Add permissions for the operations your app performs, such as creating browsers or using profiles.
+When you deploy with a scoped key and omit `runtime_policy`, the deployment key gets only project-wide `invocations:write`, plus your expiry. It can report invocation results, but can't create browsers, use saved profiles or vaults, or manage deployments. This permission applies to all invocations in the project, not just the deployment's own invocations. Your deploying key still needs container-wide `deployments:create`, `deployments:delete`, and `invocations:write`.
-To choose a narrower runtime policy, send `runtime_policy` as a JSON multipart field when creating the deployment. It must stay within the deployment's project, name existing resources, include container-wide `invocations:write`, and exclude `api_keys:issue_beyond_expiry`. A scoped deploying key must cover every requested permission. Keys without a policy can also request a scoped runtime key. Explicit policies inherit the caller's expiry and require scoped deployment enablement. Omitting the field keeps the existing behavior.
+To give your app additional permissions, send `runtime_policy` as a JSON multipart field when creating the deployment. It must stay within the deployment's project, name existing resources, explicitly include container-wide `invocations:write`, and exclude `api_keys:issue_beyond_expiry`. A supplied policy missing the callback permission is rejected, not supplemented automatically. A scoped deploying key must cover every requested permission. Keys without a policy can also request a scoped runtime key. Explicit policies inherit the caller's expiry and require scoped deployment enablement. Omitting the field for an unscoped deploying key keeps its existing unrestricted runtime-key behavior. Existing deployments keep their stored policies.
To invoke that deployment with a scoped key, grant `invocations:create` and every permission held by the deployment key. The invoking key must expire no earlier than the deployment key. The deployment key must still exist, be unrevoked and unexpired, and have a valid, supported policy. Scoped callers run deployments with scoped runtime keys; deployments created without a runtime policy by unrestricted keys require an unrestricted caller.
From b7e82b58deb1a623b3fc55862c5b0f80e7cad8cb Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Thu, 19 Nov 2026 15:26:22 +0000
Subject: [PATCH 12/22] Explain deployment policies and per-invocation key
expiry
---
apps/deploy.mdx | 6 +++---
info/api-key-permissions.mdx | 4 ++--
info/api-key-policy-examples.mdx | 4 ++--
info/api-keys.mdx | 21 +++++----------------
4 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index 67501be2..87309cb5 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -53,9 +53,9 @@ To deploy with a [policy-scoped API key](/info/api-keys#scope-a-key-to-specific-
- `deployments:delete` to replace older deployments of the same app and version.
- `invocations:write` so the runtime can report invocation results and attach browsers.
-By default, the deployment's injected runtime key gets only project-wide `invocations:write` so the runtime can report results. It inherits your expiry, but not your browser, profile, vault, or deployment-management permissions. This minimum permission applies to the whole project, not just this deployment's invocations. To invoke the app with a scoped key, grant `invocations:create` and cover the runtime key's policy and expiry. The runtime key must still be valid, unrevoked, and unexpired. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
+By default, each invocation's key gets only project-wide `invocations:write` so the runtime can report results. Each run gets a fresh key valid for 65 minutes. The deployment's policy doesn't expire with your deploying key. This minimum permission applies to the whole project, not just this deployment's invocations. To invoke the app with a scoped key, grant `invocations:create` and cover the runtime policy. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
-To give your app additional permissions, send an explicit `runtime_policy` JSON field in the `POST /deployments` multipart request. Include project-wide `invocations:write` and the permissions your app uses. A supplied policy missing that minimum is rejected; permissions aren't silently added. Your deploying key must cover the requested permissions, and `api_keys:issue_beyond_expiry` isn't allowed. The invoking key must cover this runtime policy, plus `invocations:create`; expiry checks are unchanged. See [policy examples](/info/api-key-policy-examples).
+To give your app additional permissions, send an explicit `runtime_policy` JSON field in the `POST /deployments` multipart request. Include project-wide `invocations:write` and the permissions your app uses. A supplied policy missing that minimum is rejected; permissions aren't silently added. Your deploying key must cover the requested permissions, and `api_keys:issue_beyond_expiry` isn't allowed. The invoking key must cover this runtime policy, plus `invocations:create`. See [policy examples](/info/api-key-policy-examples).
Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support.
@@ -87,7 +87,7 @@ kernel deploy my_app.py --env-file .env
Kernel injects a few environment variables into every deployment and its invocations. These names are **reserved** — if you set them via `--env` or `--env-file`, Kernel overrides your value, so setting them has no effect:
-- `KERNEL_API_KEY` — a per-deployment API key Kernel mints at deploy time (see [Deployment API keys](/info/api-keys#deployment-api-keys)). The SDKs read it from the environment by default, so your app authenticates with this key automatically.
+- `KERNEL_API_KEY` — the runtime key Kernel supplies to your app (see [Deployment API keys](/info/api-keys#deployment-api-keys)). The SDKs read it from the environment by default, so your app authenticates with this key automatically.
- `ENTRYPOINT_RELPATH` — set by the platform to locate your entrypoint.
#### Using a different key for your app's calls
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 847c7273..d64a13ea 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -245,8 +245,8 @@ Connection updates check the resulting configuration. Turning off credential sav
| Operation | Requires |
| --- | --- |
-| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. By default, the runtime key gets only project-wide `invocations:write`. Supply `runtime_policy` for additional permissions; it must explicitly include that minimum and exclude `api_keys:issue_beyond_expiry`. The runtime key keeps your expiry. |
-| Invoke an app action | Container-wide `invocations:create`. The runtime key must be valid, unrevoked, and unexpired. Your policy must cover its policy, and your key must expire no earlier than it. |
+| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. By default, the runtime key gets only project-wide `invocations:write`. Supply `runtime_policy` for additional permissions; it must explicitly include that minimum and exclude `api_keys:issue_beyond_expiry`. Each invocation gets a fresh 65-minute key; the deployment policy doesn't expire with your credential. |
+| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the runtime policy. Existing shared runtime keys must also be live and expire no later than yours. |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
| Create or rotate an API key with a key that has a policy | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. If your key expires, the new or replacement key must expire no later than it unless you also hold `api_keys:issue_beyond_expiry` on the target and request a finite lifetime of up to 3650 days. You can't issue or rotate a key carrying that permission. |
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 136f186c..4d34e527 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -194,7 +194,7 @@ policy = {
```
-Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. With `runtime_policy` omitted, the runtime key gets only project-wide `invocations:write` and your expiry, not the rest of the deploying key's permissions. For browser, profile, vault, or other operations, grant the deploying key those permissions and include them in an explicit runtime policy as shown below. An invocation's caller must cover the runtime key's full policy and expire no earlier than that runtime key. The runtime key must still be valid, unrevoked, and unexpired.
+Use a key with this policy to deploy and invoke the app. Deployment creation requires rollout enablement. With `runtime_policy` omitted, the runtime key gets only project-wide `invocations:write`, not the rest of the deploying key's permissions. For browser, profile, vault, or other operations, grant the deploying key those permissions and include them in an explicit runtime policy as shown below. An invocation's caller must cover the runtime key's full policy. Each invocation gets a new key valid for 65 minutes, independent of the deploying key's expiry.
@@ -240,7 +240,7 @@ Send the runtime policy as JSON in the `runtime_policy` multipart field of `POST
A supplied runtime policy with only `browsers:create` and `browsers:use` is rejected with `400`: it must explicitly include project-wide `invocations:write`. Permissions aren't silently added.
-A key with only `invocations:create` still fails to invoke this app: it doesn't cover the runtime's browser and callback permissions. The invoker must expire no earlier than the runtime key. If you omit `runtime_policy`, the app gets only project-wide `invocations:write`, and an invoking key needs that permission plus `invocations:create`. Add `invocations:read` and `deployments:read` if the invoker also needs invocation results and event streams.
+A key with only `invocations:create` still fails to invoke this app: it doesn't cover the runtime's browser and callback permissions. If you omit `runtime_policy`, the app gets only project-wide `invocations:write`, and an invoking key needs that permission plus `invocations:create`. Add `invocations:read` and `deployments:read` if the invoker also needs invocation results and event streams.
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 931e4768..ff85120c 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -232,28 +232,17 @@ Grant this permission only to trusted issuers. Their child keys can remain valid
## Deployment API keys
-When you deploy an app, Kernel mints a **deployment-scoped API key** for that deployment and injects it into the deployment (and every invocation it runs) as the `KERNEL_API_KEY` environment variable. Because the SDKs read `KERNEL_API_KEY` from the environment by default, your app can call the Kernel API as itself without you managing a key.
+Kernel injects `KERNEL_API_KEY` into each invocation. The SDK reads it automatically. For new deployments with a runtime policy, Kernel stores the policy on the deployment and issues a fresh project-scoped key when each invocation starts. Each key expires 65 minutes after issuance, even if the run finishes earlier. The policy doesn't expire with the deploying key, so you don't need to redeploy when that key expires or is revoked.
-When you deploy with a scoped key and omit `runtime_policy`, the deployment key gets only project-wide `invocations:write`, plus your expiry. It can report invocation results, but can't create browsers, use saved profiles or vaults, or manage deployments. This permission applies to all invocations in the project, not just the deployment's own invocations. Your deploying key still needs container-wide `deployments:create`, `deployments:delete`, and `invocations:write`.
+Deploying with a scoped key requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. If you omit `runtime_policy`, the runtime gets only project-wide `invocations:write` for reporting results. This permission applies to all invocations in the project, not just that deployment’s runs. To grant more, send the policy as a JSON multipart field on `POST /deployments`. It must explicitly include the callback permission, stay within the deployer’s project and permissions, name existing resources, and exclude `api_keys:issue_beyond_expiry`. A scoped invoker needs `invocations:create` and every permission in the runtime policy.
-To give your app additional permissions, send `runtime_policy` as a JSON multipart field when creating the deployment. It must stay within the deployment's project, name existing resources, explicitly include container-wide `invocations:write`, and exclude `api_keys:issue_beyond_expiry`. A supplied policy missing the callback permission is rejected, not supplemented automatically. A scoped deploying key must cover every requested permission. Keys without a policy can also request a scoped runtime key. Explicit policies inherit the caller's expiry and require scoped deployment enablement. Omitting the field for an unscoped deploying key keeps its existing unrestricted runtime-key behavior. Existing deployments keep their stored policies.
-
-To invoke that deployment with a scoped key, grant `invocations:create` and every permission held by the deployment key. The invoking key must expire no earlier than the deployment key. The deployment key must still exist, be unrevoked and unexpired, and have a valid, supported policy. Scoped callers run deployments with scoped runtime keys; deployments created without a runtime policy by unrestricted keys require an unrestricted caller.
+Moving a deployment to another host preserves the policy. Stopping it prevents new runs; it doesn't revoke keys already issued. `KERNEL_API_KEY` is a [reserved environment variable](/apps/deploy#reserved-environment-variables). To supply a credential for your own API calls, pass it under another name.
-Scoped deployment creation requires rollout enablement. If the API reports that scoped deployments aren't enabled, contact support. See the [app policy example](/info/api-key-policy-examples) for a deployment and invocation policy.
+Scoped deployment creation requires rollout enablement. See the [app policy example](/info/api-key-policy-examples) for deployment and invocation policies.
-Key points about deployment keys:
-
-- **One key per deployment.** Each deploy (including a redeploy of the same app) mints a fresh deployment key. `KERNEL_API_KEY` is a [reserved environment variable](/apps/deploy#reserved-environment-variables) — a value you supply at deploy time is overridden by the injected key. To use your own long-lived key, pass it under a non-reserved name.
-- **Host moves preserve bounds.** When KERNEL moves a deployment to another host, the replacement key keeps the source key's policy and expiry. A missing, revoked, expired, or invalid source credential prevents the move; it isn't replaced with an unrestricted key. This differs from deploying new code, which uses the new deployer's permissions.
-- **Lifecycle tied to the deployment.** A deployment key is released when it's no longer needed. For scoped deployments, it also expires at the deployer's expiry. When you redeploy, the new deployment supersedes the old one, and the old deployment's key is released once it is no longer needed — that is, once the superseded deployment is stopped **and** no invocation is still running on it.
-- **Superseded deployments drain in-flight invocations.** If an invocation is still running on a deployment that gets superseded, its key is retained until that invocation completes; its expiry still applies, and the key is released afterward. An idle redeploy (nothing in flight) releases the old key immediately. In the rare case where an invocation's workflow terminates without releasing the key, a background sweep releases it after a grace period (~95 minutes). You do not need to manage any of this — it is automatic.
-
-Revoking the deploying key doesn't revoke the deployment's key or stop its invocations. Runtime-key expiry limits API access; it doesn't terminate the app process or in-flight code. Stop the deployment and let in-flight invocations drain, or revoke the deployment key to stop further API requests.
-
-If you need a credential whose lifetime you control (for CI, a persistent backend, or a resource that should outlive any single deployment), create an org- or project-scoped key as described above and pass it explicitly to the client. This only affects the calls your app makes — the platform still injects the deployment key and uses it to run the invocation and report its result, so you're choosing the credential for your own calls, not replacing the deployment key.
+**Existing deployments and unscoped defaults:** Existing shared keys aren't migrated. Deploying with an unrestricted credential and omitting `runtime_policy` still creates one shared runtime key; supplying the field opts into per-invocation keys. Scoped callers cannot invoke an unrestricted runtime. For an existing shared key with a policy, the key must be live, its permissions covered, and its expiry no later than the invoker's. Host moves preserve these bounds, and superseded deployments keep their shared key until in-flight runs drain.
## List and inspect API keys
From 6f50d86c25c9c138257471cb5e0cbfc05994840e Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Mon, 23 Nov 2026 22:02:58 +0000
Subject: [PATCH 13/22] Keep internal search permissions out of public docs
---
info/api-key-permissions.mdx | 10 +++-------
info/api-key-policy-examples.mdx | 34 --------------------------------
info/api-keys.mdx | 2 +-
3 files changed, 4 insertions(+), 42 deletions(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index beff9f7a..1cc847ab 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -40,7 +40,7 @@ Choose `kind` from the following resource types:
Kernel checks that each object ID exists within the credential's boundary when you create or update a key or rule. Existing project-owned resources without a project are treated as belonging to the default project.
-Creation actions need a container selector ending in `/*`, rather than an existing object's ID. Project creation and creation of organization-owned resources need `organizations/{org_id}/*`. Audit log access also uses an organization container. Search and configuration registry actions use a project or organization container rather than individual search or analysis IDs.
+Creation actions need a container selector ending in `/*`, rather than an existing object's ID. Project creation and creation of organization-owned resources need `organizations/{org_id}/*`. Audit log access also uses an organization container. Configuration registry actions use a project or organization container rather than individual analysis IDs.
A policy narrows your key's access; it doesn't change its organization or project boundary. Use an organization-scoped key for organization administration, credential providers, wallet provider configurations, audit logs, and telemetry destination management. A project-scoped key can rename its own project, but project creation, deletion, status changes, and limit changes require an organization-scoped credential.
@@ -236,13 +236,10 @@ Native OAuth tokens can’t manage API keys. This applies to human sign-ins (inc
| `audit_log_export_destinations:write` | Reconfigure, pause, or activate destinations. Also requires `audit_logs:read`. |
| `audit_log_export_destinations:delete` | Delete destinations. |
-### Search and configuration registry
+### Configuration registry
| Action | Allows |
| --- | --- |
-| `searches:create` | Run web searches. |
-| `searches:read` | Read stored search results and configured search providers. |
-| `searches:use` | Retrieve page content for search results. |
| `config_registry:read` | Look up recommended browser configurations and read analyses. |
| `config_registry:create` | Start or resolve configuration analyses. Also requires `config_registry:read`. |
| `config_registry:write` | Cancel configuration analyses. |
@@ -287,12 +284,11 @@ Connection updates check the resulting configuration. Turning off credential sav
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
| Create or rotate an API key with a key that has a policy | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. If your key expires, the new or replacement key must expire no later than it unless you also hold `api_keys:issue_beyond_expiry` on the target and request a finite lifetime of up to 3650 days. You can't issue or rotate a key carrying that permission. |
| Update an audit export destination | `audit_log_export_destinations:write` and organization-wide `audit_logs:read`. |
-| Retrieve search content with an automatically created browser | `searches:use` plus container-wide `browsers:create`, `browsers:use`, and `browsers:delete`. With an existing browser, grant access to that browser and its attachments instead. |
| Resolve a browser configuration | `config_registry:create` and `config_registry:read`. |
## Lists and authentication
-Resource lists, such as browsers, profiles, pools, and API keys, filter permissions before pagination. A key with no grant for those resources receives an empty list. Service-wide listings, such as search providers, require the service's read action.
+Resource lists, such as browsers, profiles, pools, and API keys, filter permissions before pagination. A key with no grant for those resources receives an empty list.
`GET /auth/context` describes the calling credential and needs no additional policy action; the key must still be valid and unexpired.
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 0d5cf095..d0419902 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -270,38 +270,4 @@ policy = {
API-key reads return metadata and policies. Creating delegated keys requires `api_keys:create` on their container plus the permissions you intend to delegate; rotating keys requires `api_keys:rotate` and coverage of their policy.
-
-
-Run searches in staging, inspect their results, and retrieve page content with automatically created browsers.
-
-
-```typescript TypeScript
-const policy = {
- statements: [
- { action: 'searches:create', resource: 'projects/proj_staging_9f3k/*' },
- { action: 'searches:read', resource: 'projects/proj_staging_9f3k/*' },
- { action: 'searches:use', resource: 'projects/proj_staging_9f3k/*' },
- { action: 'browsers:create', resource: 'projects/proj_staging_9f3k/*' },
- { action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
- { action: 'browsers:delete', resource: 'projects/proj_staging_9f3k/*' },
- ],
-};
-```
-
-```python Python
-policy = {
- "statements": [
- {"action": "searches:create", "resource": "projects/proj_staging_9f3k/*"},
- {"action": "searches:read", "resource": "projects/proj_staging_9f3k/*"},
- {"action": "searches:use", "resource": "projects/proj_staging_9f3k/*"},
- {"action": "browsers:create", "resource": "projects/proj_staging_9f3k/*"},
- {"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
- {"action": "browsers:delete", "resource": "projects/proj_staging_9f3k/*"},
- ],
-}
-```
-
-
-The browser grants allow retrieval to create, control, and clean up its browser. To retrieve with an existing browser instead, grant access to that browser and its attached resources.
-
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 18c07b2e..17b922ec 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -111,7 +111,7 @@ A statement can also carry a **condition** that narrows it to matching requests.
Some operations need more than one action. For example, creating a browser with a profile needs `browsers:create` and `browsers:use` on the project, plus `profiles:use` on that profile. See [API key permissions](/info/api-key-permissions) for every action and what each operation requires.
-Policies cover browsers, profiles, vaults, proxies, extensions, telemetry destinations, browser pools, tasks and reports, apps, managed auth, credentials, organization/project administration, API keys, audit logs, search, and the configuration registry. Start with a [policy example](/info/api-key-policy-examples) for your workload.
+Policies cover browsers, profiles, vaults, proxies, extensions, telemetry destinations, browser pools, tasks and reports, apps, managed auth, credentials, organization/project administration, API keys, audit logs, and the configuration registry. Start with a [policy example](/info/api-key-policy-examples) for your workload.
### Create a scoped key
From 734927d714d7a8734447545b451b4ab107eef997 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 24 Nov 2026 14:26:38 +0000
Subject: [PATCH 14/22] Document scoped deployments without rollout
prerequisites
---
apps/deploy.mdx | 4 ----
info/api-key-permissions.mdx | 2 +-
info/api-key-policy-examples.mdx | 2 +-
info/api-keys.mdx | 4 +---
4 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index 8203ac9e..abc9a26e 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -47,10 +47,6 @@ kernel deploy github \
## Use a scoped API key
-
-Scoped deployments aren’t generally available yet. Until they’re enabled, the API returns `403` if you deploy with a scoped key or supply `runtime_policy`, even with an unrestricted key. Existing deployments are unchanged.
-
-
To deploy with a [policy-scoped API key](/info/api-keys#scope-a-key-to-specific-resources), grant these actions on the deployment's project or organization container:
- `deployments:create` to deploy the app.
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 1cc847ab..fb4ec18c 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -174,7 +174,7 @@ Reports use their parent task's permissions; they don't have separate policy sel
Apps are authorized through their deployments. An invocation belongs to its deployment's project. See [Deployment API keys](/info/api-keys#deployment-api-keys) for runtime permissions and expiry.
-Deploying with a scoped credential or supplying `runtime_policy` requires scoped deployments to be enabled. Otherwise, `POST /deployments` returns `403`. Machine OAuth clients and [service accounts](/info/workload-identity/service-accounts#what-a-service-account-cant-do) can’t deploy or invoke apps, even with these actions.
+Machine OAuth clients and [service accounts](/info/workload-identity/service-accounts#what-a-service-account-cant-do) can’t deploy or invoke apps, even with these actions.
### Credentials and auth connections
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index d0419902..13ffc9b7 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -194,7 +194,7 @@ policy = {
```
-Use a key with this policy to deploy and invoke the app. This example requires scoped deployments to be enabled; until then the deploy request returns `403`. With `runtime_policy` omitted, the runtime key gets only project-wide `invocations:write`, not the rest of the deploying key's permissions. For browser, profile, vault, or other operations, grant the deploying key those permissions and include them in an explicit runtime policy as shown below. An invocation's caller must cover the runtime key's full policy. Each invocation gets a new key valid for 65 minutes, independent of the deploying key's expiry.
+Use a key with this policy to deploy and invoke the app. With `runtime_policy` omitted, the runtime key gets only project-wide `invocations:write`, not the rest of the deploying key's permissions. For browser, profile, vault, or other operations, grant the deploying key those permissions and include them in an explicit runtime policy as shown below. An invocation's caller must cover the runtime key's full policy. Each invocation gets a new key valid for 65 minutes, independent of the deploying key's expiry.
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 17b922ec..5a9798d5 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -318,9 +318,7 @@ Deploying with a scoped key requires container-wide `deployments:create`, `deplo
Moving a deployment to another host preserves the policy. Stopping it prevents new runs; it doesn't revoke keys already issued. `KERNEL_API_KEY` is a [reserved environment variable](/apps/deploy#reserved-environment-variables). To supply a credential for your own API calls, pass it under another name.
-
-Until scoped deployments are enabled, creating a deployment with a scoped credential or sending `runtime_policy` with any credential returns `403`. Deploying with an unrestricted credential and no `runtime_policy` is unchanged. See the [app policy example](/info/api-key-policy-examples).
-
+See the [app policy example](/info/api-key-policy-examples) for separate deployer, runtime, and invoker permissions.
**Existing deployments and unscoped defaults:** Existing shared keys aren't migrated. Deploying with an unrestricted credential and omitting `runtime_policy` still creates one shared runtime key; supplying the field opts into per-invocation keys. Scoped callers cannot invoke an unrestricted runtime. For an existing shared key with a policy, the key must be live, its permissions covered, and its expiry no later than the invoker's. Host moves preserve these bounds, and superseded deployments keep their shared key until in-flight runs drain.
From b20b9a3317cd99afa29c155da3b584cf68d92beb Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 24 Nov 2026 15:48:08 +0000
Subject: [PATCH 15/22] =?UTF-8?q?Explain=20runtime=20permissions=20from=20?=
=?UTF-8?q?the=20app=E2=80=99s=20perspective?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/deploy.mdx | 12 ++----------
browsers/telemetry/export.mdx | 2 +-
info/api-key-permissions.mdx | 4 ++--
info/api-key-policy-examples.mdx | 2 +-
info/api-keys.mdx | 12 ++++++++----
info/authentication.mdx | 2 +-
6 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index abc9a26e..da0aae27 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -47,15 +47,7 @@ kernel deploy github \
## Use a scoped API key
-To deploy with a [policy-scoped API key](/info/api-keys#scope-a-key-to-specific-resources), grant these actions on the deployment's project or organization container:
-
-- `deployments:create` to deploy the app.
-- `deployments:delete` to replace older deployments of the same app and version.
-- `invocations:write` so the runtime can report invocation results and attach browsers.
-
-By default, each invocation's key gets only project-wide `invocations:write` so the runtime can report results. Each run gets a fresh key valid for 65 minutes. The deployment's policy doesn't expire with your deploying key. This minimum permission applies to the whole project, not just this deployment's invocations. To invoke the app with a scoped key, grant `invocations:create` and cover the runtime policy. See the [app policy example](/info/api-key-policy-examples) and [deployment key lifecycle](/info/api-keys#deployment-api-keys).
-
-To give your app additional permissions, send an explicit `runtime_policy` JSON field in the `POST /deployments` multipart request. Include an unconditional `invocations:write` grant on `projects/{project_id}/*` for callbacks, plus the permissions your app uses. A supplied policy missing that minimum is rejected; permissions aren't silently added. Your deploying key must cover the requested permissions, and `api_keys:issue_beyond_expiry` isn't allowed.
+When you deploy with a scoped API key, your [app runtime policy](/info/api-keys#app-runtime-policy) controls what that version can do. By default, it grants only project-wide `invocations:write` so your app can report results. Set `runtime_policy` when you deploy if your app needs more access, such as creating browsers.
## Environment variables
@@ -83,7 +75,7 @@ kernel deploy my_app.py --env-file .env
Kernel injects a few environment variables into every deployment and its invocations. These names are **reserved** — if you set them via `--env` or `--env-file`, Kernel overrides your value, so setting them has no effect:
-- `KERNEL_API_KEY` — the runtime key Kernel supplies to your app (see [Deployment API keys](/info/api-keys#deployment-api-keys)). The SDKs read it from the environment by default, so your app authenticates with this key automatically.
+- `KERNEL_API_KEY` — the SDK uses this key automatically. For apps with a runtime policy, the key grants only the [app runtime permissions](/info/api-keys#app-runtime-policy).
- `ENTRYPOINT_RELPATH` — set by the platform to locate your entrypoint.
#### Using a different key for your app's calls
diff --git a/browsers/telemetry/export.mdx b/browsers/telemetry/export.mdx
index 8c309b67..a3cad6f0 100644
--- a/browsers/telemetry/export.mdx
+++ b/browsers/telemetry/export.mdx
@@ -12,7 +12,7 @@ Events are exported as OTLP **logs**. Kernel appends `/v1/logs` to your endpoint
## How export works
-You create a **destination** - an OTLP/HTTP endpoint plus the headers your backend expects - and select it when you create a browser. Unrestricted keys can select destinations across the organization. With a policy-scoped key, create and select the destination in the project where the browser runs.
+You create a **destination** - an OTLP/HTTP endpoint plus the headers your backend expects - and select it when you create a browser. With a policy-scoped key, create and select the destination in the project where the browser runs.
Kernel's relay forwards the session's events to the destination and attaches your headers at export time. Headers are encrypted at rest and never reach the browser VM, so a session can export to your backend without ever holding your ingestion key.
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index fb4ec18c..5fe42712 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -171,7 +171,7 @@ Reports use their parent task's permissions; they don't have separate policy sel
| `invocations:read` | List invocations and read payloads, outputs, events, and logs. |
| `invocations:write` | Update invocation status and output, and attach new browsers to invocations. |
-Apps are authorized through their deployments. An invocation belongs to its deployment's project. See [Deployment API keys](/info/api-keys#deployment-api-keys) for runtime permissions and expiry.
+Apps are authorized through their deployments. An invocation belongs to its deployment's project. See [app runtime policy](/info/api-keys#app-runtime-policy) for the permissions your app uses when it runs.
Machine OAuth clients and [service accounts](/info/workload-identity/service-accounts#what-a-service-account-cant-do) can’t deploy or invoke apps, even with these actions.
@@ -278,7 +278,7 @@ Connection updates check the resulting configuration. Turning off credential sav
| Operation | Requires |
| --- | --- |
-| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. By default, the runtime key gets only project-wide `invocations:write`. Supply `runtime_policy` for additional permissions; it must explicitly include that minimum and exclude `api_keys:issue_beyond_expiry`. Each invocation gets a fresh 65-minute key; the deployment policy doesn't expire with your credential. |
+| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`, plus any additional permissions in the [app runtime policy](/info/api-keys#app-runtime-policy). |
| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the runtime policy. Existing shared runtime keys must also be live and expire no later than yours. |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 13ffc9b7..83b76fb6 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -194,7 +194,7 @@ policy = {
```
-Use a key with this policy to deploy and invoke the app. With `runtime_policy` omitted, the runtime key gets only project-wide `invocations:write`, not the rest of the deploying key's permissions. For browser, profile, vault, or other operations, grant the deploying key those permissions and include them in an explicit runtime policy as shown below. An invocation's caller must cover the runtime key's full policy. Each invocation gets a new key valid for 65 minutes, independent of the deploying key's expiry.
+Use this key to deploy and invoke the app. If you omit `runtime_policy`, the [app runtime policy](/info/api-keys#app-runtime-policy) grants only project-wide `invocations:write`, not the rest of the deploying key’s permissions. The next example adds browser access.
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 5a9798d5..992f32af 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -310,13 +310,17 @@ Attaching a policy to a key that doesn't have one makes the key scoped: every ac
A key used through a hosted MCP server is evaluated against the MCP server's egress address, so an IP-restricted key is denied everywhere until MCP support ships. If you route keys through a hosted MCP server, leave `source_ip` conditions off those keys for now.
-## Deployment API keys
+## App runtime policy
-Kernel injects `KERNEL_API_KEY` into each invocation. The SDK reads it automatically. For new deployments with a runtime policy, Kernel stores the policy on the deployment and issues a fresh project-scoped key when each invocation starts. Each key expires 65 minutes after issuance, even if the run finishes earlier. The policy doesn't expire with the deploying key, so you don't need to redeploy when that key expires or is revoked.
+An app’s runtime policy controls which Kernel API calls that version can make. Set it when you deploy. Your app keeps those permissions if the key you used to deploy expires or is revoked; you don’t need to redeploy or store a key for the app.
-Deploying with a scoped key requires container-wide `deployments:create`, `deployments:delete`, and `invocations:write`. If you omit `runtime_policy`, the runtime gets only project-wide `invocations:write` for reporting results. This permission applies to all invocations in the project, not just that deployment’s runs. To grant more, send the policy as a JSON multipart field on `POST /deployments`. It must explicitly include the callback permission, stay within the deployer’s project and permissions, name existing resources, and exclude `api_keys:issue_beyond_expiry`. A scoped invoker needs `invocations:create` and every permission in the runtime policy.
+**Default:** When you deploy with a scoped key and omit `runtime_policy`, the app gets only `invocations:write` on `projects/{project_id}/*` so it can report results. That grant applies to all invocations in the project, not just this app’s runs.
-Moving a deployment to another host preserves the policy. Stopping it prevents new runs; it doesn't revoke keys already issued. `KERNEL_API_KEY` is a [reserved environment variable](/apps/deploy#reserved-environment-variables). To supply a credential for your own API calls, pass it under another name.
+**To grant more access**, send your policy as JSON in the `runtime_policy` multipart field of `POST /deployments`. Include the unconditional project-wide `invocations:write` grant and any additional permissions your app needs. The policy must fit within the app’s project and your own permissions, reference existing resources, and exclude `api_keys:issue_beyond_expiry`.
+
+To deploy with a scoped key, grant it container-wide `deployments:create`, `deployments:delete`, and `invocations:write`, plus any additional permissions in the app’s policy. To run the app with a scoped key, grant it `invocations:create` on the container and every permission in the app’s policy.
+
+Kernel supplies a short-lived `KERNEL_API_KEY` with the app’s permissions for each run. Moving a deployment to another host preserves the policy. Stopping it prevents new runs; it doesn't revoke keys already issued. `KERNEL_API_KEY` is a [reserved environment variable](/apps/deploy#reserved-environment-variables). To supply a credential for your own API calls, pass it under another name.
See the [app policy example](/info/api-key-policy-examples) for separate deployer, runtime, and invoker permissions.
diff --git a/info/authentication.mdx b/info/authentication.mdx
index 01f06ca1..36c78a8b 100644
--- a/info/authentication.mdx
+++ b/info/authentication.mdx
@@ -34,7 +34,7 @@ By default, a static API key works from anywhere, for anyone who holds it, until
| Any other platform that issues OIDC tokens | [Federation with a custom OIDC issuer](/info/workload-identity/custom-oidc) |
| A server or tool with no identity provider | A [service account API key](/info/workload-identity/service-accounts#service-account-api-keys), limited to one project and an explicit policy |
| Your laptop, while you develop | `kernel login` for the [CLI](/reference/cli/auth), or a personal [API key](/info/api-keys) with a short expiry for the SDKs |
-| A KERNEL app deployment | The [deployment key](/info/api-keys#deployment-api-keys) KERNEL injects for you |
+| A KERNEL app deployment | The [API key](/info/api-keys#app-runtime-policy) KERNEL injects for you |
| An MCP client such as Claude or Cursor | [OAuth](/reference/mcp-server/authentication) |
## When an API key is still the right tool
From 53a66f0489bb3e9bc64fc4bae596964d5a70d168 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 24 Nov 2026 15:51:39 +0000
Subject: [PATCH 16/22] Preserve links to the former deployment key section
---
info/api-keys.mdx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 992f32af..0967578c 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -310,6 +310,8 @@ Attaching a policy to a key that doesn't have one makes the key scoped: every ac
A key used through a hosted MCP server is evaluated against the MCP server's egress address, so an IP-restricted key is denied everywhere until MCP support ships. If you route keys through a hosted MCP server, leave `source_ip` conditions off those keys for now.
+
+
## App runtime policy
An app’s runtime policy controls which Kernel API calls that version can make. Set it when you deploy. Your app keeps those permissions if the key you used to deploy expires or is revoked; you don’t need to redeploy or store a key for the app.
From 37f82bea4afc00841f6168691527027fa90f971d Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 24 Nov 2026 19:14:40 +0000
Subject: [PATCH 17/22] Clarify scoped permissions and testable API examples
---
apps/deploy.mdx | 2 +-
browsers/telemetry/export.mdx | 2 +-
info/api-key-permissions.mdx | 8 +++++---
info/api-key-policy-examples.mdx | 4 ++--
info/api-keys.mdx | 19 +++++++++++++++----
info/projects.mdx | 2 +-
reference/cli/api-keys.mdx | 17 +++++++++++++----
reference/cli/projects.mdx | 2 +-
8 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index da0aae27..c2bdaa7f 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -47,7 +47,7 @@ kernel deploy github \
## Use a scoped API key
-When you deploy with a scoped API key, your [app runtime policy](/info/api-keys#app-runtime-policy) controls what that version can do. By default, it grants only project-wide `invocations:write` so your app can report results. Set `runtime_policy` when you deploy if your app needs more access, such as creating browsers.
+When you deploy with a scoped API key, your [app runtime policy](/info/api-keys#app-runtime-policy) controls what that version can do. By default, it grants only project-wide `invocations:write` so your app can report results. If your app needs more access, such as creating browsers, use the [multipart API example](/info/api-keys#app-runtime-policy). `kernel deploy` doesn’t accept a runtime policy flag.
## Environment variables
diff --git a/browsers/telemetry/export.mdx b/browsers/telemetry/export.mdx
index a3cad6f0..b768175b 100644
--- a/browsers/telemetry/export.mdx
+++ b/browsers/telemetry/export.mdx
@@ -12,7 +12,7 @@ Events are exported as OTLP **logs**. Kernel appends `/v1/logs` to your endpoint
## How export works
-You create a **destination** - an OTLP/HTTP endpoint plus the headers your backend expects - and select it when you create a browser. With a policy-scoped key, create and select the destination in the project where the browser runs.
+You create a **destination** - an OTLP/HTTP endpoint plus the headers your backend expects - and select it when you create a browser. Use organization-scoped authentication to create the destination in the browser’s project. For a non-default project, set `X-Kernel-Project-Id` (CLI: `--project`). A key bound to that project can select the destination but can’t create it.
Kernel's relay forwards the session's events to the destination and attaches your headers at export time. Headers are encrypted at rest and never reach the browser VM, so a session can export to your backend without ever holding your ingestion key.
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index 5fe42712..b101723e 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -38,7 +38,7 @@ Choose `kind` from the following resource types:
| Organization | `credential_providers`, `vault_provider_configs`, `audit_log_export_destinations` |
| Matches the target key | `api_keys`: a project key belongs to its project; a key without a project belongs to the organization, not the default project. |
-Kernel checks that each object ID exists within the credential's boundary when you create or update a key or rule. Existing project-owned resources without a project are treated as belonging to the default project.
+Use IDs, not display names, in policy resources, even when an endpoint accepts either. Kernel checks that each object ID exists within the credential's boundary when you create or update a key or rule. Existing project-owned resources without a project are treated as belonging to the default project.
Creation actions need a container selector ending in `/*`, rather than an existing object's ID. Project creation and creation of organization-owned resources need `organizations/{org_id}/*`. Audit log access also uses an organization container. Configuration registry actions use a project or organization container rather than individual analysis IDs.
@@ -114,7 +114,7 @@ How conditions evaluate:
| Action | Allows |
| --- | --- |
| `proxies:create` | Create and validate proxies. |
-| `proxies:read` | List proxies and view their configuration, without credentials. |
+| `proxies:read` | List proxies and view their configuration, without credentials. Listing or inspecting reserved proxy IPs needs container-wide `proxies:read`. |
| `proxies:use` | Select saved proxies for browsers and run health checks. |
| `proxies:write` | Rename proxies. |
| `proxies:delete` | Delete proxies. |
@@ -123,7 +123,7 @@ How conditions evaluate:
| Action | Allows |
| --- | --- |
-| `extensions:create` | Upload saved extensions and import them from the Chrome Web Store. |
+| `extensions:create` | Upload saved extensions or fetch a ZIP from the Chrome Web Store. Fetching a ZIP doesn’t save it. |
| `extensions:read` | List extensions and read their metadata. |
| `extensions:use` | Attach saved extensions to browsers and download their archives. |
| `extensions:delete` | Delete extensions. |
@@ -252,6 +252,8 @@ Native OAuth tokens can’t manage API keys. This applies to human sign-ins (inc
| --- | --- |
| Create a browser | Container-wide `browsers:create` and `browsers:use`, because the response includes connection URLs. Add `profiles:use` on its profile, `profiles:write` if it saves changes, `vaults:use` on each linked vault, `extensions:use` on saved extensions, `proxies:use` on selected saved proxies, and `telemetry_destinations:use` on an export destination. |
| Access an existing browser | The browser action, plus `profiles:use` on its attached profile, `vaults:use` on linked vaults, and `extensions:use` on saved extensions. If the browser saves profile changes, also grant `profiles:write`. |
+| Save a browser to a profile | `browsers:use` and the attachment permissions above. Grant `profiles:write` on an existing destination profile, or container-wide `profiles:create` to save under a new name. |
+| Upload extensions directly to a running browser | `browsers:use` and its attachment permissions. This uploads files to the browser rather than creating a saved extension. |
| Update a browser | `browsers:write` and `browsers:use`, plus permissions on attached resources and newly selected resources. |
| Create or update a pool | The pool's `create` or `write` action, plus `profiles:use` and `proxies:use` on selected resources, including proxy routes. Selecting saved extensions isn't supported for scoped credentials yet. |
| Acquire a pooled browser | `browser_pools:use`, container-wide `browsers:use`, and permissions on the pool's profile/extensions and the browser's actual attachments. An acquire-time profile also requires `profiles:write` when saving changes. |
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 83b76fb6..9ad418c7 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -96,7 +96,7 @@ policy = {
```
-Select destination ID `tdst_8k2q4m6r` in `telemetry.export.otlp.destination`. `telemetry_destinations:read` lets you inspect the destination; `telemetry_destinations:use` authorizes export.
+Set `telemetry.export.otlp.destination` to `{"id": "tdst_8k2q4m6r"}`. `telemetry_destinations:read` lets you inspect the destination; `telemetry_destinations:use` authorizes export.
@@ -244,7 +244,7 @@ A key with only `invocations:create` still fails to invoke this app: it doesn't
-Read staging API-key metadata, read organization audit logs, and look up browser configuration recommendations. Issue this as an organization-scoped key by omitting `project_id`.
+Read staging API-key metadata, read organization audit logs, and look up browser configuration recommendations. Issue this as an organization-scoped key by omitting `project_id`. For configuration registry requests, send `X-Kernel-Project-Id: proj_staging_9f3k` to select the project named in the policy.
```typescript TypeScript
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 0967578c..f76a31de 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -318,7 +318,18 @@ An app’s runtime policy controls which Kernel API calls that version can make.
**Default:** When you deploy with a scoped key and omit `runtime_policy`, the app gets only `invocations:write` on `projects/{project_id}/*` so it can report results. That grant applies to all invocations in the project, not just this app’s runs.
-**To grant more access**, send your policy as JSON in the `runtime_policy` multipart field of `POST /deployments`. Include the unconditional project-wide `invocations:write` grant and any additional permissions your app needs. The policy must fit within the app’s project and your own permissions, reference existing resources, and exclude `api_keys:issue_beyond_expiry`.
+**To grant more access**, use `POST /deployments`. For example, set `KERNEL_PROJECT_ID` to your project ID and `KERNEL_API_KEY` to your deploying key. With an `app.zip` containing `main.py` and its dependency manifest at the archive root, run:
+
+```bash
+curl --fail-with-body https://api.onkernel.com/deployments \
+ -H "Authorization: Bearer $KERNEL_API_KEY" \
+ -H "X-Kernel-Project-Id: $KERNEL_PROJECT_ID" \
+ -F file=@app.zip \
+ -F entrypoint_rel_path=main.py \
+ --form-string "runtime_policy={\"statements\":[{\"action\":\"invocations:write\",\"resource\":\"projects/$KERNEL_PROJECT_ID/*\"},{\"action\":\"browsers:create\",\"resource\":\"projects/$KERNEL_PROJECT_ID/*\"},{\"action\":\"browsers:use\",\"resource\":\"projects/$KERNEL_PROJECT_ID/*\"}]}"
+```
+
+This app can report results and create browsers without attachments. Include the unconditional project-wide `invocations:write` grant and any additional permissions your app needs. The policy must fit within the app’s project and your own permissions, reference existing resources, and exclude `api_keys:issue_beyond_expiry`.
To deploy with a scoped key, grant it container-wide `deployments:create`, `deployments:delete`, and `invocations:write`, plus any additional permissions in the app’s policy. To run the app with a scoped key, grant it `invocations:create` on the container and every permission in the app’s policy.
@@ -330,7 +341,7 @@ See the [app policy example](/info/api-key-policy-examples) for separate deploye
## List and inspect API keys
-List keys to audit what exists. List and retrieve responses include `masked_key`, `project_id`, `project_name`, `created_by`, expiry metadata, and `policy` for scoped keys, but they don't include the plaintext key.
+List keys to audit what exists. List and retrieve responses include `masked_key`, `project_id`, `project_name`, `created_by`, expiry metadata, and `policy` for scoped keys, but they don't include the plaintext key. If `policy` is absent, the key is unrestricted within its project or organization.
The list returns `active` keys by default: keys that are neither deleted nor expired. Pass `status` to see the others, and combine these filters to narrow the list:
@@ -392,7 +403,7 @@ func main() {
panic(err)
}
- apiKey, err := client.APIKeys.Get(ctx, "key_01jwv4tn5m8k3q2v7x9p0a1bc2")
+ apiKey, err := client.APIKeys.Get(ctx, "key_01jwv4tn5m8k3q2v7x9p0a1bc2", kernel.APIKeyGetParams{})
if err != nil {
panic(err)
}
@@ -451,7 +462,7 @@ func main() {
ctx,
"key_01jwv4tn5m8k3q2v7x9p0a1bc2",
kernel.APIKeyUpdateParams{
- Name: "staging-ci-rotated",
+ Name: kernel.String("staging-ci-rotated"),
},
)
if err != nil {
diff --git a/info/projects.mdx b/info/projects.mdx
index 0af5fecf..b3936afd 100644
--- a/info/projects.mdx
+++ b/info/projects.mdx
@@ -122,7 +122,7 @@ The Kernel [CLI](/reference/cli/projects) has first-class project support:
- A global `--project ` flag scopes any command to a single project ID.
- The `KERNEL_PROJECT` environment variable does the same, so you can set it once in your shell or CI.
-- A `kernel projects` command group lets you list, create, get, and delete projects, and manage per-project limit overrides.
+- A `kernel projects` command group lets you list, create, get, update, and delete projects, and manage per-project limit overrides.
```bash
# Scope a single command
diff --git a/reference/cli/api-keys.mdx b/reference/cli/api-keys.mdx
index 4a19e9cb..bdb93aed 100644
--- a/reference/cli/api-keys.mdx
+++ b/reference/cli/api-keys.mdx
@@ -23,7 +23,10 @@ kernel api-keys create \
| Flag | Description |
|------|-------------|
| `--name ` | API key name. Required. |
-| `--days-to-expire ` | Number of days until expiry, from `1` to `3650`. Omit for no expiry. |
+| `--days-to-expire ` | Number of days until expiry, from `1` to `3650`. Use this or `--expires-at`, not both. |
+| `--expires-at ` | Exact future expiry in RFC 3339 format. See [issuer expiry limits](/info/api-keys#delegate-a-narrower-key). |
+| `--policy ` | Grant only the actions and resources in this [policy](/info/api-key-policy-examples). Without a policy, the key is unrestricted within its project or organization. |
+| `--service-account-id ` | Issue a key for this service account instead of yourself. Requires organization administrator access, `--project-id`, and a non-empty `--policy`. |
| `--project-id ` | Create a project-scoped API key for this project. Omit for org-wide. |
| `--output json`, `-o json` | Output the raw JSON object, including the plaintext `key` on create. |
@@ -33,7 +36,7 @@ kernel api-keys create \
## `kernel api-keys list`
-List API keys in the authenticated organization. API keys are masked. The list shows active keys: keys that are neither deleted nor expired.
+List API keys in the authenticated organization. API keys are masked. By default, the list shows active keys: keys that are neither deleted nor expired.
```bash
kernel api-keys list --limit 20
@@ -43,6 +46,11 @@ kernel api-keys list --limit 20
|------|-------------|
| `--limit ` | Maximum number of results to return. |
| `--offset ` | Number of results to skip. |
+| `--status ` | `active`, `expired`, `deleted`, or `all`. Use `--status all` instead of the deprecated list flag `--include-deleted`. |
+| `--name `, `--query ` | Match an exact name, or search by name, creator, project, ID, or masked key. |
+| `--project-id `, `--created-by ` | Filter by project (or `org` for organization-wide keys) or creator. |
+| `--principal-type `, `--service-account-id ` | Filter by principal type (`user` or `service_account`) or service account. |
+| `--sort-by `, `--sort-direction ` | Sort by `created_at`, `name`, `expires_at`, or `last_used_at`, in `asc` or `desc` order. |
| `--output json`, `-o json` | Output the raw JSON array. |
## `kernel api-keys get `
@@ -60,7 +68,7 @@ kernel api-keys get key_01jwv4tn5m8k3q2v7x9p0a1bc2
## `kernel api-keys update `
-Rename an API key.
+Rename an API key, replace its policy, or both. Supply at least one of `--name` and `--policy`.
```bash
kernel api-keys update key_01jwv4tn5m8k3q2v7x9p0a1bc2 --name staging-ci-rotated
@@ -68,7 +76,8 @@ kernel api-keys update key_01jwv4tn5m8k3q2v7x9p0a1bc2 --name staging-ci-rotated
| Flag | Description |
|------|-------------|
-| `--name ` | New API key name. Required. |
+| `--name ` | New API key name. |
+| `--policy ` | Complete replacement policy. Omitted statements are not retained. |
| `--output json`, `-o json` | Output the raw JSON object. |
## `kernel api-keys rotate `
diff --git a/reference/cli/projects.mdx b/reference/cli/projects.mdx
index f4f52f25..16972c10 100644
--- a/reference/cli/projects.mdx
+++ b/reference/cli/projects.mdx
@@ -27,7 +27,7 @@ Under the hood, the flag adds the `X-Kernel-Project-Id` header to every authenti
### `kernel projects list`
-List all projects in the authenticated organization.
+List visible projects. Filter by exact name with `--name` or search with `--query`; use `--limit` and `--offset` to paginate.
### `kernel projects create `
From b7312feab43d9cccf167a28adb62e0f81e2e8436 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 24 Nov 2026 19:34:12 +0000
Subject: [PATCH 18/22] Document CLI project selection by name or ID
---
info/api-keys.mdx | 2 +-
info/projects.mdx | 6 +++---
reference/cli/projects.mdx | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index f76a31de..935e5810 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -341,7 +341,7 @@ See the [app policy example](/info/api-key-policy-examples) for separate deploye
## List and inspect API keys
-List keys to audit what exists. List and retrieve responses include `masked_key`, `project_id`, `project_name`, `created_by`, expiry metadata, and `policy` for scoped keys, but they don't include the plaintext key. If `policy` is absent, the key is unrestricted within its project or organization.
+Use `GET /org/api_keys` to list keys and `GET /org/api_keys/{id}` to inspect one. List and retrieve responses include `masked_key`, `project_id`, `project_name`, `created_by`, expiry metadata, and `policy` for scoped keys, but they don't include the plaintext key. If `policy` is absent, the key is unrestricted within its project or organization.
The list returns `active` keys by default: keys that are neither deleted nor expired. Pass `status` to see the others, and combine these filters to narrow the list:
diff --git a/info/projects.mdx b/info/projects.mdx
index b3936afd..df5d70ea 100644
--- a/info/projects.mdx
+++ b/info/projects.mdx
@@ -25,7 +25,7 @@ A project must also be empty before it can be deleted. If active resources remai
## Scoping requests to a project
-Pass the `X-Kernel-Project-Id` header with a project ID on any API request to scope it to a specific project. Project names are not accepted in this header. Without the header (and without a project-scoped API key), requests act on your organization's **default project**: reads return the default project's resources, and writes create resources in it.
+Pass the `X-Kernel-Project-Id` header with a project ID on any API request to scope it to a specific project. For an exact project name or ID, use `X-Kernel-Project` instead. Without the header (and without a project-scoped API key), requests act on your organization's **default project**: reads return the default project's resources, and writes create resources in it.
```bash
curl https://api.onkernel.com/browsers \
@@ -120,7 +120,7 @@ A [federation rule](/info/workload-identity/overview#federation-rules) names exa
The Kernel [CLI](/reference/cli/projects) has first-class project support:
-- A global `--project ` flag scopes any command to a single project ID.
+- A global `--project ` flag scopes a command to a project by ID or exact name.
- The `KERNEL_PROJECT` environment variable does the same, so you can set it once in your shell or CI.
- A `kernel projects` command group lets you list, create, get, update, and delete projects, and manage per-project limit overrides.
@@ -138,7 +138,7 @@ kernel projects create staging
kernel projects limits set staging --max-concurrent-sessions 5
```
-Under the hood, `--project` (or the env var) adds the `X-Kernel-Project-Id` header to every authenticated request. The project must be covered by your credential.
+Under the hood, `--project` (or the env var) adds the `X-Kernel-Project` header to every authenticated request. The project must be covered by your credential.
## Managing projects
diff --git a/reference/cli/projects.mdx b/reference/cli/projects.mdx
index 16972c10..be158dce 100644
--- a/reference/cli/projects.mdx
+++ b/reference/cli/projects.mdx
@@ -6,7 +6,7 @@ Manage [Projects](/info/projects) from the CLI and scope other commands to a spe
## Scoping commands to a project
-Use the global `--project` flag (or the `KERNEL_PROJECT` environment variable) to scope any `kernel` command to a project ID. Project names are accepted by project-management commands whose arguments say ``, but not by this global request-scoping flag.
+Use the global `--project` flag (or the `KERNEL_PROJECT` environment variable) to select a project by ID or exact name.
```bash
# Scope by ID
@@ -17,7 +17,7 @@ export KERNEL_PROJECT=proj_abc123
kernel apps list
```
-Under the hood, the flag adds the `X-Kernel-Project-Id` header to every authenticated API request. With a [single-project OAuth grant](/info/projects#oauth), requests use that project automatically. With an all-projects grant, use the flag to target a project other than the default.
+Under the hood, the flag adds the `X-Kernel-Project` header to every authenticated API request. With a [single-project OAuth grant](/info/projects#oauth), requests use that project automatically. With an all-projects grant, use the flag to target a project other than the default.
Project-scoped API keys are already bound to a project server-side, so you don't need `--project` when using them — but if you do pass it, it must match the key's project or the request is rejected.
From a4fade1ead099249dd09a257100cc364be555b69 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 24 Nov 2026 20:59:09 +0000
Subject: [PATCH 19/22] Document action wildcards in API key policies
---
info/api-key-permissions.mdx | 16 ++++++++++++++++
info/api-keys.mdx | 2 +-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index b101723e..a2dc2d0b 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -46,6 +46,22 @@ Creation actions need a container selector ending in `/*`, rather than an existi
A policy narrows your key's access; it doesn't change its organization or project boundary. Use an organization-scoped key for organization administration, credential providers, wallet provider configurations, audit logs, and telemetry destination management. A project-scoped key can rename its own project, but project creation, deletion, status changes, and limit changes require an organization-scoped credential.
+## Action wildcards
+
+When you create an API key or replace its policy, you can write `*` in place of a whole part of an action:
+
+| Action | Expands to |
+| --- | --- |
+| `browsers:*` | Every `browsers` action. |
+| `*:delete` | Every `delete` action that applies to the statement's resource. |
+| `*:*` | Every action that applies to the statement's resource. |
+
+Kernel expands the wildcard when it saves the policy, keeping the statement's resource and condition, and stores only the matching actions. The key doesn't gain actions Kernel adds later, and a scoped issuer must hold every expanded action. On a project container, a wildcard skips organization actions; on one object, it keeps only that object's actions.
+
+- A wildcard never includes `api_keys:issue_beyond_expiry`. List it explicitly.
+- Partial wildcards such as `brow*:use`, a bare `*`, unknown names, and wildcards matching nothing on their resource return `400`.
+- Federation rules and app runtime policies accept only exact actions.
+
## Conditions
A statement can carry one condition that narrows it to matching requests:
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 935e5810..2f1bf6d5 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -105,7 +105,7 @@ Use scoped keys when you hand a credential to code you trust less than your back
A policy is a list of **statements**. Each statement allows one **action** on one **resource**, and the key is denied everything no statement allows.
- A **resource** selects one project-owned object, such as `projects/{project_id}/extensions/{extension_id}`, an organization-owned object, such as `credential_providers/{provider_id}`, or a container such as `projects/{project_id}/*` or `organizations/{org_id}/*`.
-- An **action** is an exact name such as `browsers:use`, `extensions:read`, or `api_keys:create`. A container wildcard grants that action throughout the container, not every action.
+- An **action** is an exact name such as `browsers:use`, `extensions:read`, or `api_keys:create`. A container wildcard grants that action throughout the container, not every action. To grant several actions at once, see [action wildcards](/info/api-key-permissions#action-wildcards).
A statement can also carry a **condition** that narrows it to matching requests. A condition names a request attribute, a comparison operator, and that operator's values. See [Limit a key to your IP ranges](/info/api-keys#limit-a-key-to-your-ip-ranges).
From 8a508192a6e15cc23d69f671d59b40a27b84947b Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Tue, 24 Nov 2026 23:00:26 +0000
Subject: [PATCH 20/22] Note revocation delay when deleting API keys
---
info/api-keys.mdx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 2f1bf6d5..01fde639 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -418,7 +418,7 @@ func main() {
Rename a key when the owner or purpose changes. Update its `policy` to add, change, or remove IP rules and permissions without rotating the credential. Delete a key when the workload no longer needs access.
-An API key cannot delete itself. Authenticate with a different key when deleting a key, so the request cannot revoke the credential that is authorizing it. Deleting a key also ends its associated browsers asynchronously and discards their unsaved profile changes.
+An API key cannot delete itself. Authenticate with a different key when deleting a key, so the request cannot revoke the credential that is authorizing it. A deleted key stops authenticating new requests within the authorization cache (~10 seconds). Deleting a key also ends its associated browsers asynchronously and discards their unsaved profile changes.
From 0071f0a4aefe5e4da8726ed2fecc9613f5e5bbd7 Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Wed, 25 Nov 2026 12:56:30 +0000
Subject: [PATCH 21/22] Use TypeScript and Python examples for app runtime
policies
---
apps/deploy.mdx | 2 +-
info/api-keys.mdx | 75 +++++++++++++++++++++++++++++++++++++++++------
2 files changed, 67 insertions(+), 10 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index c2bdaa7f..67370199 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -47,7 +47,7 @@ kernel deploy github \
## Use a scoped API key
-When you deploy with a scoped API key, your [app runtime policy](/info/api-keys#app-runtime-policy) controls what that version can do. By default, it grants only project-wide `invocations:write` so your app can report results. If your app needs more access, such as creating browsers, use the [multipart API example](/info/api-keys#app-runtime-policy). `kernel deploy` doesn’t accept a runtime policy flag.
+When you deploy with a scoped API key, your [app runtime policy](/info/api-keys#app-runtime-policy) controls what that version can do. By default, it grants only project-wide `invocations:write` so your app can report results. If your app needs more access, such as creating browsers, use the [runtime policy example](/info/api-keys#app-runtime-policy). `kernel deploy` doesn’t accept a runtime policy flag.
## Environment variables
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 01fde639..1d901d6a 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -318,16 +318,73 @@ An app’s runtime policy controls which Kernel API calls that version can make.
**Default:** When you deploy with a scoped key and omit `runtime_policy`, the app gets only `invocations:write` on `projects/{project_id}/*` so it can report results. That grant applies to all invocations in the project, not just this app’s runs.
-**To grant more access**, use `POST /deployments`. For example, set `KERNEL_PROJECT_ID` to your project ID and `KERNEL_API_KEY` to your deploying key. With an `app.zip` containing `main.py` and its dependency manifest at the archive root, run:
-
-```bash
-curl --fail-with-body https://api.onkernel.com/deployments \
- -H "Authorization: Bearer $KERNEL_API_KEY" \
- -H "X-Kernel-Project-Id: $KERNEL_PROJECT_ID" \
- -F file=@app.zip \
- -F entrypoint_rel_path=main.py \
- --form-string "runtime_policy={\"statements\":[{\"action\":\"invocations:write\",\"resource\":\"projects/$KERNEL_PROJECT_ID/*\"},{\"action\":\"browsers:create\",\"resource\":\"projects/$KERNEL_PROJECT_ID/*\"},{\"action\":\"browsers:use\",\"resource\":\"projects/$KERNEL_PROJECT_ID/*\"}]}"
+**To grant more access**, send `runtime_policy` as a JSON form field on `POST /deployments`. The SDKs don't accept `runtime_policy` yet, so these examples call the API directly. Set `KERNEL_PROJECT_ID` to your project ID and `KERNEL_API_KEY` to your deploying key, and put `main.py` and its dependency manifest at the root of `app.zip`:
+
+
+```typescript TypeScript
+import { readFile } from 'node:fs/promises';
+
+const projectId = process.env.KERNEL_PROJECT_ID!;
+const resource = `projects/${projectId}/*`;
+const runtimePolicy = {
+ statements: [
+ { action: 'invocations:write', resource },
+ { action: 'browsers:create', resource },
+ { action: 'browsers:use', resource },
+ ],
+};
+
+const form = new FormData();
+form.append('file', new Blob([await readFile('app.zip')]), 'app.zip');
+form.append('entrypoint_rel_path', 'main.py');
+form.append('runtime_policy', JSON.stringify(runtimePolicy));
+
+const response = await fetch('https://api.onkernel.com/deployments', {
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${process.env.KERNEL_API_KEY}`,
+ 'X-Kernel-Project-Id': projectId,
+ },
+ body: form,
+});
+if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
+console.log(await response.json());
+```
+
+```python Python
+import json
+import os
+
+import httpx
+
+project_id = os.environ["KERNEL_PROJECT_ID"]
+resource = f"projects/{project_id}/*"
+runtime_policy = {
+ "statements": [
+ {"action": "invocations:write", "resource": resource},
+ {"action": "browsers:create", "resource": resource},
+ {"action": "browsers:use", "resource": resource},
+ ]
+}
+
+with open("app.zip", "rb") as app:
+ response = httpx.post(
+ "https://api.onkernel.com/deployments",
+ headers={
+ "Authorization": f"Bearer {os.environ['KERNEL_API_KEY']}",
+ "X-Kernel-Project-Id": project_id,
+ },
+ files={"file": ("app.zip", app, "application/zip")},
+ data={
+ "entrypoint_rel_path": "main.py",
+ "runtime_policy": json.dumps(runtime_policy),
+ },
+ timeout=120,
+ )
+response.raise_for_status()
+print(response.json())
```
+
This app can report results and create browsers without attachments. Include the unconditional project-wide `invocations:write` grant and any additional permissions your app needs. The policy must fit within the app’s project and your own permissions, reference existing resources, and exclude `api_keys:issue_beyond_expiry`.
From 5dcfaba99ef6094fc8b68f8aa65f3aede3a40feb Mon Sep 17 00:00:00 2001
From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com>
Date: Wed, 25 Nov 2026 17:40:25 +0000
Subject: [PATCH 22/22] Clarify scoped app permissions and key delegation
---
apps/deploy.mdx | 2 +-
info/api-key-permissions.mdx | 18 +++++++++---------
info/api-key-policy-examples.mdx | 10 +++-------
info/api-keys.mdx | 24 +++++++++++++++---------
info/authentication.mdx | 2 +-
info/projects.mdx | 6 +++---
reference/cli/api-keys.mdx | 2 +-
7 files changed, 33 insertions(+), 31 deletions(-)
diff --git a/apps/deploy.mdx b/apps/deploy.mdx
index 67370199..ad29f697 100644
--- a/apps/deploy.mdx
+++ b/apps/deploy.mdx
@@ -47,7 +47,7 @@ kernel deploy github \
## Use a scoped API key
-When you deploy with a scoped API key, your [app runtime policy](/info/api-keys#app-runtime-policy) controls what that version can do. By default, it grants only project-wide `invocations:write` so your app can report results. If your app needs more access, such as creating browsers, use the [runtime policy example](/info/api-keys#app-runtime-policy). `kernel deploy` doesn’t accept a runtime policy flag.
+When you run `kernel deploy` with a scoped API key, the app gets only project-wide `invocations:write` to report results. Deployment succeeds, but browser calls from the app return `403`. The CLI has no runtime policy flag. To grant browser access, [deploy through the API with an explicit app runtime policy](/info/api-keys#app-runtime-policy).
## Environment variables
diff --git a/info/api-key-permissions.mdx b/info/api-key-permissions.mdx
index a2dc2d0b..a4dec8b4 100644
--- a/info/api-key-permissions.mdx
+++ b/info/api-key-permissions.mdx
@@ -28,7 +28,7 @@ For a CI job, cloud service, or Kubernetes pod, put the policy on a federation r
| `organizations/{org_id}/*` | Resources throughout the organization, for the statement's action. |
| `projects/{project_id}/*` | Resources in one project, for the statement's action. |
| `projects/{project_id}/{kind}/{id}` | One project-owned resource. |
-| `{kind}/{id}` | One resource. For a project-owned resource, the request's project determines its scope. Use this form for organization-owned resources. |
+| `{kind}/{id}` | Use for organization-owned resources. For project resources this resolves against the request's project; prefer `projects/{project_id}/{kind}/{id}` to name the project explicitly. |
Choose `kind` from the following resource types:
@@ -91,7 +91,7 @@ How conditions evaluate:
| --- | --- |
| `organizations:read` | Read organization entitlements and limits. |
| `organizations:write` | Set the organization's default per-project limits. |
-| `projects:create` | Create projects. Grant on the organization container. |
+| `projects:create` | Create projects. |
| `projects:read` | List projects and read project metadata and limits. |
| `projects:write` | Rename projects and set their limits. |
| `projects:delete` | Archive or restore projects, and delete empty projects. A project update that changes `status` along with other fields also needs `projects:write`. |
@@ -170,7 +170,7 @@ Scoped keys resolve destinations within the request's project. Reading and selec
| Action | Allows |
| --- | --- |
-| `tasks:create` | Create tasks. Grant on the project or organization container. |
+| `tasks:create` | Create tasks. |
| `tasks:read` | List and read tasks, linked browser IDs, and reports; find report types for a task. |
| `tasks:write` | Link browsers and submit reports. Also requires `tasks:read` on the task. |
@@ -180,10 +180,10 @@ Reports use their parent task's permissions; they don't have separate policy sel
| Action | Allows |
| --- | --- |
-| `deployments:create` | Deploy apps, together with `deployments:delete` and `invocations:write`. |
+| `deployments:create` | Deploy apps. |
| `deployments:read` | List apps and deployments, and read deployment details, events, and logs. |
| `deployments:delete` | Stop and delete deployments, including versions replaced by a new deployment. |
-| `invocations:create` | Run app actions, subject to the runtime-key requirements below. |
+| `invocations:create` | Run app actions. |
| `invocations:read` | List invocations and read payloads, outputs, events, and logs. |
| `invocations:write` | Update invocation status and output, and attach new browsers to invocations. |
@@ -230,14 +230,14 @@ A read grant returns connection metadata. To receive hosted login or live view U
| Action | Allows |
| --- | --- |
| `api_keys:create` | Issue keys in the authorized container. A scoped issuer must grant a subset of its own policy. |
-| `api_keys:issue_beyond_expiry` | Allow a scoped key's finite expiry to exceed the caller's, up to 3650 days. Grant it on the new key's container for creation, or the existing key for rotation. Scoped callers cannot pass this permission to another key. |
+| `api_keys:issue_beyond_expiry` | Issue longer-lived keys under the [issuer expiry rule](/info/api-keys#delegate-a-narrower-key). Scoped callers can't delegate this permission. |
| `api_keys:read` | List keys and read metadata and policies, without plaintext keys. |
| `api_keys:write` | Rename keys. |
| `api_keys:set_policy` | Replace a key’s entire policy without rotating its secret. A scoped caller must cover both the existing and replacement policies and can’t convert an unrestricted key. Renaming the key in the same request also requires `api_keys:write`. |
| `api_keys:rotate` | Replace keys whose policies the caller covers, returning the new plaintext key. |
| `api_keys:delete` | Revoke keys. |
-A new key with a policy must expire no later than the credential that creates it unless that credential holds `api_keys:issue_beyond_expiry` on the target container. The same limit applies when a caller with a policy rotates a key, checked on the existing key. Rotation by a caller without a policy keeps its existing replacement-lifetime behavior. Excessive expiry requests return `400`; Kernel never silently shortens them. Other permission checks still apply. See [Delegating access](/info/api-keys#delegate-a-narrower-key).
+See [Delegate a narrower key](/info/api-keys#delegate-a-narrower-key) for policy and expiry requirements.
Native OAuth tokens can’t manage API keys. This applies to human sign-ins (including requests for identity scopes only), machine tokens, and exchanged tokens. OAuth rejects requests for `api_keys:` permissions. Use a personal API key with the required permissions instead.
@@ -297,10 +297,10 @@ Connection updates check the resulting configuration. Turning off credential sav
| Operation | Requires |
| --- | --- |
| Deploy an app | Container-wide `deployments:create`, `deployments:delete`, and `invocations:write`, plus any additional permissions in the [app runtime policy](/info/api-keys#app-runtime-policy). |
-| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the runtime policy. Existing shared runtime keys must also be live and expire no later than yours. |
+| Invoke an app action | Container-wide `invocations:create`. Your policy must cover the [app runtime policy](/info/api-keys#app-runtime-policy). For apps with a shared key, see [Existing deployments](/info/api-keys#existing-deployments). |
| Read invocation events | `invocations:read` and `deployments:read`, because the stream includes deployment state. |
| Create a browser attached to an invocation | Browser creation permissions plus `invocations:write` on the invocation. |
-| Create or rotate an API key with a key that has a policy | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting key's policy. If your key expires, the new or replacement key must expire no later than it unless you also hold `api_keys:issue_beyond_expiry` on the target and request a finite lifetime of up to 3650 days. You can't issue or rotate a key carrying that permission. |
+| Create or rotate an API key with a key that has a policy | `api_keys:create` on the new key's container, or `api_keys:rotate` on the existing key, plus every permission in the resulting policy. The [issuer expiry rule](/info/api-keys#delegate-a-narrower-key) also applies. |
| Update an audit export destination | `audit_log_export_destinations:write` and organization-wide `audit_logs:read`. |
| Resolve a browser configuration | `config_registry:create` and `config_registry:read`. |
diff --git a/info/api-key-policy-examples.mdx b/info/api-key-policy-examples.mdx
index 9ad418c7..d3c59006 100644
--- a/info/api-key-policy-examples.mdx
+++ b/info/api-key-policy-examples.mdx
@@ -48,7 +48,6 @@ const policy = {
statements: [
{ action: 'browsers:create', resource: 'projects/proj_staging_9f3k/*' },
{ action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
- { action: 'extensions:read', resource: 'projects/proj_staging_9f3k/extensions/ext_9k4m2q7s' },
{ action: 'extensions:use', resource: 'projects/proj_staging_9f3k/extensions/ext_9k4m2q7s' },
],
};
@@ -59,7 +58,6 @@ policy = {
"statements": [
{"action": "browsers:create", "resource": "projects/proj_staging_9f3k/*"},
{"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
- {"action": "extensions:read", "resource": "projects/proj_staging_9f3k/extensions/ext_9k4m2q7s"},
{"action": "extensions:use", "resource": "projects/proj_staging_9f3k/extensions/ext_9k4m2q7s"},
],
}
@@ -96,7 +94,7 @@ policy = {
```
-Set `telemetry.export.otlp.destination` to `{"id": "tdst_8k2q4m6r"}`. `telemetry_destinations:read` lets you inspect the destination; `telemetry_destinations:use` authorizes export.
+When creating the browser, enable at least one telemetry source (for example, set `telemetry.browser.console.enabled` to `true`) and set `telemetry.export.otlp.destination` to `{"id": "tdst_8k2q4m6r"}`. Export without capture returns `400`. See the [complete browser request](/browsers/telemetry/export#export-a-sessions-telemetry).
@@ -106,7 +104,6 @@ Acquire and release browsers from one pool that uses a saved profile.
```typescript TypeScript
const policy = {
statements: [
- { action: 'browser_pools:read', resource: 'projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s' },
{ action: 'browser_pools:use', resource: 'projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s' },
{ action: 'browsers:use', resource: 'projects/proj_staging_9f3k/*' },
{ action: 'profiles:use', resource: 'projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1' },
@@ -117,7 +114,6 @@ const policy = {
```python Python
policy = {
"statements": [
- {"action": "browser_pools:read", "resource": "projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s"},
{"action": "browser_pools:use", "resource": "projects/proj_staging_9f3k/browser_pools/pool_6m2k9q4s"},
{"action": "browsers:use", "resource": "projects/proj_staging_9f3k/*"},
{"action": "profiles:use", "resource": "projects/proj_staging_9f3k/profiles/prof_7h2kq9x4m1"},
@@ -198,7 +194,7 @@ Use this key to deploy and invoke the app. If you omit `runtime_policy`, the [ap
-When you deploy with a scoped key and omit `runtime_policy`, the app gets only project-wide `invocations:write`. Use an explicit runtime policy to add browser access without deployment-management permissions. This app creates browsers without saved profiles or other attached resources.
+Use an explicit runtime policy to give the app browser access without deployment-management permissions. This app creates browsers without saved profiles or other attached resources.
```typescript TypeScript
@@ -240,7 +236,7 @@ Send the runtime policy as JSON in the `runtime_policy` multipart field of `POST
A supplied runtime policy with only `browsers:create` and `browsers:use` is rejected with `400`: it must explicitly include project-wide `invocations:write`. Permissions aren't silently added.
-A key with only `invocations:create` still fails to invoke this app: it doesn't cover the runtime's browser and callback permissions. If you omit `runtime_policy`, the app gets only project-wide `invocations:write`, and an invoking key needs that permission plus `invocations:create`. Add `invocations:read` and `deployments:read` if the invoker also needs invocation results and event streams.
+A key with only `invocations:create` can't invoke this app: it doesn't cover the runtime's browser and callback permissions. Add `invocations:read` to read results and `deployments:read` as well to read the event stream.
diff --git a/info/api-keys.mdx b/info/api-keys.mdx
index 1d901d6a..598b8dad 100644
--- a/info/api-keys.mdx
+++ b/info/api-keys.mdx
@@ -168,7 +168,7 @@ print(api_key.key) # Save this value now. Kernel won't show it again.
### Expiry and revocation
-- Use `expires_at` for an exact expiry, such as minutes from now, instead of `days_to_expire`. When you create a key with a policy, it can't outlive the issuing credential unless that credential holds `api_keys:issue_beyond_expiry` on the target. Kernel returns `400` for an expiry it can't honor; it never silently shortens the requested lifetime.
+- Use `expires_at` instead of `days_to_expire` for an exact expiry. When creating a key with a policy, follow the [issuer expiry rule](#delegate-a-narrower-key).
- Expired and deleted keys can't authenticate new API requests.
- Deleting a key through the API or dashboard, or rotating it with `expire_in_days: 0`, also ends browser sessions associated with that key, including pool browsers it acquired and hasn't released. Cleanup runs asynchronously and discards unsaved profile changes.
- Grace-period expiry and natural expiry do **not** end existing browsers. Delete those browsers explicitly if you need to stop them.
@@ -186,11 +186,11 @@ You can use a scoped key to create another scoped key:
1. Grant the issuer `api_keys:create` on the new key's project or organization container.
2. Supply a `policy` whose statements are covered by the issuer's policy, and keep the new key inside the issuer's organization/project boundary.
-3. Set the new key's expiry no later than the issuer's expiry, or grant the issuer `api_keys:issue_beyond_expiry` on that container and request a finite lifetime of at most 3650 days.
+3. If the issuer expires, set the child's expiry no later than the issuer's. To issue a longer-lived child, the issuer needs `api_keys:issue_beyond_expiry` on the new key's container and must request a finite lifetime of at most 3650 days. Kernel returns `400` rather than shortening a disallowed lifetime. When rotating with a scoped key, the same expiry rule applies, but Kernel checks the permission on the existing key.
For example, an issuer with `api_keys:create` and `browsers:use` on a project can issue a key with only `browsers:use` on one browser in that project. Use the same SDK creation call shown above with the narrower policy.
-Use `api_keys:read` to inspect keys, `api_keys:write` to rename them, `api_keys:delete` to revoke them, and `api_keys:rotate` to replace them. When a scoped key rotates another key, it must also cover the target key's policy, and the replacement's expiry follows the same rule as creation, with `api_keys:issue_beyond_expiry` checked on the existing key. These permissions are separate, so you can grant metadata access without granting key issuance or rotation.
+Use `api_keys:read` to inspect keys, `api_keys:write` to rename them, `api_keys:delete` to revoke them, and `api_keys:rotate` to replace them. Grant these actions separately from key issuance.
### Allow longer-lived child keys
@@ -230,7 +230,7 @@ issuer = client.api_keys.create(
Authenticate with `issuer.key` to create a child with `days_to_expire: 365` and only `browsers:use` on this project. Its expiry is one year, not silently shortened to the issuer's 30 days. Without the special permission, that request returns `400`.
-The child must have a finite expiry of at most 3650 days. Scoped callers cannot create or rotate keys whose policies contain `api_keys:issue_beyond_expiry`, so the child can't inherit this authority. Add `api_keys:rotate` separately to let the issuer rotate other keys.
+Scoped callers cannot create or rotate keys whose policies contain `api_keys:issue_beyond_expiry`, so the child can't inherit this authority. Add `api_keys:rotate` separately to let the issuer rotate other keys.
Grant this permission only to trusted issuers. Their child keys can remain valid after the issuer expires or is revoked.
@@ -316,7 +316,7 @@ A key used through a hosted MCP server is evaluated against the MCP server's egr
An app’s runtime policy controls which Kernel API calls that version can make. Set it when you deploy. Your app keeps those permissions if the key you used to deploy expires or is revoked; you don’t need to redeploy or store a key for the app.
-**Default:** When you deploy with a scoped key and omit `runtime_policy`, the app gets only `invocations:write` on `projects/{project_id}/*` so it can report results. That grant applies to all invocations in the project, not just this app’s runs.
+**Default:** When you deploy with a scoped key and omit `runtime_policy`, the app gets only `invocations:write` on `projects/{project_id}/*` so it can report results. That grant lets the app update other apps’ invocations in the same project. Put apps that don’t trust each other in separate projects.
**To grant more access**, send `runtime_policy` as a JSON form field on `POST /deployments`. The SDKs don't accept `runtime_policy` yet, so these examples call the API directly. Set `KERNEL_PROJECT_ID` to your project ID and `KERNEL_API_KEY` to your deploying key, and put `main.py` and its dependency manifest at the root of `app.zip`:
@@ -394,7 +394,13 @@ Kernel supplies a short-lived `KERNEL_API_KEY` with the app’s permissions for
See the [app policy example](/info/api-key-policy-examples) for separate deployer, runtime, and invoker permissions.
-**Existing deployments and unscoped defaults:** Existing shared keys aren't migrated. Deploying with an unrestricted credential and omitting `runtime_policy` still creates one shared runtime key; supplying the field opts into per-invocation keys. Scoped callers cannot invoke an unrestricted runtime. For an existing shared key with a policy, the key must be live, its permissions covered, and its expiry no later than the invoker's. Host moves preserve these bounds, and superseded deployments keep their shared key until in-flight runs drain.
+### Existing deployments
+
+
+Scoped callers can't invoke an app that runs with an unrestricted shared key, even with `invocations:create`. To let them run it, redeploy with an explicit runtime policy that their permissions cover.
+
+
+Deploying with an unrestricted credential and omitting `runtime_policy` creates a shared key; it doesn't migrate the app to per-invocation keys. If the shared key has a policy, it must be live, its permissions must be covered by the caller, and it must expire no later than the caller. Host moves preserve these rules; superseded deployments keep their shared key until in-flight runs drain.
## List and inspect API keys
@@ -545,7 +551,7 @@ Two optional parameters control the timing:
If the key you rotate with has no policy, these lifetime rules apply to every target, including keys with policies, and you don't need `api_keys:issue_beyond_expiry`.
-If the key you rotate with has a policy, it needs `api_keys:rotate` on the target and must cover the target's policy. When the caller expires, the replacement must expire no later than the caller, or the caller must hold `api_keys:issue_beyond_expiry` on the target and request a finite lifetime of up to 3650 days. The same check applies when you omit `days_to_expire` and reuse the old lifetime. A disallowed expiry returns `400`, never a shortened replacement. A caller with a policy cannot rotate a key that itself carries `api_keys:issue_beyond_expiry`.
+If the key you rotate with has a policy, it needs `api_keys:rotate` on the target and must cover the target's policy. The [issuer expiry rule](#delegate-a-narrower-key) applies even when you omit `days_to_expire` and reuse the old lifetime. A scoped caller can't rotate a key that itself carries `api_keys:issue_beyond_expiry`.
```typescript TypeScript
@@ -628,8 +634,8 @@ It's still a stored secret. Prefer federation wherever your workload has an iden
| --- | --- | --- |
| `400 Bad Request` | The name is missing, `days_to_expire` is outside `1`-`3650`, `expire_in_days` is outside `0`-`3650`, or `project_id` is empty. | Send a name, choose a valid expiry, or omit `project_id` for an org-scoped key. |
| `400 Bad Request` (rotate) | `days_to_expire` is shorter than `expire_in_days`, so the new key would expire before the old key's grace window ends. | Raise `days_to_expire` or lower `expire_in_days`. |
-| `400 Bad Request` (policy) | The action, resource, or condition is invalid, or the update sets `policy: null`. | Check the [permission reference](/info/api-key-permissions) and send the complete replacement policy. |
-| `400 Bad Request` (issuer expiry) | The requested lifetime exceeds the issuer’s when creating a key with a policy or rotating with a scoped caller. | Request a shorter lifetime or check the [longer-lived key exception](#allow-longer-lived-child-keys). |
+| `400 Bad Request` (policy) | The action, resource, or condition is invalid, or the update sets `policy: null`. | For `source_ip`, use CIDR notation without host bits or IPv4-in-IPv6 addresses. Check the [permission reference](/info/api-key-permissions) and send the complete replacement policy. |
+| `400 Bad Request` (issuer expiry) | The requested lifetime exceeds what the issuer can grant. | Check the [issuer expiry rule](#delegate-a-narrower-key). |
| `401 Unauthorized` | Kernel couldn't authenticate the request. | Set a valid `KERNEL_API_KEY`. |
| `403 Forbidden` (`insufficient_scope`) | A scoped key is missing a permission. | The message names the missing action and resource. Add it to the policy. |
| `404 Not Found` | The project, API key, or a resource named in the policy doesn't exist, or the caller can't access it. | Check the ID. If you're using a project-scoped key, you can only rotate keys in that same project. |
diff --git a/info/authentication.mdx b/info/authentication.mdx
index 36c78a8b..ad345cf4 100644
--- a/info/authentication.mdx
+++ b/info/authentication.mdx
@@ -34,7 +34,7 @@ By default, a static API key works from anywhere, for anyone who holds it, until
| Any other platform that issues OIDC tokens | [Federation with a custom OIDC issuer](/info/workload-identity/custom-oidc) |
| A server or tool with no identity provider | A [service account API key](/info/workload-identity/service-accounts#service-account-api-keys), limited to one project and an explicit policy |
| Your laptop, while you develop | `kernel login` for the [CLI](/reference/cli/auth), or a personal [API key](/info/api-keys) with a short expiry for the SDKs |
-| A KERNEL app deployment | The [API key](/info/api-keys#app-runtime-policy) KERNEL injects for you |
+| A KERNEL app deployment | Use the injected credential. Its permissions come from [the app's runtime policy](/info/api-keys#app-runtime-policy) when one is set. |
| An MCP client such as Claude or Cursor | [OAuth](/reference/mcp-server/authentication) |
## When an API key is still the right tool
diff --git a/info/projects.mdx b/info/projects.mdx
index df5d70ea..4988040a 100644
--- a/info/projects.mdx
+++ b/info/projects.mdx
@@ -25,12 +25,12 @@ A project must also be empty before it can be deleted. If active resources remai
## Scoping requests to a project
-Pass the `X-Kernel-Project-Id` header with a project ID on any API request to scope it to a specific project. For an exact project name or ID, use `X-Kernel-Project` instead. Without the header (and without a project-scoped API key), requests act on your organization's **default project**: reads return the default project's resources, and writes create resources in it.
+Use `X-Kernel-Project` to select a project by exact name or ID. `X-Kernel-Project-Id` accepts only an ID. Send one header, not both: sending both returns `400 conflicting_project_headers`. Without either header or a project-scoped credential, reads and writes use your organization's **default project**.
```bash
curl https://api.onkernel.com/browsers \
-H "Authorization: Bearer $KERNEL_API_KEY" \
- -H "X-Kernel-Project-Id: proj_abc123"
+ -H "X-Kernel-Project: proj_abc123"
```
### Resolution rules
@@ -106,7 +106,7 @@ API keys can be **org-wide** or **project-scoped**.
- **Organization-scoped API keys** can reach resources across projects. If the key has a [policy](/info/api-key-permissions), its grants determine which actions and resources it can access. Include an `X-Kernel-Project-Id` header to select a project for a request.
- **Project-scoped API keys** can only access resources inside the project they were issued for. Create one from the **API Keys** page in the dashboard, the [CLI](/reference/cli/api-keys), an SDK, or the [API keys guide](/info/api-keys), and pass the target `project_id` when generating the key. Requests made with a scoped key are automatically limited to that project — no header required. If you do send an `X-Kernel-Project-Id` header and it conflicts with the key's project, the request is rejected with `403 Forbidden`.
-- **Most project administration requires an org-wide credential.** A project-scoped key may rename its own project, but cannot create, archive, restore, or delete projects, or change project limits. Policy-scoped keys additionally need `projects:read` to view the target project, `projects:write` to rename it or change its limits, and `projects:delete` to archive, restore, or delete it. An update that changes status along with other fields needs both `projects:write` and `projects:delete`. Creating a project requires `projects:create` on `organizations/{org_id}/*`; organization limits use `organizations:read` and `organizations:write`.
+- **Most project administration requires an org-wide credential.** A project-scoped key may rename its own project, but cannot create, archive, restore, or delete projects, or change project limits. See the [project permissions](/info/api-key-permissions#organizations-and-projects).
### OAuth
diff --git a/reference/cli/api-keys.mdx b/reference/cli/api-keys.mdx
index bdb93aed..e0ea39a8 100644
--- a/reference/cli/api-keys.mdx
+++ b/reference/cli/api-keys.mdx
@@ -47,7 +47,7 @@ kernel api-keys list --limit 20
| `--limit ` | Maximum number of results to return. |
| `--offset ` | Number of results to skip. |
| `--status ` | `active`, `expired`, `deleted`, or `all`. Use `--status all` instead of the deprecated list flag `--include-deleted`. |
-| `--name `, `--query ` | Match an exact name, or search by name, creator, project, ID, or masked key. |
+| `--name `, `--query ` | `--name` matches an exact name. `--query` searches names, creators, and projects; IDs and masked keys must match exactly. |
| `--project-id `, `--created-by ` | Filter by project (or `org` for organization-wide keys) or creator. |
| `--principal-type `, `--service-account-id ` | Filter by principal type (`user` or `service_account`) or service account. |
| `--sort-by `, `--sort-direction ` | Sort by `created_at`, `name`, `expires_at`, or `last_used_at`, in `asc` or `desc` order. |