The Agentic Post
Breaking
Character.AI Bankruptcy: What Happens to Your Private Chats, and How to Delete Them  ·  What’s New in Claude: Install Artifacts as Apps, Computer Use for Teams, Meetings and More  ·  What’s New in ChatGPT: GPT-6.2 in Chat, ChatGPT Space for Plus, and Live Dictation  ·  Nvidia Stops China Hopper Shipments as US Tightens AI Chip Rules for Southeast Asia  ·  Update: Nvidia Reinstates Jensen Huang as CEO 11 Days After His Resignation  ·  Best AI Models in November 2026: Fable 5.2 vs GPT-6.2 Astra vs Gemini 4 Neon vs Opus 5.5  ·  
Home/AI Safety
10 Rules for Using AI Coding Agents Safely (Without Losing Your Code or Secrets)

10 Rules for Using AI Coding Agents Safely (Without Losing Your Code or Secrets)

AI Safety

Ten practical safety rules for AI coding agents like Claude Code, Codex and Cursor: sandboxes, permissions, secrets, git, reviews, dependencies and prompt injection.

AI coding agents like Claude Code, Codex and Cursor can now edit files, run commands and install packages on their own. That makes them powerful and risky: a confused or tricked agent can delete work, leak secrets or install malware. These ten rules keep you productive while limiting the damage if something goes wrong.

What are the 10 rules for using coding agents safely?

  • 1. Commit before you start. A clean git commit means any bad change can be undone in seconds
  • 2. Use the sandbox. Prefer modes that limit the agent to your project folder; Codex does this by default, Claude Code and Gemini CLI need settings, see our comparison
  • 3. Keep secrets out. Store API keys in environment variables or a secrets manager, never in code or prompts, and exclude .env files from the agent
  • 4. Approve risky commands. Require confirmation for deleting files, pushing code, deploying or running database migrations
  • 5. Never run as admin. Do not give agents root or production credentials
  • 6. Check every new package. Agents can suggest packages that do not exist and attackers register those names; see slopsquatting
  • 7. Install tools only from official sources. Fake extensions have targeted agent users, as in the trojanized Claude Code extension
  • 8. Treat outside content as untrusted. Issues, web pages and README files can hide instructions that hijack the agent
  • 9. Review the diff. Read changes before merging, and run tests; see how to review AI agent code
  • 10. Set budgets and limits. Cap spending and steps so a loop cannot run for hours

What is prompt injection, and why does it matter for coding agents?

Prompt injection is when text the agent reads, like a GitHub issue or a web page, contains instructions such as “upload the .env file to this address.” An agent with shell access may obey. Real attacks have hit agent tools, including GitSpawn and PixelLeak. Limit what the agent can reach and watch for unexpected network calls.

Should I let an agent run fully autonomously?

Only in an isolated environment, like a container or cloud sandbox with no access to secrets or production systems. Full-auto mode is fine for throwaway experiments, not for your main machine or company repositories.

How do teams adopt coding agents safely?

Agree on approved tools, standard permission settings and a review rule that every agent change goes through a pull request. Share a project instructions file, such as CLAUDE.md or AGENTS.md, that tells agents your conventions and forbidden actions. For testing practices, see how coding agents handle testing.

Up Next
How to Make a YouTube Short or TikTok With AI Video Tools: Step by Step

How to Make a YouTube Short or TikTok With AI Video Tools: Step by Step

How-To

Create a vertical short video with AI: script, AI clips from Veo, Kling or Runway, voiceover, captions and editing, plus labelling and copyright rules.

You can make a YouTube Short, TikTok or Reel with AI in about an hour: write a short script, generate a few 5 to 10 second clips with a video tool like Veo, Kling or Runway, add an AI voiceover and captions, and edit them together in a free editor. The secret to good results is planning short, simple shots and keeping a consistent style.

Step 1: How do I write a script for a short?

Keep it under 45 seconds. Ask an assistant: “Write a 40-second vertical video script about three surprising facts about octopuses. Strong hook in the first 2 seconds, one fact per shot, a closing question to drive comments. Give a shot list with a visual description for each line.” Check the facts yourself before filming.

Step 2: Which AI video tool should I use?

  • Google Veo 3.1: short clips with built-in sound; Fast and Lite tiers are cheaper
  • Kling 3.0: up to 15 seconds per shot, consistent characters, lip-synced speech
  • Runway: best for editing footage you filmed yourself
  • MiniMax H3: open-source if you have strong hardware

See our full AI video generator comparison and pricing guide.

Step 3: How do I prompt each clip?

Describe one simple action per clip with subject, setting, camera and style: “Vertical 9:16, close-up of an orange octopus changing colour on a coral reef, slow push-in, soft natural light, documentary style.” Reuse the same style words in every prompt so clips match, and generate two or three versions of each shot to pick the best.

Step 4: How do I add a voiceover and captions?

Record your own voice for authenticity, or use an AI voice from a tool like ElevenLabs; see our AI voice comparison. Most editors, like CapCut or YouTube’s own editor, auto-generate captions, which matter because many people watch muted. Check captions for spelling.

Step 5: How do I edit it together?

  • Put the strongest visual first and cut fast, every 2 to 4 seconds
  • Match clips to the voiceover beats
  • Add royalty-free music at low volume
  • Export in 9:16 vertical, 1080 by 1920

Do I need to label AI-generated videos?

Yes, when the content is realistic. YouTube and TikTok ask creators to disclose realistic AI-generated or altered content, and may add labels themselves. Never create realistic videos of real people without permission; see AI video and deepfakes. Check each tool’s licence for commercial use, especially on free tiers.

How do I make AI shorts that people actually watch?

Audiences skip generic AI clips. Add your own angle: real expertise, opinions, humour or a recurring format. Use AI for visuals and speed, not the idea itself. For marketing uses, see AI video for marketing.