# Coding agent security

Coding agent security covers the risks of an AI agent that reads a repository and runs commands: destructive commands, leaked secrets, injected instructions in files, and unsafe code or dependencies.

## What goes wrong

- **Destructive commands.** `rm -rf`, `git push --force`, `DROP TABLE`, a migration run against production.
- **Secrets.** Reading `.env` or cloud credentials, then printing, committing or sending them. See [secret detection](/glossary/secret-detection).
- **Injected instructions.** A README, an issue, a code comment or a web page the agent reads tells it what to do next: an [indirect prompt injection](/glossary/indirect-prompt-injection).
- **Supply chain.** Installing a package that does not exist under that name, or one an attacker registered for the purpose.
- **Unsafe code.** Disabled checks, weakened auth, a test deleted to make the build pass.

## What helps

1. Run the agent in a [sandbox](/glossary/agent-sandboxing) with no production credentials.
2. Check each command before it runs, with its arguments.
3. Hold irreversible ones for a person: see [human-in-the-loop](/glossary/human-in-the-loop).
4. Scan what leaves: commits, pull requests, network calls.
5. Keep the trace of every step.

Approval prompts alone wear out. After the fiftieth "allow?", people press yes without reading, so approvals work only when few commands need one.

## With White Circle

[Control](/products/control) checks terminal commands and code execution against your policies before they run, and blocks injected instructions before they reach a tool.

