I Built an AI Agent to Run My Business. Here's How I Kept It Secure.

February 5, 2025 · 7 min read

I Built an AI Agent to Run My Business. Here's How I Kept It Secure.

I Built an AI Agent to Run My Business. Here's How I Kept It Secure.

Last month, I was drowning.

Between newsletter campaigns, subscriber management, GitHub commits, email triage, and keeping Beacon (my newsletter platform) alive—I was spending 60+ hours a week on busywork. The kind of work that doesn't build anything. It just... exists.

So I did what any sleep-deprived founder does: I automated it.

But not how you'd expect.

Instead of hiring someone or hoping a SaaS tool would magically solve everything, I built AI agents that work inside my infrastructure. They run on my laptop. They use my APIs. They access my credentials. And yes—they're secure.

This is the story of how to build automation you can actually trust.


The Problem: Busywork is Stealing Your Life

Here's the thing about running a one-person business: everything lands on you.

  • Newsletter analytics? You read them manually.
  • Subscriber imports? You paste CSV files one at a time.
  • GitHub PRs? You review them, manually.
  • Email triage? You scan subject lines for 30 minutes a day.

None of this is hard. It's just mindless. And it steals about 15 hours a week from the work that actually matters.

Lawyers deal with this. Parents coordinating schedules deal with this. Landscapers managing job quotes deal with this.

The cost? Burnout. Missed opportunities. Work that doesn't ship.


Enter: AI Agents (But Do It Right)

An AI agent is software that can read your emails, interact with your tools, make decisions, and take actions—all without you clicking buttons.

Scary, right?

Here's the thing: An uncontrolled AI agent with access to your entire business is absolutely dangerous.

But a properly scoped, audited, secure AI agent working within your own infrastructure? That's a game-changer.

I built agents using OpenClaw (an open-source AI automation framework) that handle:

  1. Beacon feature development — Auto-building features from my backlog, running tests, creating PRs for me to review
  2. Newsletter analytics — Scanning Gmail for subscriber feedback, summarizing metrics
  3. GitHub automation — Monitoring CI failures, suggesting fixes

All of this runs on my laptop. All credentials stay in my control. And everything gets logged and audited.


The Security Reality: Your Credentials Are the Keys to the Kingdom

Let's be honest: AI agents need access to your stuff.

They need:

  • API keys to your email service
  • GitHub tokens to commit code
  • Database credentials to fetch data
  • Slack webhooks to post updates

If you hand an agent all of this with no controls, and it gets compromised or malfunctions, you're done. Someone could delete your entire customer database. Ship malicious code. Drain your API credits.

This is where most automation projects fail. They gloss over security like it's optional.

It's not.


How I Protect My Agents (And How You Can Too)

Here's my security model. It's not military-grade, but it's solid for a one-person business:

1. Principle of Least Privilege

Each agent gets only the permissions it needs. Nothing more.

My "PR builder" agent has:

  • ✅ Read access to my project files
  • ✅ Run tests locally
  • ✅ Create branches
  • ✅ Push to Git
  • ❌ Access my email
  • ❌ Access my database
  • ❌ Delete anything

My "email analyst" agent has:

  • ✅ Read-only access to Gmail
  • ✅ Write to a summary document
  • ❌ Send emails
  • ❌ Delete messages
  • ❌ Access any other tools

Principle: If an agent doesn't need it, it doesn't get it.

2. Secrets in Vaults, Not in Code

I store credentials in encrypted secret managers:

  • Docker secrets for API keys
  • Environment files (.env, gitignored)
  • 1Password for rotating tokens
  • Separate keys per agent (so one compromised key doesn't blow everything up)

What I never do:

  • Hardcode API keys in scripts
  • Share credentials across agents
  • Store tokens in unencrypted files
  • Commit secrets to Git (I've got pre-commit hooks that catch this)

3. Sandboxing & Containment

My agents run in isolated Docker containers with:

  • Limited network access — Only URLs I whitelist
  • Read-only filesystems (where possible) — Agents can't modify system files
  • Resource limits — Can't hog CPU or memory and crash my system
  • No root access — Even if compromised, can't escalate privileges

If an agent starts doing weird stuff (trying to access files it shouldn't, making unexpected network requests), the container just... stops.

4. Full Audit Trails

Every action my agents take gets logged:

  • What they did
  • When they did it
  • What data they touched
  • What output they produced

I review these logs weekly. If I see:

  • An agent accessing files outside its scope
  • Unusual network activity
  • Changes to files it shouldn't touch
  • API calls to unexpected services

...I know immediately. I can kill the agent before it becomes a problem.

5. Human Oversight (For Now)

Here's the thing: I don't just let agents ship code to production.

My workflow:

  1. Agent builds a feature on a branch
  2. Agent runs tests, creates a PR
  3. I review the PR (code, tests, logic)
  4. I merge it (human decision)
  5. I test it before it goes live

The agent handles the busywork. I handle the judgment calls.


Real Use Cases: Who Actually Benefits?

Let me show you why this matters.

Lawyer Example

You spend 2 hours a day triaging client emails, extracting case details, and filing them in your case management system.

An agent could:

  • Monitor your inbox
  • Extract client name, case type, urgency
  • Auto-file in your system
  • Escalate urgent matters to you

Result: Triage drops from 2 hours to 10 minutes. You still make every important decision.

Parent Example

You coordinate kids' schedules (school, PT, activities, sports) across a shared calendar. Your spouse has their own calendar. Nobody's ever on the same page.

An agent could:

  • Monitor your shared family calendar
  • Extract upcoming events
  • Send reminders to both parents 24h before
  • Alert you to scheduling conflicts

Result: One less thing to forget. No more "wait, did you know Liara has PT Thursday?"

Landscaper Example

You get job inquiries via email, Facebook, forms. You manually:

  • Write quotes
  • Schedule jobs
  • Send invoices
  • Track payments

An agent could:

  • Read incoming inquiries
  • Pull your pricing from a spreadsheet
  • Generate quotes (you review + send)
  • Create invoices automatically
  • Flag unpaid invoices

Result: Respond to leads in 1 hour instead of 2 days. More jobs booked.

Entrepreneur Example (My Story)

I was manually:

  • Reading GitHub notifications
  • Reviewing PRs
  • Checking test results
  • Managing the backlog

An agent now:

  • Monitors GitHub for new PRs
  • Runs tests automatically
  • Suggests fixes for failing tests
  • Creates summary PRs of completed features

Result: My actual coding time went from 50% to 70%. The agent handles the admin.


Getting Started: Three Rules

If you're thinking about building an AI agent for your business, follow these rules:

Rule 1: Start Small

Don't give your agent access to everything on day one. Start with one task, one tool, one API key.

My first agent only had access to a test GitHub repo. Once I proved it worked safely for a week, I expanded.

Rule 2: Audit the Code

If it's open source (like OpenClaw), read it. Or get someone to read it for you. You need to understand what it's actually doing before you hand it your credentials.

Rule 3: Monitor Ruthlessly

Set up logging from day one. Review logs weekly. The moment you see something weird, stop the agent and investigate.

An agent that's misbehaving is better caught early than discovered after it's deleted your production database.


The Future: Agents as Team Members

Here's what I've learned: AI agents aren't replacements for people. They're force multipliers.

They handle the stuff that drains your energy. The busywork. The admin. The repetitive tasks.

They free you up to do the work that actually builds something.

For busy people—lawyers, parents, landscapers, entrepreneurs—that's transformative. It's the difference between working 60 hours a week on busywork and working 40 hours on actual work.

The catch? You have to keep them secure.

No shortcuts on credentials. No skipping the audit logs. No "I'll add security later" (you won't).

Do it right from the start, and you've got a team member that never sleeps, never gets tired, and never complains.


Want to Learn More?

If you're interested in building secure AI agents for your business, I'm planning a deeper guide on:

  • How to set up agents safely
  • Credential management for automation
  • Monitoring and alerting
  • Common pitfalls (and how to avoid them)

Sign up for our newsletter to get notified when that drops.

And if you've built automation you're proud of? Hit reply or message me. I'd love to hear what you've automated and how you're keeping it secure.

Because here's the truth: You deserve to work on what matters.

Everything else should be automated.


Mathew Clark
Founder, SecureInSeconds
Currently: Letting AI agents build my newsletter platform while I sleep 😴

Share:

You might also like