CloudSwarm · docs · agent authoring

Author a custom agent.

You want something no template covers. This page walks through the authoring flow: composing skills, wiring credentials, defining a cadence, writing a policy.

What an agent is

A CloudSwarm agent is a named, versioned unit that combines: a plan (written in plain English), a skill bundle, a policy envelope, a trigger, a trust tier, and a budget. Every agent runs inside the R1 runtime; the runtime is what makes the agent reliable across retries, timeouts, and partial failures.

Five things to decide before you build

Compose skills

Open the agent builder. The left panel is the skills catalog; the center panel is your agent's flow; the right panel is configuration.

Set credentials

Credentials are per-skill, per-agent. If two agents both use Gmail, each gets its own credential handle; revoking one does not affect the other. The vault is append-only and rotates short-lived tokens automatically.

Define cadence

Three trigger shapes:

Write policy

Every agent inherits its workspace's policy envelope; you can narrow further on the agent. Policies are in Cedar. A minimal agent-level policy might look like:

permit (
  principal == Agent::"shopify-review-responder",
  action    == Action::"email:send",
  resource  in  List::"customer-contacts"
);

forbid (
  principal == Agent::"shopify-review-responder",
  action    == Action::"payment:charge"
);

Policy is a ceiling, not a floor. The agent cannot do anything the policy doesn't permit, regardless of what the plan says.

Choose a trust tier

New agents start at L0 or L1. Read the trust model for the full tier ladder. Most custom agents stay at L1 for a week of supervised runs before promotion to L2 or L3.

Worked example: Shopify review responder

Goal. Watch Shopify reviews. Pull Apollo context for the reviewer. Draft a reply. Send after human approval.

Trigger. Event: Shopify webhook on reviews.create, filtered to reviews with star < 4.

Skills, in order:

  • Shopify · review read (inputs: review id; outputs: review body, author, product).
  • Apollo · contact enrichment (inputs: author email; outputs: company, role, last seen).
  • DeepTap · KB search (inputs: product SKU; outputs: matching FAQ or policy).
  • Actium · copywriting (inputs: review, enrichment, policy; outputs: draft reply in brand voice).
  • Veritize · fact-check (inputs: draft + citations; outputs: verified draft or flagged claims).
  • Core · approval (inputs: verified draft; outputs: approved text or rejection).
  • Shopify · review reply (inputs: approved text; outputs: posted reply, audit stamp).

Policy. Permit reply on reviews where star < 4; forbid any reply outside the product's own review stream; forbid any customer-PII in the reply body.

Budget. $0.40 per run ceiling. Weekly cap $40.

Trust tier. Starts L1. Promote to L2 after 20 clean runs.

Test and ship

Cedar policy reference Browse skills Trust model