AI 代理的安全秘密移交和凭证设置向导。当您需要用户的敏感信息(API 密钥、密码、令牌)或需要...时使用
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install confidant或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install confidant⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/confidant/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: confidant description: Secure secret handoff and credential setup wizard for AI agents. Use when you need sensitive information from the user (API keys, passwords, tokens) or need to save credentials to config files. Never ask for secrets via chat — use Confidant instead. homepage: https://github.com/aiconnect-cloud/confidant user-invocable: true disable-model-invocation: false metadata: { 'openclaw': { 'emoji': '🔐', 'requires': { 'bins': ['curl', 'jq', 'npm'] }, 'files': ['scripts/*'] } } ---
Receive secrets from humans securely — no chat exposure, no copy-paste, no history leaks.
This is a human-in-the-loop process. You CANNOT retrieve the secret yourself.
❌ DO NOT curl/fetch the secret URL yourself — it's a web form for humans
❌ DO NOT skip sharing the URL — the user MUST receive it in chat
❌ DO NOT poll the API to check if the secret arrived — the script does this
❌ DO NOT proceed without confirming the secret was received
✅ Share URL → Wait → Confirm success → Use the secret silently
Run this once to install the CLI globally (avoids slow npx calls):
bash {skill}/scripts/setup.sh
> {skill} is the absolute path to the directory containing this SKILL.md file. Agents can resolve it at runtime: > > ```bash > SKILL_DIR=$(find "$HOME" -name "SKILL.md" -path "/confidant/skill" -exec dirname {} \; 2>/dev/null | head -1) > # Then use: bash "$SKILL_DIR/scripts/setup.sh" > ```
You need an API key from the user? One command:
bash {skill}/scripts/request-secret.sh --label "OpenAI API Key" --service openai
The script handles everything:
~/.config/openai/api_key (chmod 600) and exitsIf the user is remote (not on the same network), add --tunnel:
bash {skill}/scripts/request-secret.sh --label "OpenAI API Key" --service openai --tunnel
This starts a localtunnel automatically (no account needed) and returns a public URL.
Output example:
🔐 Secure link created!
URL: https://gentle-pig-42.loca.lt/requests/abc123
(tunnel: localtunnel | local: http://localhost:3000/requests/abc123)
Save to: ~/.config/openai/api_key
Share the URL above with the user. Secret expires after submission or 24h.
Share the URL → user opens it → submits the secret → script saves to disk → done.
Without --service or --save, the script still polls and prints the secret to stdout (useful for piping or manual inspection).
request-secret.sh — Request, receive, and save a secret (recommended)# Save to ~/.config/<service>/api_key (convention)
bash {skill}/scripts/request-secret.sh --label "SerpAPI Key" --service serpapi
# Save to explicit path
bash {skill}/scripts/request-secret.sh --label "Token" --save ~/.credentials/token.txt
# Save + set env var
bash {skill}/scripts/request-secret.sh --label "API Key" --service openai --env OPENAI_API_KEY
# Just receive (no auto-save)
bash {skill}/scripts/request-secret.sh --label "Password"
# Remote user — start tunnel automatically
bash {skill}/scripts/request-secret.sh --label "Key" --service myapp --tunnel
# JSON output (for automation)
bash {skill}/scripts/request-secret.sh --label "Key" --service myapp --json
| Flag | Description | | ------------------ | ---------------------------------------------------------- | | --label | Description shown on the web form (required) | | --service | Auto-save to ~/.config/ | | --save | Auto-save to explicit file path | | --env | Set env var (requires --service or --save) | | --tunnel | Start localtunnel if no tunnel detected (for remote users) | | --port | Server port (default: 3000) | | --timeout | Max wait for startup (default: 30) | | --json | Output JSON instead of human-readable text |
check-server.sh — Server diagnostics (no side effects)bash {skill}/scripts/check-server.sh
bash {skill}/scripts/check-server.sh --json
Reports server status, port, PID, and tunnel state (ngrok or localtunnel).
The request-secret.sh script blocks until the secret is submitted (it polls continuously). Most agent runtimes (including OpenClaw's exec tool) impose execution timeouts that will kill the process before the user has time to submit.
Always run Confidant inside a tmux session:
# 1. Start server in tmux
tmux new-session -d -s confidant
tmux send-keys -t confidant "confidant serve --port 3000" Enter
# 2. Create request in a second tmux window
tmux new-window -t confidant -n request
tmux send-keys -t confidant:request "confidant request --label 'API Key' --service openai" Enter
# 3. Share the URL with the user (read from tmux output)
tmux capture-pane -p -t confidant:request -S -30
# 4. After user submits, check the result
tmux capture-pane -p -t confidant:request -S -10
> Why not exec? Agent runtimes typically kill processes after 30-60s. Since the script waits for human input (which can take minutes), it gets SIGKILL before completion. tmux keeps the process alive independently.
If your agent platform supports long-running background processes without timeouts, exec with request-secret.sh works fine. But when in doubt, use tmux.
curl the Confidant API directly — use the scripts--tunnel instead--tunnel when the user is remote (not on the same machine/network)--service for API keys — cleanest conventionAgents can branch on exit codes for programmatic error handling:
| Code | Constant | Meaning | | ---- | --------------------------------- | -------------------------------------------------------------- | | 0 | — | Success — secret received (saved to disk or printed to stdout) | | 1 | MISSING_LABEL | --label flag not provided | | 2 | MISSING_DEPENDENCY | curl, jq, npm, or confidant not installed | | 3 | SERVER_TIMEOUT / SERVER_CRASH | Server failed to start or died during startup | | 4 | REQUEST_FAILED | API returned empty URL — request not created | | ≠0 | (from CLI) | confidant request --poll failed (expired, not found, etc.) |
...
安装 知己 后,可以对 AI 说这些话来触发它
Help me get started with Confidant
Explains what Confidant does, walks through the setup, and runs a quick demo based on your current project
Use Confidant to secure secret handoff and credential setup wizard for AI agents
Invokes Confidant with the right parameters and returns the result directly in the conversation
What can I do with Confidant in my developer & devops workflow?
Lists the top use cases for Confidant, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/confidant/ 目录(个人级,所有项目可用),或 .claude/skills/confidant/(项目级)。重启 AI 客户端后,用 /confidant 主动调用,或让 AI 根据上下文自动发现并使用。
知己 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
知己 可免费安装使用。请查阅仓库了解许可证信息。
AI 代理的安全秘密移交和凭证设置向导。当您需要用户的敏感信息(API 密钥、密码、令牌)或需要...时使用
知己 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Confidant
Identifies repetitive steps in your workflow and sets up Confidant to handle them automatically