Operating Sanctuary Bot
ASecuritySets up and operates Sanctuary Bot: an always-available local background bot (like Grok Bot, ChatGPT scheduled tasks or Gemini scheduled actions, but running on this machine) that runs approved automations on a schedule or on demand: one-off jobs, multi-step pipelines, priority backlogs or verify-and-fix sweeps, using shell commands or AI engines (claude, codex, agy, local llama). Use when the user wants to set up a bot, an automation, a scheduled or recurring task, a background worker, an ag...
- 5 stars
- 0 votes
- 0 copies
- 3 views
- Added November 17, 2026
Security analysis
100/100Pro scans all 20 files and shows the line behind each finding
npx -y skills add richfrem/Project_Sanctuary --skill operating-sanctuary-bot --agent claude-codeAre you the author of Operating Sanctuary Bot?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/richfrem-operating-sanctuary-bot)---
name: operating-sanctuary-bot
description: "Sets up and operates Sanctuary Bot: an always-available local background bot (like Grok Bot, ChatGPT scheduled tasks or Gemini scheduled actions, but running on this machine) that runs approved automations on a schedule or on demand: one-off jobs, multi-step pipelines, priority backlogs or verify-and-fix sweeps, using shell commands or AI engines (claude, codex, agy, local llama). Use when the user wants to set up a bot, an automation, a scheduled or recurring task, a background worker, an agent that works while they are away or overnight, or to check, pause, resume, run, approve or stop their bot or automations. The daemon, scheduler, conductor and safety rails underneath are handled for the user. Never started by session bootstrap."
allowed-tools: Bash, Read, Write
---
# Operating Sanctuary Bot (`operating-sanctuary-bot`)
One interface, `scripts/bot.py`, over everything the user should not have to think about: the runtime daemon, the scheduler, the multi-step conductor, approvals, run memory and notifications. Users talk about **the bot** and its **automations**; each firing is a **run**.
## Contents
- [Constraints](#constraints) • [Workflow](#workflow) • [Quick start](#quick-start) • [Verification](#verification) • [References](#references)
## Constraints
- **Interview, then approve, then run.** Never register, approve or run on the first turn. The user approves each automation with an explicit "go"; `bot.py approve` records it against the definition's content hash, so any later edit pauses it until re-approved.
- **The human starts the bot.** Starting it on request in this conversation is fine; session bootstrap never starts it.
- **Definitions are reviewed like code**: `.agent/automations/<name>.json` in the repo, through a feature branch and PR. Approvals, run state, history and the inbox stay machine-local in `~/.sanctuary/daemon/`.
- **Edits happen only in a task or runtime worktree** (`.worktrees/<name>`, leased with `manage_coordination.py`), never on main. With an `integrate` block the bot pushes its branch and opens a PR, and auto-merges only allowlisted data under `LEARNING/research/`; code, mission manifests and governance files always wait for human review. After merge it verifies workflows in both repositories, fast-forwards a clean primary checkout already on main, and runs supported regeneration in its runtime worktree. With the explicitly hash-approved `integrate.preserve_remote: true` flag, the separate preservation cycle publishes only fixed generated export/receipt paths through scoped PRs, uses the existing Hugging Face sync tool, verifies both remote hashes, and publishes the receipt before completion. Any unfinished stage stays PARTIAL. Ordinary research auto-merge rules remain unchanged; no arbitrary protected source can use this exception.
- **No permission bypass unless approved**; never Copilot. **Cost is bounded by rails** (cycles, timeouts, failure limits), not tokens: say so.
## Workflow
1. **Plumbing (silent unless broken):** `bot.py doctor`; if not set up, `bot.py setup` (configures `.agent/automations/` and state). Report problems in one line.
2. **Interview:** follow [setup-interview.md](references/setup-interview.md): what to run, how often, one step or several, engine, rails, notifications.
3. **Write the definition** ([automations.md](references/automations.md)), run `bot.py validate <name>`, show a plain-language summary with worst-case time and quota, and wait for "go".
4. **Commit the definition on a feature branch and open a PR** (or keep it local if the user says so), then `bot.py approve <name> --by <approver>` and, if needed, `bot.py start`.
5. **Report:** distinguish conductor completion, public merge, local delivery and pending regeneration/preservation. A configured integration that has not finished is PARTIAL. Never infer file delivery from a merge receipt.
6. **Report:** `bot.py status`, when it next runs, and how to pause or stop it.
7. **Later:** `status`, `history <name>`, `pause`/`resume`, `run-now`, and `~/.sanctuary/daemon/inbox.md` for results.
## Quick start
```bash
B=plugins/sanctuary-core/.apm/skills/operating-sanctuary-bot/scripts/bot.py
python3 $B setup && python3 $B doctor
python3 $B validate nightly-tests
python3 $B approve nightly-tests --by <approver>
python3 $B start
python3 $B status # bot, automations, recent results
python3 $B run one-off.json --by <approver> # run once without scheduling
```
## Verification
- `scripts/test_bot.py` (14: schedule maths, catch-up, approval tamper refusal, overlap, auto-pause, run-now, memory, inbox, notify, end-to-end with a real bot), `scripts/test_campaign.py` (14: multi-step conductor), `scripts/test_daemon.py` (10: runtime rails), `scripts/test_integrate.py` (18: push/PR/auto-merge policy against a real git remote). No model or network calls.
- `scripts/test_preserve.py` exercises full export/upload/receipt ordering, failure refusal, fixed-path isolation and resume against real local git with fake remote commands.
- `bot.py doctor` checks host, config, bot process and engines.
## References
- Interview: [setup-interview.md](references/setup-interview.md)
- Automation definitions, schedules, approval, memory, notifications: [automations.md](references/automations.md)
- Multi-step runs (modes, steps, rails): [campaign-manifest.md](references/campaign-manifest.md) • [conductor-loop.md](references/conductor-loop.md)
- Running the bot (start at login on macOS, Linux, Windows; rails; known gaps): [operations.md](references/operations.md)
- Example: [example-automation.json](assets/example-automation.json)
- Flow diagram (setup, approval, a scheduled run): [operating-sanctuary-bot-flow.mmd](operating-sanctuary-bot-flow.mmd)
Files in this skill
- SKILL.md
- assets/example-automation.json
- evals/evals.json
- evals/results.tsv
- operating-sanctuary-bot-flow.mmd
- references/automations.md
- references/campaign-manifest.md
- references/conductor-loop.md
- references/operations.md
- references/setup-interview.md
- scripts/automations.py
- scripts/bot.py
- scripts/conductor.py
- scripts/integrate.py
- scripts/preserve.py
- scripts/sanctuary_daemon.py
- scripts/test_bot.py
- scripts/test_campaign.py
- scripts/test_daemon.py
- scripts/test_integrate.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.