Most AI tools wait for you to ask. You type. They respond. You're the driver.

Autonomous agents flip this. They run in the background. Check things. Make decisions. Take action. You're not the driver. You're the manager.

This guide shows you how to build them.

24/7
Always running
0
Babysitting needed
Tasks automated
~2h
Setup time

What Makes an Agent "Autonomous"?

An autonomous agent has three properties:

  1. Persistence — It stays running. Not just when you call it.
  2. Perception — It monitors things. Email, calendars, files, APIs, whatever you configure.
  3. Action — It does things without asking first. Within boundaries you set.

A chatbot waits for input. An autonomous agent takes initiative.

The Tech Stack

To build an autonomous agent, you need:

  • Claude Code — The AI engine that understands and acts
  • OpenClaw — The framework that makes it persistent
  • A server — Somewhere for the agent to run (your computer, a VPS, or cloud)
  • Integrations — APIs and tools the agent can access

If you haven't set up Claude Code and OpenClaw yet, start with these guides first:

Step 1: Define the Agent's Purpose

Before building anything, get clear on what this agent should do. Be specific.

Bad: "Help me with emails"

Good: "Monitor my Gmail for client emails (from domains in my client list). Extract any tasks or deadlines mentioned. Add them to my todo list. Send me a morning summary at 7am."

The more specific, the better it works.

Example Agent Purposes

  • Morning Briefing Agent — Checks email, calendar, weather, news. Sends you a summary each morning.
  • Lead Response Agent — Monitors new leads. Sends personalized follow-ups. Schedules calls.
  • Code Monitor Agent — Watches GitHub repos. Alerts on issues. Auto-merges safe PRs.
  • Customer Support Agent — Answers common questions. Escalates complex issues to you.
  • Research Agent — Monitors industry news. Summarizes relevant articles. Tracks competitors.

Step 2: Set Up the Agent File

OpenClaw uses a YAML file to define your agent. Create agent.yaml:

agent.yaml
name: morning-briefing
description: Daily morning briefing agent

schedule:
- cron: "0 7 * * *" # 7am daily
task: morning_briefing

tasks:
morning_briefing:
prompt: |
Check my email for unread messages.
Check my calendar for today's events.
Check weather for my location.
Compile into a morning briefing.
Send to my Telegram.

integrations:
- gmail
- google_calendar
- weather_api
- telegram

This defines what the agent does, when it runs, and what tools it can use.

Step 3: Configure Integrations

Your agent needs access to services. Each integration requires credentials.

.env
# Gmail API
GMAIL_CLIENT_ID=your_client_id
GMAIL_CLIENT_SECRET=your_client_secret

# Google Calendar
GCAL_CREDENTIALS_PATH=./credentials.json

# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

Step 4: Set Autonomy Boundaries

This is crucial. What can the agent do without asking you first?

agent.yaml — permissions
permissions:
# Can do without asking
auto_approve:
- read_email
- read_calendar
- send_notification
- update_todo_list

# Must ask first
require_approval:
- send_email
- schedule_meeting
- make_purchase
- delete_anything

Start conservative. You can grant more autonomy as you build trust.

Step 5: Deploy the Agent

Your agent needs to run somewhere. Options:

Option A: Your Computer

Simplest. Just keep your computer running. Use screen or tmux to keep the agent alive.

terminal
$ screen -S agent
$ openclaw run agent.yaml
▸ Agent started: morning-briefing
▸ Next scheduled run: 7:00 AM

Ctrl+A then D to detach. The agent keeps running.

Option B: VPS (Recommended)

A $5/month VPS (DigitalOcean, Vultr, etc.) runs 24/7 without depending on your computer.

Option C: Cloud Functions

For simple scheduled tasks, AWS Lambda or similar can work. More complex for agents that need state.

Step 6: Monitor and Iterate

Your agent will make mistakes. That's normal. Set up monitoring:

  • Logging — Record what the agent does and why
  • Alerts — Get notified when the agent hits errors
  • Review — Check logs weekly to spot issues

Adjust the agent's instructions based on what you learn. Each iteration makes it smarter.

Example: My Morning Briefing Agent

Here's what my agent (Jars) does every morning at 7am:

  1. Checks email for anything from clients or urgent keywords
  2. Summarizes today's calendar events
  3. Checks weather and alerts if rain/extreme temps
  4. Pulls key metrics from my business dashboards
  5. Checks for any GitHub notifications
  6. Compiles everything into a 2-minute briefing
  7. Sends to my Telegram

I wake up, read the briefing, and know exactly what needs attention. No inbox scrolling. No context switching. Just clarity.

What's Next

Once you have one agent running, you'll want more. Ideas:

  • Lead follow-up agent — Responds to new inquiries automatically
  • Content repurposing agent — Turns blog posts into tweets, threads, newsletters
  • Customer support agent — Handles tier-1 support questions
  • Research agent — Monitors topics and sends weekly digests