Content agent guide
Honeloop's content agent runs as an org-native principal inside a bounded Temporal workflow. It proposes drafts through the same policy gate as every external agent and holds no publish tool or platform credential.
The four-tool boundary#
The drafting loop exposes exactly four tools — three reads and one write. Code resolves the target channel, time slot, format and length band before the model runs; the model writes post text and a reviewer-visible rationale only.
| Tool | Kind | What it reads or writes |
|---|---|---|
read_brand_profile | Read | Current versioned brand profile (voice traits, topics, audience, example posts, phrases to avoid, allowed links and emails) plus active learned preferences (omitted on preference-holdout drafts). |
read_recent_posts | Read | Last 90 days of posts on the assigned channel with human decision outcomes (approved as written, edited, rejected, pending). |
read_calendar | Read | Scheduled and pending-approval posts across the planning horizon so new drafts avoid duplicate topics and respect spacing gaps. |
propose_draft | Write | Runs deterministic hard checks (character limits, link/mention/email allowlists, avoid phrases, 90-day near-duplicate Jaccard check, secret-prefix blocking across all 10 Honeloop prefixes and external credential patterns, no replies), then calls posts.create and posts.schedule through the gate with idempotency keys. |
The agent principal holds only four scopes: posts:read,posts:write, posts:publish and channels:read. It holds no approvals:decide, no policies:manage, nochannels:manage and no agent:* scopes. Even under a prompt injection, its proposals land in the approval queue under the workspace'sin_the_loop policy.
In-app AI copilot, URL-to-post extraction and live web research #
Alongside the autonomous background drafting workflow, signed-in editors and workspace callers can collaborate interactively through three kernel-governed tools.
In-app conversational AI copilot (/o/:orgId/copilot)
#
- Endpoints and streaming: Backed by
agent.copilot_chat,agent.copilot_list_threads,agent.copilot_get_threadandagent.copilot_delete_thread, with live Server-Sent Events atPOST /v2/agent/copilot_chat/stream(dispatched throughregistry.invoke("agent.copilot_chat")with a Stop control and disconnect-safe message and metering persistence). - Persistence and model routing: Conversations store per-principal in tenant-isolated PostgreSQL tables protected by forced row-level security (
copilot_threadsandcopilot_messages), running Anthropic primary with automatic OpenAI multi-LLM fallback. - 16 governed scope-gated tools: Reads (
list_channels,list_posts,query_analytics,suggest_slots,list_media,read_brand_profile,extract_url,research_topic,search_stock_media,list_autoposts,list_sets) and writes (create_draft,update_draft,schedule_draft,generate_image,generate_slideshow). - Limits and governance: Bounded to at most 6 turns, 6 tool calls per turn and 20 total tool calls per request, enforcing interactive AI rate limits (12/min per principal, 36/min per organisation), global daily spend caps and kill switches. Every write obeys the caller's scopes, autonomy policy gate (scheduling diverts under
in_the_loop) and prepaid credit balance; the copilot never approves requests or modifies governance policies.
URL extraction and live web research #
- SSRF-hardened URL-to-post extractor (
agent.extract_url):Fetches a public HTTPS page throughsafeFetchwith manual HTTPS-only redirect validation and linear-time HTML stripping, then drafts channel-ready copy in the workspace brand voice directly from the page content. - Live web research (
agent.research_topic):Queries a configured web-research provider (Tavily, Brave or Exa) strictly throughsafeFetch, validates returned source links and feeds grounded findings into both/copilotand the Composer URL and research import drawer.
Brand voice profile and inspectable learning #
Humans own the brand voice profile viaagent.profile_update(or the Brand voice screen). Every approval, edit-then-approve and rejection with feedback records normalised edit distance (below 0.03 counts as accepted as written) and feeds daily preference consolidation:
- Code decides activation, never the model alone: a candidate preference activates only with support from at least 3 distinct posts in 60 days (or 2 rejections), zero contradictions in that window and zero conflict with human-written avoid phrases or topics.
- Bounded and reversible: at most 20 active learned preferences per organisation. Unused preferences decay after 120 days. Every preference shows its reason and source posts in
agent.insights_getand can be reverted viaagent.preference_revert(tombstoned for 90 days unless 6 distinct posts support it again). - Human rules win: human-authored profile fields always outrank learned preferences.
- Inline compose assistant:
agent.assist_compose(available in the web Composer drawer, REST v2,@honeloop/sdk,hl assistand MCPassist_compose) rewrites, shortens, expands, hooks, threadifies, shifts tone or translates draft copy using the workspace brand voice. It returns suggested parts only and never creates, updates or publishes a post on its own.
Standing holdout and honest measurement #
Individual accounts produce too few posts to claim effects from raw averages. Honeloop assigns deterministic, hash-bucketed experiment arms on every draft so measurement stays unconfounded:
- Posting time and format arms: 15 percent standing
holdout(owner windows, no pooled statistics), 20 percent randomisedexploreand 65 percentrecommend(falls back to holdout until pooled statistics qualify). - Learned-preference holdout: 10 percent of drafts run without learned preferences so you can compare as-written approval rates with and without them.
- Privacy and publication thresholds: pooled cells hold coarse aggregates only — never raw tenant text — and publish only with at least 10 accounts and 60 posts per cell. Public performance summaries require at least 30 accounts, 600 posts and a 95 percent confidence interval excluding zero; below threshold, Insights reports "Insufficient data".
- Platform-specific analytics rules: LinkedIn outcomes are marked
display_onlyunder the LinkedIn Developer AI Policy and excluded from pooling and prompts. X analytics reads are metered pass-through calls bounded by the workspace monthly X spend cap.
Budgets, caps and kill switches #
| Guardrail | Default | Behaviour when reached |
|---|---|---|
| Model calls per draft | 8 (typical 3) | Loop ends draft with status step_limit. |
| Drafts per run | 3 (configurable 1 to 5) | Planner caps assignments before any model call. |
| Pending approval queue throttle | 6 waiting proposals (or oldest > 5 days) | Planner skips drafting so unanswered queues never flood. |
Manual runs (agent.run_now) | 6 per org per day | Refused with 429 rate_limited. |
| Monthly org model budget | $10 (10,000,000 micro-USD) | Checked before every model call; aborts with budget_exceeded. |
Workspace disable (agent.disable) | Any agent:manage holder | Pauses org agent schedules, cancels open runs and stops at the next model call. |
| Operator kill switch | Host CLI (honeloop agent kill) | Immediately blocks per-org or deployment-wide model calls; only kill --undo can lift it. |
Operator commands (honeloop CLI)
# Enable the content agent for an organisation (requires an org-level policy row) honeloop agent enable --org 0197e3a0-0000-7000-8000-0000000000a1 # Sync committed prompt versions and global schedules at deploy time honeloop agent sync-prompts honeloop agent sync-config # Emergency stop: pauses schedules and aborts mid-run at the next model call honeloop agent kill --org 0197e3a0-0000-7000-8000-0000000000a1 honeloop agent kill --all # Lift a kill (the only path that clears an operator kill; agent.enable never lifts it) honeloop agent kill --org 0197e3a0-0000-7000-8000-0000000000a1 --undo # Rotate the agent's encrypted OAuth 2.1 client credentials (revokes every prior token immediately) honeloop agent rotate-key --org 0197e3a0-0000-7000-8000-0000000000a1
Workspace agent commands (hl CLI)
# Inspect status, read or update the brand voice profile, trigger a run or refine copy inline
hl agent status
hl agent profile get --include-learned
hl agent profile set --base-version 1 --data @brand-voice.json
hl agent run --max-drafts 2
hl assist --action shorten --provider bluesky --tone concise --text "Draft release notes to tighten."
# Extract a public HTTPS page into a draft or run grounded live web research
hl call agent.extract_url --data '{"url":"https://docs.honeloop.example/changelog"}'
hl call agent.research_topic --data '{"topic":"open-protocol social publishing standards"}'