agent-web-identity
БесплатноБез исполняемых скриптовНе проверенLets an AI agent or CLI session sign in to Internet Identity and act as a user's app-specific principal (e.g. for oisy.com or nns.ic0.app) via `icp identity…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
Agent Web Identity Sign-In
What This Is
Internet Identity (II) supports a CLI-auth flow that issues a delegation for a
session key held outside the browser. icp identity link web uses it to let
a terminal session — including an AI agent such as Claude Code — sign canister
calls as the user's app-specific principal: the same principal the user has
when signed in to that app's web UI (selected with --app <domain>).
The user still authenticates interactively in their own browser with their passkey; the agent only ends up holding a time-limited delegation. The private key of the user's II identity is never exposed.
Prerequisites
icpCLI installed (https://cli.internetcomputer.org). See theicp-cliskill for general usage.- The user must have an Internet Identity (id.ai) and be present to complete the browser sign-in.
- First-time use requires the user to enable the CLI access toggle for their identity in II settings (see Pitfall 1).
- The agent and the user's browser must be on the same machine: the flow delivers the delegation via a localhost callback. It does not work from remote/headless environments (containers, CI, web sessions).
Common Pitfalls
First-time sign-in fails with a "CLI access disabled" screen. This is the expected first-run path, not an error. Tell the user to enable CLI access for their identity in II settings, then restart the flow from scratch — the previous sign-in URL is single-use (its nonce and localhost listener are dead). Plan for two rounds on first use.
The link command waits for an Enter keypress before doing anything. On 0.3.x it first prints
Press Enter to log in at https://id.ai/cliand blocks reading stdin; only after that does it start the flow and try to open the browser. In a background or non-interactive run, pipe an actual newline into it (printf '\n' | icp identity link web ...). Do NOT redirect from/dev/null: a bare EOF does not satisfy the prompt on 0.3.2 — the command sits onPress Enter to log inand never starts the flow, so you waste the first attempt and have to restart, prompting the user twice. Feed the newline on the first try and the flow starts immediately.Don't assume the browser opened. Sandboxed or non-interactive shells often can't launch a GUI browser. Read the command's output: if a full sign-in URL is printed, show it to the user to open themselves. If the output shows neither a browser launch nor a URL, report that — do not construct a URL by guessing, and ask the user whether a browser window appeared.
The command blocks until sign-in completes and gets killed by tool timeouts. Run
icp identity link webas a background task, then wait for the user to confirm they finished signing in before checking the result. The command must also be able to bind a localhost port; if a sandbox blocks this, ask the user before rerunning unsandboxed.Relying on the default identity signs with the wrong principal. Every
icpcommand acting as the user must pass--identity <NAME>explicitly. Never depend on project or global default identity settings, and never change them.Reusing or overwriting identities. Never reuse an existing identity, even if
icp identity listalready shows one linked for the same app — its delegation may be expired and it belongs to whoever created it. Always create a fresh identity per session: checkicp identity list, then pick a unique name prefixed with the agent's own identifier,<agent>-<app>-<YYYYMMDD-HHMM>— e.g.claude-oisy-20260611-1530for Claude,cursor-oisy-...for Cursor; useagent-if no identifier is known. Never overwrite an existing identity.icp identity listis read-only context for picking a free name — never delete, rename, reauth, or otherwise modify any identity you did not create this session, even ones with the agent's own prefix left over from a previous run. Operate only on$NAME. Why per-session and not one reused identity per app:--appderives the same app principal for a given II identity, so a fresh identity grants no extra authority isolation — the point is provenance and blast radius. A per-session identity keepsicp identity listauditable (which session created which live delegation), lets cleanup delete exactly that one, and avoids a shared identity where another session'sreauthsilently mutates a delegation this session is mid-task with.When scanning
icp identity listto pick a name, if you see multiple stale agent-prefixed identities for the same app from past sessions (e.g. severalclaude-oisy-*entries), offer to clean them up before proceeding: present the list, wait for the user to confirm each one, then delete them withicp identity delete <NAME>. Never delete without explicit confirmation.**Wrong p
Установить agent-web-identity в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл agent-web-identity?
Lets an AI agent or CLI session sign in to Internet Identity and act as a user's app-specific principal (e.g. for oisy.com or nns.ic0.app) via `icp identity link web`. Use when the user asks an agent to log in to an II-powered app, obtain a delegation, or make authorized canister calls on their behalf. Do NOT use for adding II sign-in to a frontend — use the user-sign-in skill instead.
Как установить скилл agent-web-identity?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agent-web-identity запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic