Skip to content

Autopilot Mode

Autopilot mode enables agents to operate autonomously as a self-running company. Agents propose work, the system enforces resource constraints (cap gates), approved proposals become executable missions, and events trigger new proposals — creating a closed-loop cycle with no human intervention required.

Proposal → Cap Gate → Approval → Mission → Execution → Event → Trigger/Reaction → Proposal

Three components work together:

  • AgentZero (VPS) — The brain. Runs the agent loops, executes missions, enforces cap gates.
  • Supabase — State layer. Stores proposals, missions, events. Provides real-time subscriptions.
  • Next.js/Vercel (separate repo) — Dashboard. Read-only view + lightweight control (approve/reject).

Add to agentzero.toml:

[autopilot]
enabled = true
supabase_url = "https://xxx.supabase.co"
supabase_service_role_key = "eyJ..."
max_daily_spend_cents = 500
max_concurrent_missions = 5
stale_threshold_minutes = 30
reaction_matrix_path = "reactions.json"
[[agents]]
name = "editor"
system_prompt = "You are the Editor-in-Chief. Propose blog topics and review content."
[[agents]]
name = "writer"
system_prompt = "You are a Content Writer. Write posts from research briefs."
[[autopilot.triggers]]
name = "periodic_topic_proposal"
condition = { type = "cron", schedule = "0 */6 * * *" }
action = { type = "propose_task", agent = "editor", prompt = "Propose a new blog topic." }
cooldown_secs = 21600

Create reactions.json:

[
{
"source_agent": "editor",
"event_pattern": "proposal.approved",
"target_agent": "writer",
"action": "begin_writing",
"probability": 1.0,
"cooldown_secs": 60
}
]

Run supabase/migrations/001_autopilot_schema.sql against your Supabase project.

Agents create proposals for work to be done. Each proposal has a type, priority, and estimated cost:

FieldDescription
proposal_typecontent_idea, task_request, resource_request, system_change
prioritylow, medium, high, critical
estimated_cost_microdollarsCost estimate (1 cent = 10,000 microdollars)
statuspendingapproved / rejectedexecuted

Cap gates enforce resource constraints before a proposal is approved:

ConstraintDefaultDescription
max_daily_spend_cents500Maximum daily spend across all agents
max_concurrent_missions5Maximum missions running simultaneously
max_proposals_per_hour20Proposal rate limit
max_missions_per_agent_per_day10Per-agent mission cap

A proposal that violates any constraint is automatically rejected with a reason.

When a proposal is approved, it becomes a mission with executable steps:

FieldDescription
statuspendingin_progresscompleted / failed / stalled
stepsOrdered list of MissionStep with individual status tracking
heartbeat_atLast heartbeat timestamp (used for stale detection)
deadlineOptional deadline

Triggers create new proposals when conditions are met:

Condition TypeDescription
event_matchFire when a specific event type is emitted
cronFire on a cron schedule (e.g., 0 */6 * * *)
metric_thresholdFire when a metric exceeds a threshold

All triggers support cooldown_secs to prevent rapid re-firing.

The reaction matrix defines probabilistic inter-agent interactions. When agent A emits event X, agent B has probability P of proposing action Y.

{
"source_agent": "writer",
"event_pattern": "mission.completed",
"target_agent": "social_media",
"action": "propose_social_post",
"probability": 0.9,
"cooldown_secs": 600
}

Event patterns support wildcards: * matches any event, content.* matches all content events.

Missions with heartbeat_at older than stale_threshold_minutes are automatically marked as stalled, and a mission.stalled event is emitted. This prevents stuck missions from consuming cap gate capacity.

Three pre-built templates are available in templates/:

6 agents: editor, researcher, writer, seo, social_media, analyst. Agents autonomously propose topics, research, write, optimize, publish, and promote content.

6 agents: pm, architect, coder, reviewer, devops, support. Agents triage issues, design solutions, write code, review PRs, deploy, and handle support.

6 agents: product, engineer, qa, support, growth, ops. Agents manage product development, testing, customer support, growth marketing, and operations.

Each template includes an agentzero.toml with agent definitions and triggers, plus a reactions.json with the reaction matrix.

Four tools are available to agents when autopilot is enabled:

ToolDescription
proposal_createCreate a new proposal with type, priority, and cost estimate
proposal_voteApprove or reject a proposal (auto-creates mission on approval)
mission_statusQuery one or all missions, optionally filtered by status
trigger_fireManually fire a trigger by ID (for testing or agent-initiated reactions)

Autopilot and human interaction work together:

  • Dashboard approval — Proposals can be auto-approved by cap gates OR manually approved/rejected from the dashboard via /v1/autopilot/proposals/:id/approve.
  • Chat — Agents still respond to chat via channels (Telegram, Discord, Slack). Human messages can influence agent behavior alongside autonomous operations.
  • Trigger control — Triggers can be enabled/disabled from the dashboard without restarting.
  • Emergency stop — The existing estop mechanism halts all autonomous operations immediately.

When autopilot is enabled, the gateway exposes additional REST endpoints for dashboard control:

MethodPathDescription
GET/v1/autopilot/proposalsList proposals (paginated)
POST/v1/autopilot/proposals/:id/approveApprove a proposal
POST/v1/autopilot/proposals/:id/rejectReject a proposal
GET/v1/autopilot/missionsList missions
GET/v1/autopilot/missions/:idMission detail with steps
GET/v1/autopilot/triggersList triggers
POST/v1/autopilot/triggers/:id/toggleEnable/disable a trigger
GET/v1/autopilot/statsDaily spend, mission counts, agent activity

The SQL migration (supabase/migrations/001_autopilot_schema.sql) creates 8 tables:

TableDescription
proposalsProposal records with status tracking
missionsMission records with heartbeat and deadline
mission_stepsIndividual mission steps with status
eventsEvent log for triggers and audit
triggersTrigger rule configuration
contentPublished content (blog posts, etc.)
agent_activityAgent activity log
cap_gate_ledgerCost tracking for cap gate enforcement

RLS policies grant full access to the service role (AgentZero VPS), read-only to anon (dashboard), and public read on published content only.