Repository navigation
Document expanded scoped API key permissions - #751
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
…d-key-docs # Conflicts: # info/api-keys.mdx
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 37f82be. Configure here.
rgarcia
left a comment
There was a problem hiding this comment.
approving — the content checks out against the API: all 84 action names match action.go, the TS/Python pairs grant identical statements, and the CLI flags match v0.54.0. most of what's below is about tightening and de-duplicating. #5749 merged today, so this is ready to publish once it's deployed.
Questions / correctness
info/api-keys.mdx:319— the default runtime grant is project-wideinvocations:write, so any app's run can overwrite or attach browsers to any invocation in the project. consider telling readers to put mutually untrusted apps in separate projects (and maybe a kernel/kernel follow-up to scope the grant to the deployment's own invocations)info/api-key-policy-examples.mdx:99— the API rejects an OTLP destination when telemetry capture is off. consider showing the fulltelemetryobject or noting that capture must be on, so a copy-paste doesn't 400apps/deploy.mdx:50—kernel deploywith a scoped key yields a callback-only app whose browser calls 403 at runtime. consider spelling out that outcome and the fix (deploy through the API withruntime_policy, or an unrestricted key)info/projects.mdx:28— two project headers but no guidance on which to use. consider recommendingX-Kernel-Projectand noting that sending both returns400 conflicting_project_headersinfo/api-key-permissions.mdx:31— bare{kind}/{id}for project resources resolves against the request's project. consider saying outright to preferprojects/{project_id}/{kind}/{id}and keep{kind}/{id}for org-owned resources- follow-up, not this PR: the
OTLPDestinationRefdescription in kernel/kernelopenapi.yamlstill says project keys can select any org destination, which contradicts the project-scoped selection documented here
Terminology (per the "apps have runtime policies" feedback)
info/api-key-permissions.mdx:186,300— "runtime-key requirements" / "shared runtime keys". consider pointing to the runtime policy, and moving the legacy shared-key caveat into the "Existing deployments" noteinfo/authentication.mdx:37— consider "the app's runtime policy" as the link text instead of "the API key"
Structure / readability
info/api-keys.mdx:397— the "Existing deployments" paragraph packs ~6 rules together. pull the gotcha into a callout: an app deployed with an unrestricted key and noruntime_policycan't be invoked by any scoped keyinfo/api-key-permissions.mdx:286— the auth-connection row has 4 sentences and 7 actions in one cell. consider base requirements in the table plus a short "add when…" listinfo/api-key-policy-examples.mdx:246-270— the keys/audit example also bundlesconfig_registry:readand its header caveat. consider moving it to its own example or dropping itinfo/api-key-policy-examples.mdx:166-198— consider leading with the split deployer/invoker pattern and showing the combined key as the shortcutinfo/projects.mdx:109— the per-permission bullet duplicates the reference table. consider linking to it instead
Duplication
- the issuer-expiry rule appears at
info/api-keys.mdx:171,189,193,548,631andinfo/api-key-permissions.mdx:233,240,303. consider stating it once in#delegate-a-narrower-keyand linking to it everywhere else - the "omit
runtime_policy→ only project-wideinvocations:write" rule appears inapi-keys.mdx,deploy.mdx, andapi-key-policy-examples.mdx:197,201,243. consider stating it once per page at most
Nits
info/api-keys.mdx:631— the new 400 row drops thesource_iprules (CIDR only, no host bits, no IPv4-in-IPv6). consider keeping theminfo/api-key-policy-examples.mdx:51,109—extensions:read/browser_pools:readaren't needed to attach an extension or acquire from a pool. consider dropping them or marking them optional, given "keep only the permissions you need"info/api-key-permissions.mdx:94,173,183—projects:create/tasks:createstill say where to grant, which the other create rows dropped, anddeployments:createdescribes the action combination. consider making these consistentreference/cli/api-keys.mdx:50—--querymatches IDs and masked keys only by exact value, per the CLI help

Summary
Expand the scoping reference to cover the public API permissions and add paired TypeScript and Python policies for common workloads. Document which actions must be granted together and when callers need access to resources referenced by another object.
api_keys:write) from replacing its policy and IP conditions in place (api_keys:set_policy). Cover delegation, expiry, rotation and revocation without changing the workload identity guidance.Publishing
Merge these docs only after kernel/kernel#5724 and kernel/kernel#5749 (action wildcards) have deployed to production. They describe scoped deployments without a rollout flag; unrestricted callers that omit
runtime_policystill use shared keys.Experimental validation
Ran in production with short-lived, policy-scoped project keys; each check used narrower keys to confirm omitted actions return
403.runtime_policy; two invocations read their own invocation with the injected credential. Invoking without covering the runtime policy returned403.400), and deletion.Validation
mint validateandmint broken-linkspassed at734927d.Note
Low Risk
Documentation-only changes with no runtime code; risk is limited to doc accuracy and publishing timing relative to dependent API deploys noted in the PR.
Overview
This PR expands Kernel docs for scoped API keys: a new API Key Policy Examples page, a greatly enlarged Scoping Permissions reference (selectors, action wildcards, per-resource actions, and multi-action prerequisites), and major rewrites of API Keys, deploy, telemetry export, projects, authentication, and CLI references.
API keys and apps: Documentation now separates org/project boundary from optional policies, covers delegation (
api_keys:create,issue_beyond_expiry,set_policy, rotation rules), and replaces the old deployment-key model with app runtime policy (runtime_policyonPOST /deployments, default callback-only access for scoped deployers, per-invocation injected keys, and shared-key legacy behavior). Deploy docs call out CLI limits when using scoped keys.Cross-cutting updates: Telemetry export and projects pages document org vs project credentials, policy actions for destinations, and
X-Kernel-Project(name or ID). CLI api-keys commands document--policy, filters, and policy updates;docs.jsonadds the examples page to the nav.Reviewed by Cursor Bugbot for commit 5dcfaba. Bugbot is set up for automated code reviews on this repo. Configure here.