Skip to content
Abhijeet Maharana, home
All projects

Case study: AI agents and automation

Open-Source 24/7 AI Agent with Human Approvals

Runs scheduled work around the clock, and nothing leaves the machine without a person's approval.

A self-hosted agent that drives Claude Code from Slack and cron, with sealed approval cards, exactly-once scheduling and no secrets in the model's reach.

Where
Open source (MIT) on GitHub
Role
Author and maintainer
When
2026
Team
Solo, end to end
1
run per cron slot, claimed in SQLite and safe across restarts
240
Vitest tests over scheduler, approvals and security paths
0
secrets in the model's environment; root actions only on approval
Slack threadsa message starts a runCron jobsjobs.json per repotara-agentNode.js, one per hostClaude Code CLIheadless, per repoSQLiteruns, claims, approvalsApproval cardSlack or dashboardslot claimed oncerequest_approval
Slack threads and cron jobs start runs; tara-agent drives the Claude Code CLI per repo, keeps state in SQLite, and anything outbound waits as an approval card

TL;DR: tara-agent is an open-source, self-hosted AI agent that runs around the clock. It drives the official Claude Code CLI from Slack threads and cron jobs, and it stops for a human whenever an action matters: sending a message, a risky change, a login. Approvals are cards in Slack or on a web dashboard, every scheduled run happens exactly once, and the model never sees a secret. Source: github.com/abhijeet-maharana/tara-agent.

What problem does it solve?

AI coding agents are good at real project work, but most setups only run while someone is watching a terminal. I wanted an agent that keeps working on its own and still asks before anything leaves the machine:

  • Work happens on a schedule, day and night: reports, checks, drafts, fixes.
  • A person decides before anything is sent, published or changed outside the repo, usually from a phone.
  • A bad prompt or a compromised page can't reach the keys, because the agent runs with the least access possible.

How does it work?

One Node.js process per host. It never calls a model API directly: every piece of model work is a headless run of the claude CLI inside the right project repo, so each project keeps its own instructions, skills and MCP servers.

  1. Slack in, Claude out. A message in a mapped channel starts a Claude Code session; replies in the thread resume it. Progress streams live into the thread as a task list, then the answer.
  2. Scheduled jobs come from a jobs.json in each repo, hot reloaded. A cheap pre-run script can decide there is nothing to do and skip waking the agent, which keeps model usage low.
  3. A built-in MCP server gives Claude its tools for people: request_approval, propose_item, send_file and request_privileged. Each run gets its own token for it.
  4. SQLite stores sessions, runs, slot claims and approvals, so a restart loses nothing.

How does it guarantee a job runs exactly once?

  • Slot claims. When a cron slot fires, the scheduler claims it in SQLite first. A claimed slot never runs again, even after a crash or restart.
  • Catch-up. On start, each job runs its most recent missed slot once, if it is recent enough.
  • Named locks keep two jobs that share a resource (for example one browser) from running at the same time.
  • Interrupted runs cut short by a restart run again once on the next start.

How do human approvals work?

  • Cards, not chat. Drafts wait as cards that can be edited, approved, rejected or sent back for a new version. A decision continues the same Claude session, as the same job.
  • Queues send approved items out later in delivery windows per region, with daily and weekly caps, gaps and batches.
  • Sealed approvals. Each approved item carries an HMAC of its kind, id and approved field values. An executor in another process verifies the seal before it acts, so editing a file by hand never sends anything.
  • Project checks. A project can attach its own blocking checks to a card before it can be approved.

How is it secured?

The threat model starts from one rule: anyone who can post in a mapped channel can make Claude act on the machine.

  • Unprivileged user. It runs as its own OS user with access only to the project repos, under systemd.
  • Split users. Claude and the pre-run scripts can run as a second OS user, so a run can't read the agent's database or keys.
  • No secrets in the model's environment. Slack tokens and other credentials are stripped before the CLI starts. The system prompt is passed in a file so sudo never logs it.
  • Root actions on approval. The agent never gets sudo. It can request an action from the allowlist of a root-owned helper, and a person approves it.
  • Dashboard decisions need an unlock cookie set from another device.

What else did I build into it?

  • A web dashboard, server-rendered and phone friendly: what's running, what needs a person, failing jobs, the day's schedule with overlaps and free time, and full transcripts of every run.
  • A read-only Code page that shows each repo's uncommitted changes and diffs through a private copy of the git index, so it never touches the real repo.
  • Learning from mistakes. After a run that had trouble, the agent gets one chance to fix the instructions it followed.
  • A daily health digest per project: runs, problems, missed slots and peak usage.

What were the results?

MetricResult
StatusIn daily use, running scheduled jobs for my own projects
CodebaseAbout 10,000 lines of TypeScript, MIT licensed
Tests240 Vitest tests over the scheduler, approvals, sessions and security paths
Dependencies5 at runtime: MCP SDK, Slack Bolt, croner, yaml, zod