This skill helps you set up and manage Kernel authenticated connections across services with automatic reauthentication and safe login flows.
npx playbooks add skill kernel/skills --skill kernel-auth
use a managed auth connection to acquire a reusable authenticated browser profile, or a vault credential to sign in from the agent's own browser, then continue the original website task with the browser-control method that fits it. this skill owns authentication and the handoff to an authenticated browser; it does not assume the task is qa.
make this decision before listing or creating managed-auth connections or vault credentials:
if a dedicated integration can complete the task, use it and do not continue with this skill. if the decision selects an authenticated browser path, choose managed auth or vault credentials below; authenticated browser tasks must still use one of them.
| | managed auth | vault credentials |
| --- | --- | --- |
| who runs the login | KERNEL, in its own temporary browser | the agent, in its current browser |
| result | a reusable authenticated profile | a signed-in task browser; save it to a profile if needed |
| recovery | health checks and eligible automatic reauthentication | the agent signs in again when needed |
| fits | unattended or recurring work on known sites | an end user who is present, or a login prompt mid-task |
use managed auth when KERNEL should own the login lifecycle; follow the workflow below. use vault credentials when the agent must sign in within its own browser session; follow [vault credentials](#vault-credentials). if an authenticated managed-auth profile already exists for the site, reuse it before creating a vault credential.
a managed-auth login runs in its own temporary browser. it does not take over or authenticate an existing task browser in place. if an ordinary browser encounters a login wall:
login to poll: another login call supersedes the current flow.flow_status=SUCCESS and status=AUTHENTICATED, create a new ordinary browser from the connection's saved profile, attach the existing browser-control stack to that new session, and resume the task. switch any live view to the new task browser.the original task browser's transient page state does not move into the managed-auth browser or the replacement profile-backed browser. preserve the target url and any task state needed to resume, and delete the old task browser when it is no longer needed.
AUTHENTICATED, create a browser from its profile and verify by loading the target page. do not keep using an unprofiled task browser. a stale status or redirect to login requires reauthentication.login once, expose the hosted url through the host's user-visible mid-turn message mechanism, and immediately wait for the login in the same turn. do not end the task or require the user to reply before waiting.flow_status=SUCCESS and status=AUTHENTICATED. if the flow expires, start a replacement flow, publish the new url mid-turn, and resume waiting.if KERNEL mcp tools are available, prefer their typed operations: list/create/login/wait with the managed-auth tool, create/delete with the browser tool, Playwright for dom-level control, and computer actions for os-level input. use the cli workflow below as the fallback or when cli-specific functionality is needed.
KERNEL_PROJECT once or pass global --project <id-or-name> to every command.check for an existing connection:
kernel auth connections list \
--domain example.com \
--profile-name example-main \
-o json
a connection requires a domain and profile name. KERNEL creates the profile automatically if it does not exist.
CONNECTION_ID=$(
kernel auth connections create \
--domain example.com \
--profile-name example-main \
-o json | jq -r '.id'
)
add only settings required by the site:
kernel auth connections create \
--domain example.com \
--profile-name example-main \
--login-url https://example.com/login \
--allowed-domain auth.example.com \
--credential-name example-credential \
--proxy-id prx_123 \
--health-check-interval 3600 \
--telemetry=console,network \
-o json
important creation behavior:
--allowed-domain for non-standard redirect domains. common sso provider domains are allowed automatically.--credential-name or --credential-provider, not both.--credential-provider <provider>, omit --credential-path to enable provider lookup by domain automatically. use --credential-path <path> to select a specific external item.--proxy-id over --proxy-name for a stable, unambiguous reference.--no-save-credentials disables this and usually prevents unattended reauthentication.a connection's domain and profile cannot be changed with update; create another connection when either must differ.
updates are partial except where noted:
kernel auth connections update "$CONNECTION_ID" \
--login-url https://example.com/sign-in \
--health-check-interval 3600 \
--save-credentials \
-o json
non-obvious update behavior:
--allowed-domain replaces the entire allowed-domain list; repeat it with every domain to retain.--login-url '' to clear a custom login url.--credential-provider <provider> and --credential-auto. unlike create, update does not infer auto lookup.--save-credentials or --no-save-credentials.inspect the result after every update:
kernel auth connections get "$CONNECTION_ID" -o json | jq '{
id,
domain,
profile_name,
status,
flow_status,
flow_step,
can_reauth,
can_reauth_reason,
health_checks,
health_check_interval,
browser_telemetry
}'
start a login or reauthentication flow with the existing connection:
kernel auth connections login "$CONNECTION_ID" -o json
the response tells you whether KERNEL started a LOGIN or REAUTH flow and includes hosted_url, live_view_url, and flow_expires_at. the live_view_url belongs to the managed-auth browser, not any ordinary browser that triggered the login. custom interfaces must keep the rendered live view and submitted interaction state bound to this active flow.
when a human must act, publish hosted_url as a user-visible mid-turn message such as:
> login is needed to continue: <hosted_url>. i will continue automatically when it completes.
keep the current turn active and begin following or waiting immediately after publishing the message. do not put the url only in the final response, ask the user to reply after login, or split the original task into a separate run. suppress link unfurls and do not expose the live-view or cdp url unless the intended user needs it.
track the flow until it reaches a terminal state:
kernel auth connections follow "$CONNECTION_ID"
with a typed tool that offers bounded long-polling, repeatedly call its wait action until success, failure, or expiry. preserve any returned flow checkpoint unchanged between calls. do not infer completion from a successful submit or one non-terminal wait response.
or poll the current state and canonical prompts:
kernel auth connections get "$CONNECTION_ID" -o json | jq '{
status,
flow_status,
flow_step,
flow_expires_at,
fields,
choices,
external_action_message,
website_error,
error_code,
error_message
}'
when flow_step is AWAITING_INPUT, prefer the canonical ids returned in fields and choices:
# Submit one or more fields as one submit mode.
kernel auth connections submit "$CONNECTION_ID" \
--field-value 'field_email=<value>' \
--field-value 'field_password=<value>'
# Or select exactly one returned choice.
kernel auth connections submit "$CONNECTION_ID" \
--choice-id 'choice_sms'
use exactly one submit mode per call. do not combine canonical fields, a canonical choice, or any legacy selector in the same call. --field is legacy; use --field-value when fields is present. legacy-only flows may still require one of:
kernel auth connections submit "$CONNECTION_ID" --mfa-option-id sms
kernel auth connections submit "$CONNECTION_ID" --sign-in-option-id '<id>'
kernel auth connections submit "$CONNECTION_ID" --sso-provider google
kernel auth connections submit "$CONNECTION_ID" --sso-button-selector '<xpath>'
a successful submit means the input was accepted for processing, not that authentication has completed. wait for flow_status=SUCCESS and status=AUTHENTICATED.
do not call login again while the current flow is non-terminal; use follow, wait, or get to observe progress. a new login supersedes the active flow and can invalidate input the user was about to submit. if a stale flow is past flow_expires_at, call login again to replace it. do not delete the connection or profile just to refresh an expired flow.
configure telemetry when creating a connection, updating defaults for future managed-auth sessions, or overriding one login:
# Reset to the default telemetry categories.
kernel auth connections update "$CONNECTION_ID" --telemetry=all
# Disable telemetry.
kernel auth connections update "$CONNECTION_ID" --telemetry=off
# Enable selected categories on future managed-auth sessions.
kernel auth connections update "$CONNECTION_ID" --telemetry=console,network,page
# Override only this login; the override merges onto the connection config.
kernel auth connections login "$CONNECTION_ID" --telemetry=screenshot,network
settable categories are console, network, page, interaction, control, connection, system, screenshot, and captcha. all means the default category set, not every category. a category list on create selects that list; on update it merges into the current selection. to remove selected categories, reset with off, then enable the desired set in a second update.
browser telemetry is opt-in and cannot backfill an earlier failure. connection telemetry applies only to managed-auth sessions, so enable telemetry again when creating every ordinary profile-backed browser. for authenticated work that the agent may need to monitor or diagnose, capture the site-facing categories from the start:
kernel browsers create \
--profile-name example-main \
--telemetry=console,network,page,interaction \
-o json
all means KERNEL's default operational set and omits the debug-critical console, network, and page categories. telemetry can contain sensitive site metadata; enable only what the task needs and do not paste raw events into chat or repositories. when a browser fails or behaves unexpectedly, load the debug-browser-session skill for event retrieval, category selection, telemetry gaps, and post-delete inspection.
do not infer reauthentication readiness from status alone:
kernel auth connections get "$CONNECTION_ID" -o json | jq '{
status,
can_reauth,
can_reauth_reason,
auto_reauth,
health_checks,
health_check_interval,
credential,
save_credentials
}'
automatic reauthentication requires scheduled health checks, automatic reauth enabled, and a feasible credential or recorded login plan. can_reauth=false means a human action is currently required; inspect can_reauth_reason rather than repeatedly restarting the flow. common blockers include no prior successful login, no credential, no viable plan, external action, or an unavailable totp/sms/email code.
for a connection in NEEDS_AUTH:
update when one is available.login on the existing connection.status=AUTHENTICATED and can_reauth=true.timeline events are ordered most recent first:
kernel auth connections timeline "$CONNECTION_ID"
kernel auth connections timeline "$CONNECTION_ID" --type reauth
kernel auth connections timeline "$CONNECTION_ID" --type health_check --page 1 --per-page 50
json output is an object containing events, page, per_page, and has_more:
kernel auth connections timeline "$CONNECTION_ID" -o json |
jq '.events[] | {timestamp, type, status, step, browser_session_id, error_code, error_message, website_error}'
use login events for human/initial attempts, reauth for automatic or subsequent authentication attempts, and health_check to see when session validity changed between AUTHENTICATED and NEEDS_AUTH.
create an ordinary browser from the authenticated profile with telemetry enabled. add stealth, a proxy, profile saving, or a longer timeout only when the site or task needs them:
kernel browsers create \
--profile-name example-main \
--start-url https://example.com/account \
--telemetry=console,network,page,interaction \
-o json
load the target page and verify authenticated state before doing consequential work. if the page redirects to login, reauthenticate the existing connection rather than creating another profile.
choose controls based on the task:
delete the temporary browser when finished. telemetry captured before deletion remains available for later inspection:
kernel browsers delete <browser-id-or-name>
rename or download profile state with the current profile commands:
kernel profiles update example-main --name example-primary -o json
PROFILE_DIR=$(mktemp -d)
kernel profiles download example-primary --to "$PROFILE_DIR" --format tar.zst
# Inspect locally; never commit the extracted state.
rm -rf "${PROFILE_DIR:?}"
--format accepts tar.zst (default) or tar; both are extracted into --to. if the profile has no saved data yet, download reports that it must first be used in a browser session.
deleting a connection terminates its workflow and cancels any in-progress login. it is separate from deleting the profile:
kernel auth connections delete "$CONNECTION_ID" # confirm interactively
kernel profiles delete example-main # only if its saved state is disposable
use --yes only in automation after verifying the exact connection id or profile name. never delete a reused authenticated profile as routine reauthentication recovery.
a vault holds one end user's credentials. name it after that user (for example user-123) and never mix unrelated users in one vault. vaults store credentials, not browser sessions: attach the vault when creating the browser, because the binding cannot change later. if the signed-in state must persist, also pass --save-changes with a per-user --profile-name that matches the vault's user (for example user-123). a shared profile would give other users one user's cookies.
every credential follows one of two paths. use these names with the user:
provider: "kernel"): the user enters values in a KERNEL-hosted forWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.