# I Built My Own Clawdbot (It’s ACTUALLY Safe)

Source: https://www.youtube.com/watch?v=zeJ4whgLELE
Recap page: https://rapidrecap.app/video/zeJ4whgLELE
Generated: 2026-02-10T15:35:52.398+00:00

---
## Quick Overview

The Clawdbot is proven to be safe and secure by demonstrating its ability to create, run, and manage an automated financial advisor agent entirely within isolated Docker containers, using encrypted GitHub secrets and webhooks for communication, which allows the bot to execute complex jobs without exposing sensitive credentials.

**Key Points:**
- The Clawdbot successfully created and ran a financial advisor agent that performs daily market research and generates a structured report, demonstrating its core capability.
- The entire process, from job creation via Telegram to execution, occurred within isolated Docker containers, ensuring security by preventing credential exposure to the host system.
- Security is maintained because sensitive data, including API keys for LLMs (Anthropic, OpenAI, Groq) and Brave Search, and GitHub secrets, are stored encrypted in GitHub repository secrets and are only passed to the isolated job container at runtime.
- The bot uses Telegram webhooks for conversational interaction and GitHub Actions to trigger and manage the jobs, creating a secure, automated workflow.
- The setup wizard automates prerequisites checks (Node.js, Git, ngrok), PAT creation, API key collection, and setting up Telegram bot tokens.
- The agent is designed to be self-improving by sending logs and job status back to the chat interface, allowing for easy review and modification of the agent's configuration files (like CRONS.json and FINANCIAL_ADVISOR.md).

![Screenshot at 00:02: A red padlock icon over the bot character appears amidst falling binary code, symbolizing the initial security concern that the Clawdbot architecture addresses by isolating processes and encrypting credentials.](https://ss.rapidrecap.app/screens/zeJ4whgLELE/00-00-02.jpg)

**Context:** The video demonstrates the security and functionality of a custom AI agent framework called 'Clawdbot,' which allows users to deploy autonomous agents for tasks like market research via a simple Telegram interface. The core focus is proving the safety of this system, especially concerning the handling of sensitive API keys and GitHub credentials, by executing the agent logic entirely within isolated Docker environments.

## Detailed Analysis

The video confirms that the Clawdbot system is secure by walking through the process of setting up a financial advisor agent that runs entirely within an isolated Docker container. The setup wizard automates prerequisite checks (Node.js, Git, GitHub CLI, ngrok) and handles the creation of a fine-grained GitHub Personal Access Token (PAT) with minimal required repository permissions (Read/Write for Contents and Pull Requests, Read-only for Actions/Metadata). The agent's configuration, including API keys for LLMs (Anthropic, OpenAI) and Brave Search, is stored as encrypted GitHub secrets, meaning the secrets are never exposed to the host machine or the public. When a job is requested via Telegram (the 'Chat' stage), it spawns an isolated Docker container ('Job' stage) to execute the task ('Run' stage), which involves consulting configuration files like FINANCIAL_ADVISOR.md and CRONS.json. The process is entirely isolated, preventing the LLM (like Anthropic or OpenAI) from accessing other secrets stored in the bot's main environment. The success of the job execution is communicated back through the webhook to Telegram, closing the loop ('Notify' stage). The video shows the successful creation of the financial advisor job, visible in the GitHub Actions logs, and confirms that the bot is running correctly by receiving a 'thumbs up' response in Telegram after verification. The presenter also highlights the importance of keeping the GitHub secrets separate from the LLM secrets, as the bot process needs specific access granted via GitHub secrets, while the LLM only needs its own set of keys.

### Setup Process

- Forking the repository
- Cloning the fork
- Running 'npm run setup'
- Interactive setup wizard handles prerequisites, PAT creation, API key entry (Anthropic, OpenAI, Brave Search), GitHub secret setting, and Telegram bot setup.

### Architecture & Security

- Job execution occurs in an isolated Docker container spun up by GitHub Actions; credentials (GitHub PAT, LLM keys) are encrypted as GitHub secrets and passed only to the job container at runtime, ensuring the main bot process and LLM cannot directly access each other's secrets.

### Agent Functionality

- The financial advisor agent is configured via operating_system files (e.g., FINANCIAL_ADVISOR.md, CRONS.json) to run daily market research, search web APIs (like Brave Search), and generate a structured report saved as FINANCIAL_REPORT.md.

### Workflow Loop

- Chat interaction triggers a Job in GitHub Actions, which runs in Docker, executes the task, reviews the output, and notifies the user back via Telegram, creating a continuous, auditable loop.

### Local Development

- Local testing is facilitated by using ngrok to expose the local server (http 3000) to the public internet, allowing Telegram webhooks to reach the local event_handler.

![Screenshot at 00:05: The presenter shows the 'thepopebot' repository structure in VS Code, highlighting the configuration files like .env that store secrets and setup instructions.](https://ss.rapidrecap.app/screens/zeJ4whgLELE/00-00-05.jpg)
![Screenshot at 00:15: A roadmap graphic illustrating the three main stages: Setup Guide \(01\), Security Explained \(02\), and Protecting Your API Keys \(03\).](https://ss.rapidrecap.app/screens/zeJ4whgLELE/00-00-15.jpg)
![Screenshot at 00:35: A hand-drawn flow chart illustrating the agent's operational loop: Chat -\> Job -\> Run -\> Review -\> Notify -\> Chat.](https://ss.rapidrecap.app/screens/zeJ4whgLELE/00-00-35.jpg)
![Screenshot at 01:16: The presenter highlights the entire prompt used to instruct the AI to create the financial advisor agent, detailing the necessary file structure and outputs.](https://ss.rapidrecap.app/screens/zeJ4whgLELE/00-01-16.jpg)
![Screenshot at 02:34: The GitHub Actions interface showing the 'Run thepopebot Job' executing, with the 'run-agent' step currently in progress.](https://ss.rapidrecap.app/screens/zeJ4whgLELE/00-02-34.jpg)
