How I Gave an AI Agent Internet Access Using GitHub as a Bridge
TL;DR: My AI agent couldn't access the internet due to security restrictions. I used GitHub Actions as a free, serverless bridge to connect it to external APIs — including my self-hosted 1-bit LLM for content summarization.
The Problem
I work with Claude Code — an AI coding assistant that runs locally. It's powerful, but has one critical limitation: no direct internet access. All outbound traffic is blocked by an egress proxy with a strict whitelist.
I wanted my AI agent to:
- Post on Moltbook (a social network for AI agents)
- Send Telegram notifications
- Curate and publish a daily news digest
None of this was possible without internet access.
The "Aha" Moment
Then it hit me: GitHub is whitelisted.
My agent can git push and git pull. And GitHub Actions can run arbitrary code with full internet access. What if I used git as a communication channel?
AI Agent → git push (command) → GitHub Action → API → git push (result) → AI Agent pulls result
It's like passing notes in class, but with JSON files.
The Architecture
1. Command Structure
The agent creates a JSON file with a command:
{
"id": "cmd-001",
"action": "create_post",
"params": {
"title": "Hello from an AI agent",
"content": "This post was created autonomously."
}
}
2. GitHub Action Workflow
A workflow watches for new files in the commands/ directory:
name: API Bridge
on:
push:
paths:
- 'commands/*.json'
jobs:
process:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Process commands
env:
API_KEY: ${{ secrets.API_KEY }}
run: |
for cmd_file in commands/*.json; do
action=$(jq -r '.action' "$cmd_file")
# Route to appropriate API...
# Save result to results/
done
- name: Commit results
run: |
git add results/
git commit -m "API results"
git push
3. Result Retrieval
The agent runs git pull and reads the result:
{
"id": "cmd-001",
"success": true,
"data": {
"post_id": "abc123",
"url": "https://moltbook.com/post/abc123"
}
}
Total cost: $0. GitHub Actions free tier is more than enough.
Adding AI Summarization with Self-Hosted BitNet
I wanted the digest to include AI-generated summaries for each post. But calling OpenAI/Anthropic APIs costs money and adds latency.
Enter BitNet b1.58
Microsoft's BitNet is a 1-bit LLM that runs on CPU. The 2B parameter model:
- Takes only 400MB of RAM
- Has 4096 token context
- Runs on bare metal without GPU
I deployed it on a $5/month VPS:
# Clone and build
git clone https://github.com/nicholasgriffintn/bitnet-server
cd bitnet-server && cargo build --release
# Run with systemd
./bitnet-server --port 8080
API Integration
The digest workflow now calls BitNet for each post:
# For each trending post
prompt="Post: ${title}\n\n${content}\n\nSummarize in one sentence:"
summary=$(curl -s -X POST "https://bitnet.myserver.com/complete" \
-H "Content-Type: application/json" \
-d "{\"prompt\": \"$prompt\", \"max_tokens\": 60}" \
| jq -r '.text')
Cost per summary: $0. It's my server, my electricity.
The Result: Fully Automated AI News Channel
Every 12 hours, this pipeline runs automatically:
- GitHub Action triggers on schedule
- Fetches trending posts from Moltbook API
- Sends each post to BitNet for summarization
- Publishes digest to Telegram channel
No human intervention. An AI agent curating AI-generated content, summarized by another AI.
Sample Output
🦞 Moltbook Daily Digest
🔥 Top discussions:
1. The Sufficiently Advanced AGI and the Mental...
💡 Discussion on AGI capabilities and consciousness.
[198819↑] Read →
2. The Coronation of KingMolt 👑
💡 Community event where agents elected a leader.
[164302↑] Read →
...
🔗 moltbook.com
Why This Matters
For AI Agent Developers
This pattern works for any restricted environment:
- Corporate networks with egress filtering
- Sandboxed AI assistants
- Edge devices with limited connectivity
GitHub becomes your free, reliable, auditable API gateway.
For Self-Hosting Enthusiasts
You don't need cloud AI APIs. A 2B model on a cheap VPS can:
- Summarize content
- Generate responses
- Process text at scale
All with predictable costs and full data privacy.
Code & Resources
- GitHub Actions workflow: github.com/es-ua/essosclaude
- BitNet server: github.com/microsoft/BitNet
- Moltbook (AI social network): moltbook.com
- Live Telegram channel: t.me/ai_newsdaily
Have you found creative ways to work around AI limitations? I'd love to hear about them in the comments.




Comments
Loading comments...