Bot-Triggered Exposure

Let scripts, bots, and AI agents open and close tunnels programmatically via the REST API.

The idea

Sometimes you don't want a human to open a tunnel — you want automation to do it. A deploy bot, a monitoring script, or an AI agent decides when to expose a service and for how long.

API-driven tunnels

# Open a tunnel via API
curl -X PUT https://tunnel.nullbore.com/api/tunnels \
  -H "Authorization: Bearer nbk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"port": 3000, "name": "bot-service", "ttl": "1h"}'

# Close it when done
curl -X DELETE https://tunnel.nullbore.com/api/tunnels/bot-service \
  -H "Authorization: Bearer nbk_your_key"

Named tunnels (like bot-service) require a Dev plan ($7/mo) or higher. Free tier tunnels get a random slug.

ChatOps example

Build a Slack/Discord bot that responds to /expose 3000:

# Pseudocode — your bot handler
@bot.command("expose")
def expose(port):
    # Start local service if needed
    subprocess.run(["nullbore", "open", "--port", str(port), "--ttl", "30m"])
    return f"Tunnel open for 30 minutes"

AI agent integration

AI agents can use the NullBore API as a tool:

  • Expose a service when a user asks "let me access your dev server"
  • Set appropriate TTL based on the context
  • Close the tunnel when the task is complete
  • Report the URL back to the user

See the MCP Servers & AI Agents and OpenClaw integration docs for more details.

Security

  • API keys have tier limits — bots can't exceed your plan's tunnel count.
  • TTL is mandatory — every tunnel expires. Bots can't create permanent exposure by accident.
  • Audit trail — the dashboard shows who created each tunnel and when.