Skip to main content

Templates

An AgentTemplate is a named blueprint for creating agents. Its configuration — system prompt, default model, adapter set with per-adapter config, harness git ref, tool-call secret — is copied onto every new agent at creation time. Template edits don’t retroactively change existing agents; each agent keeps its own snapshot. Think of a template like a Docker image: you author it once and deploy as many agent instances as you need.

What’s in a Template?

FieldDescription
nameHuman-readable name (unique per organization)
descriptionOptional short summary
system_promptDefault instructions stamped onto new agents
default_modelDefault LLM model for new agents (e.g., claude-sonnet-4-5)
default_reasoning_effort'' (model default) / minimal / low / medium / high / xhigh / max
thinking_max_tokensMax output tokens per LLM call (overrides the effort-based default on Claude)
max_turnsMaximum iterations per run (default 50; 0 = unlimited)
harness_git_refBranch / tag / SHA of bedrock-harness to run. Blank = latest main.
agent_created_webhook_urlPOSTed with agent + contact details when a new agent auto-spawns from this template
tool_call_secretSent as X-Agent-Secret on external tool webhooks
The template also owns a set of AdapterConfig rows (one per enabled adapter) that define tool integrations.

Creating a Template

curl -X POST https://api.bedrock.orinlabs.org/api/templates/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Support Bot",
    "description": "Triage + reply to inbound customer questions",
    "system_prompt": "You are a helpful customer support agent for Acme Corp.",
    "default_model": "claude-sonnet-4-5",
    "max_turns": 50
  }'
Response:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization": "org-uuid",
  "name": "Customer Support Bot",
  "description": "Triage + reply to inbound customer questions",
  "system_prompt": "You are a helpful customer support agent for Acme Corp.",
  "default_model": "claude-sonnet-4-5",
  "default_reasoning_effort": "",
  "thinking_max_tokens": null,
  "max_turns": 50,
  "harness_git_ref": "",
  "agent_created_webhook_url": "",
  "tool_call_secret": "",
  "created_at": "2026-01-15T10:30:00Z"
}

LLM Provider Configuration

LLM provider keys live on the organization, not the template — every template in the org shares the same openai_api_key / anthropic_api_key:
curl -X PATCH https://api.bedrock.orinlabs.org/api/organizations/organizations/ORG_ID/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "openai_api_key": "sk-...",
    "anthropic_api_key": "sk-ant-..."
  }'
If unset, Bedrock falls back to the OPENAI_API_KEY / ANTHROPIC_API_KEY environment variables. See Organizations for details.

System Prompt

The template’s system_prompt is copied onto each new agent created from the template. Agents can override it with their own system_prompt for specialized behavior.
{
  "system_prompt": "You are an AI assistant for Acme Corp.\n\nKey responsibilities:\n- Answer customer questions about our products\n- Help troubleshoot common issues\n- Escalate complex problems to human support\n\nTone: Professional but friendly. Never make up information."
}
Template edits never retroactively change agents. Update the template first, then create a new agent (or manually update an existing one).

Attaching Adapters

Adapters are attached to a template via AdapterConfig rows. Each row couples an adapter to the configuration needed to use it (phone numbers, API keys, etc.).
curl -X POST https://api.bedrock.orinlabs.org/api/toolbox/adapter-configs/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "adapter": "SMS_ADAPTER_ID",
    "template": "TEMPLATE_ID",
    "config": { "phone_number": "+15551234567" }
  }'
The config payload is validated against the adapter’s config_schema. Adapters with no config (Contacts, Projects, Documents, Notifications) can be attached by creating an AdapterConfig with an empty config. See Adapters for per-adapter schemas.

Deploying Agents

Create agents against a template:
curl -X POST https://api.bedrock.orinlabs.org/api/cloud/agents/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alice'\''s Assistant",
    "template": "TEMPLATE_ID",
    "timezone": "America/New_York"
  }'
On creation, the agent:
  1. Copies system_prompt and default_model onto itself
  2. Adds every adapter referenced by the template’s AdapterConfig rows to its own adapters set
  3. Snapshots each AdapterConfig.config into a matching AgentAdapterConfig row
  4. Runs adapter-specific seed hooks (for example, Documents seeds curated “skill” documents onto the new agent)
From then on, the agent is self-contained — template edits don’t modify it.

Tool-Call Secret

The tool_call_secret is sent as the X-Agent-Secret header on every webhook tool call made by agents created from this template. Set it so your custom adapter handlers can verify requests came from Bedrock.
curl -X PATCH https://api.bedrock.orinlabs.org/api/templates/TEMPLATE_ID/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tool_call_secret": "a-strong-random-secret"}'
See Custom Adapters for how to verify the secret on your side.

Harness Git Ref

Every agent run spawns an isolated bedrock-harness subprocess pinned to the template’s harness_git_ref. Blank means latest main at dispatch time. Pin this when you want to freeze the runtime — for example, before a fleet-wide rollback:
curl -X PATCH https://api.bedrock.orinlabs.org/api/templates/TEMPLATE_ID/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"harness_git_ref": "v1.4.2"}'

Template → Agent Hierarchy

  • Organization
    • Template (blueprint)
      • Agents (snapshots of the template — memory, state, adapter configs are per-agent)

API Summary

MethodEndpointDescription
GET/api/templates/List templates
POST/api/templates/Create template
GET/api/templates/{id}/Get template
PUT / PATCH/api/templates/{id}/Update template
DELETE/api/templates/{id}/Delete template

Best Practices

One Template per Use Case

Create separate templates for each distinct agent archetype or environment.

Descriptive System Prompts

Write clear system prompts that define expected behavior.

Pin Harness on Rollback

Pin harness_git_ref to a known-good tag when stabilizing.

Configure Tool Secret

Set tool_call_secret if using webhook-based tools.