Dev.to
7/7/2026

I gave an LLM agent write access to my cloud drive. Three bugs taught me how to constrain it.
Short summary
The author built Mediary Scout, a self-hosted LLM agent that searches, transfers, and verifies media files on cloud drives. Three production bugs taught hard lessons: cap agent-produced numbers (search counts, selections) with deterministic ceilings rather than trusting prompts, let the model judge messy real-world state against actual files instead of mechanical guesses, and keep deterministic bookkeeping strictly separate from agent judgment. The core principle: the model proposes, deterministic code decides and performs every irreversible action.
- •Put deterministic ceilings on any number an agent produces (searches, selections, API calls) — never trust prompts to enforce restraint
- •Let the model judge real-world state by inspecting actual files, not by parsing filenames or counting entries mechanically
- •Keep agent judgment and deterministic bookkeeping strictly separated; trouble starts when those responsibilities bleed into each other
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



