Get the FREE Ultimate OpenClaw Setup Guide β†’
e

Confidant

Verified

@ericsantos

npx machina-cli add skill @ericsantos/confidant --openclaw
Files (1)
SKILL.md
6.2 KB

Confidant

Receive secrets from humans securely β€” no chat exposure, no copy-paste, no history leaks.

🚨 CRITICAL FLOW β€” Read This First

This is a human-in-the-loop process. You CANNOT retrieve the secret yourself.

  1. Run the script β†’ you get a secure URL
  2. SEND the URL to the user in chat ← THIS IS MANDATORY
  3. WAIT for the user to open the URL in their browser and submit the secret
  4. The script handles the rest (receives, saves to disk, confirms)
❌ 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

⚑ Quick Start

You need an API key from the user? One command:

{skill}/scripts/request-secret.sh --label "OpenAI API Key" --service openai

The script handles everything:

  • βœ… Starts server if not running (or reuses existing one)
  • βœ… Creates a secure request with web form
  • βœ… Detects existing tunnels (ngrok or localtunnel)
  • βœ… Returns the URL to share

If the user is remote (not on the same network), add --tunnel:

{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 β†’ done.

Scripts

request-secret.sh β€” Create a secure request (recommended)

# Save to ~/.config/<service>/api_key (convention)
{skill}/scripts/request-secret.sh --label "SerpAPI Key" --service serpapi

# Save to explicit path
{skill}/scripts/request-secret.sh --label "Token" --save ~/.credentials/token.txt

# Save + set env var
{skill}/scripts/request-secret.sh --label "API Key" --service openai --env OPENAI_API_KEY

# Just receive (no auto-save)
{skill}/scripts/request-secret.sh --label "Password"

# Remote user β€” start tunnel automatically
{skill}/scripts/request-secret.sh --label "Key" --service myapp --tunnel

# JSON output (for automation)
{skill}/scripts/request-secret.sh --label "Key" --service myapp --json
FlagDescription
--label <text>Description shown on the web form (required)
--service <name>Auto-save to ~/.config/<name>/api_key
--save <path>Auto-save to explicit file path
--env <varname>Set env var (requires --service or --save)
--tunnelStart localtunnel if no tunnel detected (for remote users)
--port <number>Server port (default: 3000)
--timeout <secs>Max wait for startup (default: 15)
--jsonOutput JSON instead of human-readable text

check-server.sh β€” Server diagnostics (no side effects)

{skill}/scripts/check-server.sh
{skill}/scripts/check-server.sh --json

Reports server status, port, PID, and tunnel state (ngrok or localtunnel).

Rules for Agents

  1. NEVER ask users to paste secrets in chat β€” always use this skill
  2. NEVER reveal received secrets in chat β€” not even partially
  3. NEVER curl the Confidant API directly β€” use the scripts
  4. NEVER kill an existing server to start a new one
  5. NEVER try to expose the port directly (public IP, firewall rules, etc.) β€” use --tunnel instead
  6. ALWAYS share the URL with the user in chat β€” this is the entire point of the tool
  7. ALWAYS wait for the user to submit β€” do not poll, do not retry, do not try to retrieve the secret yourself
  8. Use --tunnel when the user is remote (not on the same machine/network)
  9. Prefer --service for API keys β€” cleanest convention
  10. After receiving: confirm success, use the secret silently

Example Agent Conversation

This is what the interaction should look like:

User: Can you set up my OpenAI key?
Agent: I'll create a secure link for you to submit your API key safely.
       [runs: request-secret.sh --label "OpenAI API Key" --service openai --tunnel]
Agent: Here's your secure link β€” open it in your browser and paste your key:
       πŸ” https://gentle-pig-42.loca.lt/requests/abc123
       The link expires after you submit or after 24h.
User: Done, I submitted it.
Agent: βœ… Received and saved to ~/.config/openai/api_key. You're all set!

⚠️ Notice: the agent SENDS the URL and WAITS. It does NOT try to access the URL itself.

How It Works

  1. Script starts a Confidant server (or reuses existing one on port 3000)
  2. Creates a request with a unique ID and secure web form
  3. Optionally starts a localtunnel for public access (or detects existing ngrok/localtunnel)
  4. User opens the URL in their browser and submits the secret
  5. Secret is received, optionally saved to disk (chmod 600), then destroyed on server

Tunnel Options

ProviderAccount neededHow
localtunnel (default)No--tunnel flag or npx localtunnel --port 3000
ngrokYes (free tier)Auto-detected if running on same port

The script auto-detects both. If neither is running and --tunnel is passed, it starts localtunnel.

Advanced: Direct CLI Usage

For edge cases not covered by the scripts:

# Start server only
npx @aiconnect/confidant serve --port 3000 &

# Create request on running server
npx @aiconnect/confidant request --label "Key" --service myapp

# Submit a secret (agent-to-agent)
npx @aiconnect/confidant fill "<url>" --secret "<value>"

# Check a specific request
npx @aiconnect/confidant get <id>

⚠️ Only use direct CLI if the scripts don't cover your case.

Source

git clone https://clawhub.ai/ericsantos/confidantView on GitHub

Overview

Confidant enables secure collection of sensitive credentials without exposing them in chat. It uses a human-in-the-loop flow to generate a web form URL, have the user submit secrets there, and save them to config files, ensuring secrets aren’t pasted or exposed in chat.

How This Skill Works

Run the Confidant script to generate a secure URL, send that URL to the user in chat, and wait for them to submit the secret via the web form. The script then receives the secret, saves it to disk (e.g., ~/.config/<service>/api_key or a specified path), and confirms success. Never retrieve secrets yourself from chat or via API calls; use the provided web form flow.

When to Use It

  • When you need sensitive information from a user (API keys, passwords, tokens) and must avoid revealing secrets in chat
  • When you want credentials saved directly to a config file (e.g., ~/.config/<service>/api_key)
  • When onboarding secrets for a service remotely and you require a secure web form submission
  • When you need a human-in-the-loop process to prevent automated exposure of secrets
  • When you want automation-friendly output (e.g., JSON) for secret handling while maintaining security

Quick Start

  1. Step 1: Run {skill}/scripts/request-secret.sh --label "OpenAI API Key" --service openai
  2. Step 2: Share the returned URL with the user in chat
  3. Step 3: Wait for the user to submit the secret; the script saves it and confirms success

Best Practices

  • NEVER ask users to paste secrets in chat; always use Confidant
  • NEVER reveal received secrets in chat; keep them confidential
  • NEVER curl or fetch the secret URL yourself; rely on the user-submitted web form
  • NEVER proceed before confirming the secret has been received
  • For remote users, use --tunnel to expose the form securely and share the URL in chat

Example Use Cases

  • Collect an OpenAI API Key from a teammate and save it to ~/.config/openai/api_key
  • Store a service token by running the request-secret script and saving to a defined path
  • Onboard credentials for a remote user using a tunnel-enabled URL and confirm submission
  • Receive a password securely for a new service without sending it in chat
  • Use the JSON output mode for automated secret provisioning in scripts

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers β†—