Give your agent a passport
Connect Claude Code, OpenClaw, Hermes, or anything that speaks HTTP. Your agent acts through Tunneler with a workspace API key, and every action still runs through guardrails, human approval, and the arm switch. Programmatic never means ungoverned.
1. Create an API key
In the dashboard, go to Settings → API keys → New key. Pick the scopes you want the agent to have and copy the key (it is shown only once).
| Scope | What it allows |
|---|---|
read | List and inspect identities, inbox, drafts, approvals, and the audit log. |
propose | Evaluate guardrails and save a governed draft. If a human is required, an approval is opened. |
execute | Run a draft. It sends only if the verdict allows (or it was approved) and external sends are armed. |
2. Connect Claude Code (MCP)
Tunneler ships an MCP server. Add it to Claude Code in one line:
claude mcp add tunneler \ -e TUNNELER_API_KEY=tnl_sk_your_key \ -e TUNNELER_API_URL=https://api.tunneler.ai \ -- npx tunneler-mcp
Self hosting? Point the URL at your API and run the built server directly:
# from the Tunneler repo, after `npm run build`
claude mcp add tunneler \
-e TUNNELER_API_KEY=tnl_sk_your_key \
-e TUNNELER_API_URL=http://localhost:8787 \
-- node dist/mcp/server.js
Claude Code now has these tools:
tunneler_statusWorkspace, plan, pending approvals, arm state.tunneler_list_identitiesYour owned, governed accounts.tunneler_check_inboxPull new replies, mentions and DMs.tunneler_list_inboxRead stored inbox items.tunneler_evaluateGet a verdict on an action without sending.tunneler_proposeDraft a reply; open an approval if needed.tunneler_create_postDraft a new top-level post (subreddit + title).tunneler_send_dmDraft a direct/private message to a user.tunneler_set_inbox_statusTriage an inbox item (replied, ignored, escalated…).tunneler_list_draftsList proposed actions awaiting execution.tunneler_executeRun a draft (dry run by default if not armed).tunneler_list_approvalsSee what is waiting on a human.tunneler_auditThe append-only action ledger.Replies, posts, DMs, votes and email all flow through the same govern → approve → execute → arm pipeline. Reddit (reply, post, DM, vote) and email (IMAP read + SMTP send) are supported today.
3. Or use the REST API
Any agent or script can call the API directly. Authenticate with the key as a bearer token.
# list your identities curl https://api.tunneler.ai/api/identities \ -H "Authorization: Bearer tnl_sk_your_key" # propose a reply (runs guardrails, may open an approval) curl -X POST https://api.tunneler.ai/api/actions/propose \ -H "Authorization: Bearer tnl_sk_your_key" \ -H "content-type: application/json" \ -d '{"identityId":"reddit-me","content":"Clearing the cache fixes that.","target":"t1_abc123"}' # execute the draft (dry run unless armed) curl -X POST https://api.tunneler.ai/api/actions/execute \ -H "Authorization: Bearer tnl_sk_your_key" \ -H "content-type: application/json" \ -d '{"draftId":"...","dryRun":true}' # read the append-only audit log (alias of /api/actions) curl "https://api.tunneler.ai/api/audit?limit=30" \ -H "Authorization: Bearer tnl_sk_your_key"
The governance contract
Whatever path your agent takes, the rules hold:
- Every proposed action gets a verdict: allow, approval_required, draft_only, or block.
- When the verdict is
approval_requiredorblock, the agent should stop and report it. A human approves in the dashboard. - Nothing is sent for real until you flip the arm switch, and even then risky actions still need approval.
- A key can never manage other keys, and scopes limit what it can do.