← HOME
JOBS
How do I keep secrets out of agents?
These pages are about reducing what an agent can leak or commit: fewer tools, narrower tokens, a human approval step on risky actions, and GitHub push protection so a secret in a commit is rejected. None of them claims an agent can be made fully safe. Rows appear when the page is due.
Comparison
| Setup | What it does | Where the human approves | Source project and license | Link |
|---|---|---|---|---|
| Prompt Injection Checklist for AI Agent Setups | You can't fully prevent prompt injection, so set your agent up to limit what an injected instruction can do: give it fewer tools, the narrowest permissions, clearly marked external content and a human approval step for risky actions. | Approval: a human signs off on high-impact actions. | OWASP Gen AI Security Project, LLM01:2025 Prompt Injection and LLM06:2025 Excessive Agency, and the Model Context Protocol specification, all checked 28 Oct 2026. | /guides/prompt-injection-checklist-ai-agents/ |
| GitHub Fine-Grained Tokens for an AI Agent | When an AI agent needs to reach GitHub with a personal access token, give it a fine-grained token limited to one resource owner, only the repositories it works on, read-only permissions and a short expiration. Never hand an agent a classic token, which GitHub says "can access every repository that you can access." | A person creates and scopes the token, and can review and revoke it. | This guide follows GitHub's Managing your personal access tokens page step by step. All sources checked 28 Oct 2026. | /guides/least-privilege-github-token-ai-agent/ |
| GitHub Push Protection Against AI Agent Secrets | Turn on GitHub push protection for any repository an AI coding agent can push to, so a commit containing an API key, token or private key is rejected before it reaches GitHub. Then tell the agent that a blocked push means stop and ask you, never bypass. | A blocked push is a stop and ask; the person decides what to do. Never bypass is the instruction the page gives the agent. | This guide follows GitHub's secret scanning documentation, checked on 28 Oct 2026. | /guides/github-push-protection-ai-agent-secrets/ |
How to choose
Start with the checklist, then give the agent a fine-grained, short-lived, read-only GitHub token if it needs GitHub at all, and turn on push protection on any repo it can push to. When the later redaction note is due, use it if the agent reads files that might contain keys. None of these steps replaces a human approval step on risky actions.