Dobby
Back to Blog
Developersdkexternal-agentsbyoa

Headless External Agent Management — One Surface, Four Ways

Register, trigger, schedule, and cost-track CrewAI / LangChain / custom AI agents from CI/CD, Terraform, or another AI agent. New in @dobbyai/sdk v0.2.0.

Gil KalApril 14, 20266 min read

When we shipped External Agent Management (BYOA) two weeks ago, the deal was simple: bring your CrewAI crew, n8n workflow, LangChain agent, or custom HTTP endpoint, register it once, and Dobby gives you scheduling, triggering, approvals, cost tracking, and an audit trail on top. The catch — every operation had to go through the dashboard. Click to register. Click to trigger. Click to schedule. Click to check costs.

That kept the feature firmly in the hands of humans. CI/CD pipelines, Terraform configs, and AI agents that wanted to manage other AI agents all hit the same wall. With v0.2.0 of @dobbyai/sdk and dobby-ai-sdk, every operation is now headless. Same surface, same auth, four equivalent ways to call it.

Four Surfaces, Identical Behavior

We built this with one rule: anything you can do in the UI, you can do programmatically. No second-class citizens. The four surfaces share the same gateway-key authentication, the same scopes (agents:read, agents:manage, agents:trigger), and the same per-tenant isolation model.

  • UI — clicking around dashboard.dobby-ai.com (best for ad-hoc ops, onboarding, visual monitoring)
  • SDK — JavaScript and Python (best for CI/CD, IaC, AI coordinators, scripts)
  • MCP — 12 tools exposed to Claude Desktop / Cline / any MCP client (best for chat-driven operations)
  • REST API — /api/v1/gateway/external-agents/* (best for non-SDK languages and custom tooling)

What Changed in v0.2.0

The agents resource on both SDKs picked up the full external-agent surface. Register, list, get, update, deregister. Trigger and retry. Trigger history with pagination. Schedule CRUD. Cost queries with daily breakdown. The methods mirror the API one-to-one — there is no abstraction layer to learn separately.

import { DobbyClient } from '@dobbyai/sdk';

const dobby = new DobbyClient({
  apiKey: process.env.DOBBY_API_KEY, // gk_svc_* with agents:* scope
});

// Register a CrewAI agent — gateway key returned ONCE
const { data } = await dobby.agents.register({
  display_name: 'Research Crew',
  framework: 'crewai',
  protocol: 'webhook',
  endpoint_url: 'https://app.crewai.com/api/v1/crews/abc/kickoff',
  capabilities: ['research', 'summarize'],
  auth_config: {
    method: 'api_key',
    header: 'Authorization',
    prefix: 'Bearer',
    key: process.env.CREWAI_KEY,
  },
});

const agentId = data.agent.agent_id;

// Fire it now
const result = await dobby.agents.trigger(agentId, {
  inputs: { topic: 'AI agent governance' },
});
console.log(result.data.trigger_id, result.data.status);

// Schedule it daily at 09:00
await dobby.agents.createSchedule(agentId, {
  name: 'Daily research',
  task_title: 'Research AI trends',
  schedule_config: { frequency: 'daily', time: '09:00' },
  trigger_payload: { topic: 'AI safety' },
});

// Check what it cost over the last week
const costs = await dobby.agents.getCosts(agentId, { days: 7 });
console.log(`Last 7 days: $${costs.data.cost_mtd_usd.toFixed(2)}`);

Same in Python

from dobby_sdk import DobbyClient
import os

with DobbyClient(api_key=os.environ['DOBBY_API_KEY']) as dobby:
    reg = dobby.agents.register(
        display_name='Research Crew',
        framework='crewai',
        protocol='webhook',
        endpoint_url='https://app.crewai.com/api/v1/crews/abc/kickoff',
        auth_config={
            'method': 'api_key',
            'header': 'Authorization',
            'prefix': 'Bearer',
            'key': os.environ['CREWAI_KEY'],
        },
    )
    agent_id = reg['data']['agent']['agent_id']

    # Trigger
    dobby.agents.trigger(agent_id, inputs={'topic': 'AI agent governance'})

    # Schedule
    dobby.agents.create_schedule(
        agent_id,
        name='Daily research',
        task_title='Research AI trends',
        schedule_config={'frequency': 'daily', 'time': '09:00'},
        trigger_payload={'topic': 'AI safety'},
    )

Why This Matters

Three patterns become possible the moment external-agent management is headless.

1. Infrastructure-as-Code

Your AI agent is a piece of infrastructure. It should live in your Terraform / Pulumi / SST repository alongside your databases and Cloud Run services. With the SDK, a deploy script can register a new agent on the first deploy, update its endpoint when the underlying service moves, and deregister it on tear-down. No human needs to remember to click anything.

2. AI Agents Managing AI Agents

A coordinator agent (built on Claude, GPT, or anything else) can now register subordinate agents on demand, fire them with computed inputs, watch their cost in real time, and pause them when budget approaches a limit. The coordinator gets the same gateway key the human would, scoped to agents:* — full control, full audit trail.

3. CI/CD Smoke Tests for Agents

Every PR that touches your agent code can register a temporary agent against the staging gateway, fire it with a known input, assert the response status, deregister, and report the result back to GitHub. No more shipping agent changes blind. The SDK's typed errors (DobbyAuthError, DobbyNotFoundError, DobbyBudgetExceededError) make these tests readable.

MCP Tools — Same Power, Conversational

If you operate from Claude Desktop or Cline rather than a script, the same operations live as 12 MCP tools: register_external_agent, list_external_agents, get_external_agent, update_external_agent, deregister_external_agent, trigger_external_agent, retry_external_agent_trigger, get_agent_triggers, create_agent_schedule, update_agent_schedule, delete_agent_schedule, and get_agent_costs. Read-only ones land in the MVP tier; manage and trigger ones in PRO.

The flow is exactly what you'd expect — "register a new CrewAI agent at this URL, then schedule it for 8am daily, then show me what it cost yesterday" — and Claude / Cline / your MCP client uses the tools to make it happen, with full audit logging of every action.

Breaking Change to Watch

v0.2.0 makes framework and protocol required on register. They were optional before with defaults of 'custom' and 'rest', which silently masked typos. If you have existing register() calls that omit them, add them explicitly — the migration is two extra lines and a clearer audit trail.

Get Started

  • Install: npm install @dobbyai/sdk OR pip install dobby-ai-sdk
  • Create a service gateway key at dobby-ai.com → Gateway → API Keys (use a gk_svc_* key with agents:* scope)
  • Run the quickstart in the SDK guide: dobby-ai.com/docs/sdk/external-agents
  • Optional: connect Claude Desktop or Cline to the MCP server for chat-driven ops
Anything you can do in the UI, you can do programmatically. No second-class citizens.

Ready to take control of your AI agents?

Start free with Dobby AI — connect, monitor, and govern agents from any framework.

Get Started Free
Headless External Agent Management — One Surface, Four Ways — Dobby AI Blog