Borrowing it
Nothing to install: this file belongs to vmehera123/leashd. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/vmehera123/leashd/main/.claude/skills/architecture/SKILL.mdgit clone --depth 1 https://github.com/vmehera123/leashdWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/vmehera123/leashd/architecture)<a href="https://agentmods.dev/skills/vmehera123/leashd/architecture"><img src="https://agentmods.dev/badge/skills/vmehera123/leashd/architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/vmehera123/leashd/architecture"><img src="https://agentmods.dev/badge/skills/vmehera123/leashd/architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00074 | $0.01682 |
| Opus 5.5 | $0.00030 | $0.00673 |
| Sonnet 5.5 | $0.00015 | $0.00336 |
| Haiku 4.5 | $0.00007 | $0.00168 |
Grade C, and why
architecture scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 28d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
3. **Approval** — `require_approval` → human buttons (interactive) or AI auto-approve (autonomous). Hard-denies (credentials, `rm -rf`, `sudo`, force-push) **can never be overridden** by any approver. How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
leashd architecture
Safety-first agentic coding daemon. Shape: connectors → Engine → middleware → agent runtime, with every tool call the agent makes intercepted by a three-layer safety pipeline, and an EventBus decoupling plugins. This skill is the mental model plus a file map.
Specs drift.
specs/app/has deeper numbered references, but they lag the code —00-quick-reference.mdcan still describe deleted modules (auto_approver.py,task_v4.py, …). Treat specs andREADME.mdas starting points; verify every claim against source before relying on it.
Request flow (one user message)
connector (web / telegram) → MultiConnector (chat_id routing)
→ Engine.handle_message → middleware chain (auth, rate limit)
→ agent runtime executes
→ each tool call → Gatekeeper: sandbox → policy → approval
→ streamed response back to the connector
Bootstrap & wiring
main.py:run() → cli.py (argparse router, smart-start) → main.py:start() → one of _run_cli / _run_telegram / _run_web / _run_multi (chosen by which connectors are configured) → app.py:build_engine(config, connector).
build_engine is the single wiring point. In order it constructs: logging → MCP server config → session store + message store (both global at ~/.leashd/) → SessionManager → agent = get_agent(config.agent_runtime, config) → EventBus → PolicyEngine → SandboxEnforcer → AuditLogger → create_builtin_plugins(...) → approval + interaction coordinators (only when a connector exists) → middleware chain → git handler → Engine(...).
Components & where they live
| Concern | Entry point | Notes |
|---|---|---|
| Orchestration | core/engine.py (Engine) |
message loop, streaming, command dispatch, auto-approve mgmt |
| Safety pipeline | core/safety/gatekeeper.py (ToolGatekeeper) |
orchestrates sandbox → policy → approval for every tool call |
| ↳ sandbox | core/safety/sandbox.py (SandboxEnforcer) |
path-scoped to approved dirs |
| ↳ policy | core/safety/policy.py + policies/*.yaml |
allow / deny / require_approval; compound-bash split, deny-wins |
| ↳ approval | core/safety/approvals.py (ApprovalCoordinator) |
human buttons or AI auto-approve |
| ↳ audit | core/safety/audit.py → .leashd/audit.jsonl |
append-only decisions |
| Agent runtime | agents/registry.py + agents/runtimes/tmux.py / tmux_session.py |
only tmux is registered since 2.0; new runtimes register_agent(); build_engine(agent=) takes any BaseAgent |
| Connectors | connectors/{web,telegram,multi}.py |
MultiConnector routes by chat_id |
| Multi-conversation | core/chat_sessions.py + connectors/telegram_sessions.py |
/session — N conversations in one chat, addressed <chat>:s<n> |
| Middleware | middleware/{auth,rate_limit}.py |
run before the agent |
| Plugins / events | core/events.py (EventBus) + plugins/registry.py |
pub/sub; create_builtin_plugins() registers builtins |
| Autonomous / task | plugins/builtin/task_orchestrator.py, _task_prompts.py |
/task: implement → verify → opt-in review |
| Config | core/config.py (LeashdConfig), config_store.py |
env prefix LEASHD_ |
| Storage | storage/{sqlite,memory}.py |
two-tier, see below |
| Web UI / hooks | web/ (app.py, routes.py, ws_handler.py, tmux_hooks.py) |
FastAPI; also hosts the tmux hook receiver |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 28d ago Changed · -1 tokens per session 8e93491b4b3a
- 1mo ago Changed · +1 lines 556713914ddb
- 2mo ago First seen · 85 lines · 75 tokens per session scan C 77f21de553c3
architecture is a skill published in the GitHub repository vmehera123/leashd (5 stars, last pushed 7d ago), licensed Apache-2.0. It adds 74 tokens to every session and 1,682 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
martinloop-govern
Govern coding-agent implementation with MartinLoop budgets, preflight checks, stop conditions, recovery, and verifier-backed evidence.
air-blackbox-sales-agent
AIR Blackbox's autonomous sales prospecting agent. Finds Python AI projects on GitHub that need EU AI Act compliance, identifies the right person to contact (CEO, CTO, lead maintainer), runs a free compliance scan, and drafts personalized outreach emails that convert to engagement. The sales flow: free scan as the…
interpret-results
Interprets AIR Blackbox scan results and maps findings to specific EU AI Act articles, recitals, and remediation steps. Use when the user has scan output and wants to understand what to fix, why it matters, or how to prioritize.
compliance-scan
Scans a Python AI project for EU AI Act compliance gaps using AIR Blackbox. Use when the user asks to check compliance, scan their code, audit their AI project, or mentions EU AI Act, Articles 9-15, or compliance checking.
nio-scan
Nio code/skill execution-risk scanner. Use when the user wants to scan a file, repo, directory, or skill for execution risks — e.g. "scan this code for risks", "is this file/plugin dangerous", "check this repo for malicious code", "run nio scan on ". Focused single-purpose skill; for other Nio operations use /nio.
nio-external-score
Nio external scoring-endpoint snapshot. Use when the user asks about their current Nio/risk scores from configured external scoring endpoints — e.g. "what's my Nio score", "tell me the nio score", "check my external/guardrail endpoint scores", "what do my scoring services return right now", "list the current risk…