Managing Agent Fleets
When you have many AI agents — from CI bots to coding assistants to autonomous workflows — you need patterns that scale. This guide covers enrollment, vault architecture, policy design, sharing, and monitoring for fleets of 10 to 1,000+ agents.
Enrollment at scale
Self-enrollment pattern
Agents self-enroll via POST /v1/agents/enroll. Use human_email when the ops contact already has a 1Claw account, or name only to get an approval_url for the human to open while signed in:
import { AgentsResource } from "@1claw/sdk";
await AgentsResource.enroll("https://api.1claw.co", {
name: `worker-${process.env.HOSTNAME}`,
human_email: "ops@mycompany.com",
});
Rate limits to be aware of:
- One enrollment per email per 10 minutes (per-email cooldown, when email is used).
- Global cap on non-expired link-only pending enrollments.
- IP rate limiting: 5-burst, 1/sec.
For bulk provisioning (e.g. deploying 50 agents simultaneously), stagger enrollment requests or use the authenticated POST /v1/agents endpoint with a human API key.
Batch provisioning with the SDK
When a human is provisioning many agents at once:
import { createClient } from "@1claw/sdk";
const client = createClient({
baseUrl: "https://api.1claw.co",
apiKey: process.env.ONECLAW_API_KEY,
});
const agents = ["worker-1", "worker-2", "worker-3", "scanner-a", "scanner-b"];
for (const name of agents) {
const { data } = await client.agents.create({
name,
description: `Fleet agent: ${name}`,
});
console.log(`${name}: ID=${data.agent.id} KEY=${data.api_key}`);
// Store each key securely in your deployment system
}
CLI batch provisioning
for name in worker-1 worker-2 worker-3; do
1claw agent create "$name"
done