360 Secure SkillHub
360 安全技能中心

credentials

该 Skill 在 MCP 或浏览器登录任务触发时暂停常规流程,引导用户通过真实浏览器、终端环境变量或本地加密保险库提供凭据;模型只使用服务名、配置档 ID 或环境变量名,不读取、打印或记录密码,并在泄漏时立即脱敏。运行依赖 webrain 二进制、浏览器引擎以及支持 MCP 的客户端或 webrain CLI。

分类:安全
prokopis3
prokopis3
热度 9.45
最近更新 2026-11-29 07:31:04

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add prokopis3/credentials
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
credentials
description
Secure credential handoff for any MCP-server task. Use automatically when a task prompt mentions login, credentials, password, sign in, log in, auth, or token (e.g. "login to instagram with credentials then scrape posts"). The rule: secrets NEVER pass through the model — have the user type them into a terminal or headed browser, set env vars, or store them in the local vault; reference them without ever seeing, printing, or logging the values.
license
MIT
compatibility
Requires the webrain binary on the host plus an MCP-capable client (or the webrain CLI); browser engines are installed by `webrain install` and need network access on first run.
metadata
{"argument-hint":"The task that needs credentials (e.g. login to instagram and scrape 20 posts)"}

/credentials — never see the secret

Any task mentioning login / credentials / password / sign-in / token fires this. Secrets never pass through the model. Anything asked in chat round-trips through the LLM and lands in session logs — so never ask in chat.

Protocol (stop, pick ONE channel)

  1. Detect login/creds intent in the task. Pause the happy path.
  2. Tell the user which channel to use. Never request the value in chat (no vscode_askQuestions, no "please provide your password").
  3. Use the value, never print it; redact it if it ever shows up in args/output.

Channel A — user types into the real browser (preferred, mcp_webrain-*)

webrain launch <service> <profile> <url> — real Chrome opens headed on a persistent profile, the user types the creds into the site's login window, the session is saved to the profile, and webrain re-attaches to the same CDP session. You get the authenticated session, never the password.

Channel B — env vars (no browser, or --creds)

User sets the secret in the terminal (never in chat):

$env:WEBRAIN_USER = "..."                        # typed by user
$env:WEBRAIN_PASS = Read-Host "password"         # typed by user

Then webrain login <service> <profile> (or webrain_session(op=login)) reads them by name — never inline the values, never echo them.

Channel C — local vault (fully automatic, preferred for repeat logins)

One-time enroll, then the LLM logs in with zero user typing:

webrain vault set <service> <profile> --username <user>   # hidden prompt, once
  • webrain_session(op="profiles") → returns ids/usernames only — never secrets.
  • webrain_session(op="login", service=…, profile=…, url=…) → the server decrypts in-process and fills the browser via CDP (selector overrides optional); the reply is status-only. The value never leaves the server process.
  • Storage: ~/.config/webrain/vault.json (AES-256-GCM) + vault.key (0600). Two files — copy both to any Windows/macOS/Linux/Docker box, no OS daemon.

Rules

  • Never call any chat/ask tool for a secret value; the answer is logged.
  • Never paste a credential into a command, tool arg, or file visible in the conversation.
  • Never pass a secret as a tool argument — pass a vault reference (profile id) and let the server resolve it.
  • Redact immediately if a credential appears in output.
  • Same rule for every MCP server (webrain, codebase-memo, …), not just webrain.