Why I Built a Rust Desktop Guardrail for 23 AI Coding Agents
Inside CloudLink: compiling SSH hosts and cloud CLIs into one zero-secret Agent Skill, delivering safely across Windows & WSL2, and gating risky writes with one-time approvals.
Running Claude Code, Codex, Cursor, and Antigravity side by side against real Linux servers and cloud CLIs (cf, vercel, oci, gh) surfaces the same operational friction every week:
- Repeated context rebuilding — every fresh session requires re-explaining SSH aliases, Docker paths, reverse-proxy domains, and deployment links.
- Zero buffer against hallucinated writes — a single bad
docker compose down -v, destructive cloud CLI call, orcat .envcan break production or pull raw credentials into model context. - Siloed tribal knowledge — operational notes uncovered in one coding agent never carry over to the others unless copied manually.
CloudLink approaches this as a local-first infrastructure context compiler, cross-agent Skill distributor, and command guardrail rather than another terminal emulator or a fake OS sandbox.
Zero-Secret Compilation: Share Topology, Never Credentials
To troubleshoot accurately, an agent needs verified facts—which services run on a host, how domains map to instances, and which guarded entry point to invoke—not raw passwords, private keys, or API tokens.
CloudLink probes SSH hosts and cloud CLIs strictly read-only, then compiles a single cloudlink-servers Skill (SKILL.md plus references/*.md):
- Real credentials remain inside local OpenSSH config and official CLI login states.
- Compiled docs contain stable resource IDs, probed facts, and exact
cloudlink-guardinvocation routes. - Cloud providers default to dynamic account/owner auto-follow with stable per-item exclusions, keeping scope accurate as repositories or DNS zones grow.
Enforcing Policies in cloudlink-guard
Prompt instructions alone are a weak barrier during long multi-step sessions. CloudLink routes execution through a bundled Rust sidecar (cloudlink-guard), paired with an automatic PreToolUse Bash hook for Claude Code.
Every new resource starts in Confirm Changes, with policy tiers evaluated locally before spawning any subprocess:
| Tier | Representative Commands | Confirm Changes | Auto-Ops |
|---|---|---|---|
| Read-only | df -h, docker ps, nginx -t, cf zones list | Auto-allow | Auto-allow |
| Routine writes | nginx -s reload, docker compose up -d, cf dns create | One-time desktop approval | Auto-allow |
| High-risk | Volume/DB deletion, firewall, SSH/sshd edits, reboot, curl | sh | One-time desktop approval | One-time desktop approval |
| Hard redlines | Reading .env/*.pem/id_*, docker inspect env vars, repo delete, default-branch force-push | Deny | Deny |
Pending actions pause inside the Activity view behind a 5-minute, single-use approval ticket. Before process launch, the runner re-verifies route identity and policy revision so stale or altered requests never slip through.
Safe Ownership Across 23 Local AI Agents
On Windows and WSL2, some agents read dedicated folders (~/.claude/skills, ~/.gemini/config/skills) while 17 agents share the universal ~/.agents/skills directory.
Writing carelessly into shared directories risks clobbering handwritten skills or widening access accidentally. CloudLink enforces three delivery invariants:
- Explicit intersection: shared directories receive only the exact intersection of enabled agents—toggling one never silently expands another.
- Ownership & reparse verification: every write validates
.cloudlink.jsonownership, symlinks, and Windows reparse points. - Reversible takeover: conflicts trigger automatic backups with one-click undo.
Cross-Agent Ops Memory and Honest Boundaries
Agents can record durable infrastructure findings into ~/.cloudlink/inbox/<resource>.md. Notes never auto-merge: CloudLink scans each entry with gitleaks secret rules and prompt-injection checks, surfaces it for manual review in the desktop app, and recompiles the shared Skill only after explicit approval.
Trust in developer tooling starts by naming both what it guarantees and where its boundary ends.
CloudLink does not claim to be an OS-level sandbox, does not fabricate remote rollback after a command exits on a remote server, and stops active checks once fully quit (never auto-approving stale tickets). Keeping those limits explicit makes it a guardrail engineers can rely on in real daily workflows.